The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/iscsi/icl_wrappers.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
    3  *
    4  * Copyright (c) 2014 The FreeBSD Foundation
    5  *
    6  * This software was developed by Edward Tomasz Napierala under sponsorship
    7  * from the FreeBSD Foundation.
    8  *
    9  * Redistribution and use in source and binary forms, with or without
   10  * modification, are permitted provided that the following conditions
   11  * are met:
   12  * 1. Redistributions of source code must retain the above copyright
   13  *    notice, this list of conditions and the following disclaimer.
   14  * 2. Redistributions in binary form must reproduce the above copyright
   15  *    notice, this list of conditions and the following disclaimer in the
   16  *    documentation and/or other materials provided with the distribution.
   17  *
   18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   21  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   28  * SUCH DAMAGE.
   29  *
   30  * $FreeBSD$
   31  */
   32 
   33 /*
   34  * This file is used to provide the initiator and target with a prettier
   35  * interface.  It must not be included by ICL modules, such as icl_soft.c.
   36  */
   37 
   38 #ifndef ICL_WRAPPERS_H
   39 #define ICL_WRAPPERS_H
   40 
   41 #include <sys/bio.h>
   42 #include <sys/kobj.h>
   43 
   44 #include <dev/iscsi/icl.h>
   45 #include <icl_conn_if.h>
   46 
   47 static inline struct icl_pdu *
   48 icl_pdu_new(struct icl_conn *ic, int flags)
   49 {
   50 
   51         return (ICL_CONN_NEW_PDU(ic, flags));
   52 }
   53 
   54 static inline size_t
   55 icl_pdu_data_segment_length(const struct icl_pdu *ip)
   56 {
   57 
   58         return (ICL_CONN_PDU_DATA_SEGMENT_LENGTH(ip->ip_conn, ip));
   59 }
   60 
   61 static inline int
   62 icl_pdu_append_bio(struct icl_pdu *ip, struct bio *bp, size_t offset,
   63     size_t len, int flags)
   64 {
   65 
   66         return (ICL_CONN_PDU_APPEND_BIO(ip->ip_conn, ip, bp, offset, len,
   67             flags));
   68 }
   69 
   70 static inline int
   71 icl_pdu_append_data(struct icl_pdu *ip, const void *addr, size_t len, int flags)
   72 {
   73 
   74         return (ICL_CONN_PDU_APPEND_DATA(ip->ip_conn, ip, addr, len, flags));
   75 }
   76 
   77 static inline void
   78 icl_pdu_get_bio(struct icl_pdu *ip, size_t pdu_off, struct bio *bp,
   79     size_t bio_off, size_t len)
   80 {
   81 
   82         ICL_CONN_PDU_GET_BIO(ip->ip_conn, ip, pdu_off, bp, bio_off, len);
   83 }
   84 
   85 static inline void
   86 icl_pdu_get_data(struct icl_pdu *ip, size_t off, void *addr, size_t len)
   87 {
   88 
   89         ICL_CONN_PDU_GET_DATA(ip->ip_conn, ip, off, addr, len);
   90 }
   91 
   92 static inline void
   93 icl_pdu_queue(struct icl_pdu *ip)
   94 {
   95 
   96         ICL_CONN_PDU_QUEUE(ip->ip_conn, ip);
   97 }
   98 
   99 static inline void
  100 icl_pdu_queue_cb(struct icl_pdu *ip, icl_pdu_cb cb)
  101 {
  102 
  103         ICL_CONN_PDU_QUEUE_CB(ip->ip_conn, ip, cb);
  104 }
  105 
  106 static inline void
  107 icl_pdu_free(struct icl_pdu *ip)
  108 {
  109 
  110         ICL_CONN_PDU_FREE(ip->ip_conn, ip);
  111 }
  112 
  113 static inline void
  114 icl_conn_free(struct icl_conn *ic)
  115 {
  116 
  117         ICL_CONN_FREE(ic);
  118 }
  119 
  120 static inline int
  121 icl_conn_handoff(struct icl_conn *ic, int fd)
  122 {
  123 
  124         return (ICL_CONN_HANDOFF(ic, fd));
  125 }
  126 
  127 static inline void
  128 icl_conn_close(struct icl_conn *ic)
  129 {
  130 
  131         ICL_CONN_CLOSE(ic);
  132 }
  133 
  134 static inline int
  135 icl_conn_task_setup(struct icl_conn *ic, struct icl_pdu *ip,
  136     struct ccb_scsiio *csio, uint32_t *task_tagp, void **prvp)
  137 {
  138 
  139         return (ICL_CONN_TASK_SETUP(ic, ip, csio, task_tagp, prvp));
  140 }
  141 
  142 static inline void
  143 icl_conn_task_done(struct icl_conn *ic, void *prv)
  144 {
  145 
  146         ICL_CONN_TASK_DONE(ic, prv);
  147 }
  148 
  149 static inline int
  150 icl_conn_transfer_setup(struct icl_conn *ic, struct icl_pdu *ip,
  151     union ctl_io *io, uint32_t *transfer_tagp, void **prvp)
  152 {
  153 
  154         return (ICL_CONN_TRANSFER_SETUP(ic, ip, io, transfer_tagp, prvp));
  155 }
  156 
  157 static inline void
  158 icl_conn_transfer_done(struct icl_conn *ic, void *prv)
  159 {
  160 
  161         ICL_CONN_TRANSFER_DONE(ic, prv);
  162 }
  163 
  164 /*
  165  * The function below is only used with ICL_KERNEL_PROXY.
  166  */
  167 static inline int
  168 icl_conn_connect(struct icl_conn *ic, int domain, int socktype,
  169     int protocol, struct sockaddr *from_sa, struct sockaddr *to_sa)
  170 {
  171 
  172         return (ICL_CONN_CONNECT(ic, domain, socktype, protocol,
  173             from_sa, to_sa));
  174 }
  175 
  176 #endif /* !ICL_WRAPPERS_H */

Cache object: cb533c9d56e3bb50ad030a6ac5b7c170


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.