^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * vscsiif.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Based on the blkif.h code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Permission is hereby granted, free of charge, to any person obtaining a copy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * of this software and associated documentation files (the "Software"), to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * deal in the Software without restriction, including without limitation the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * sell copies of the Software, and to permit persons to whom the Software is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * furnished to do so, subject to the following conditions:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * The above copyright notice and this permission notice shall be included in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * all copies or substantial portions of the Software.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * DEALINGS IN THE SOFTWARE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * Copyright(c) FUJITSU Limited 2008.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #ifndef __XEN__PUBLIC_IO_SCSI_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define __XEN__PUBLIC_IO_SCSI_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include "ring.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #include "../grant_table.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * Feature and Parameter Negotiation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * =================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * The two halves of a Xen pvSCSI driver utilize nodes within the XenStore to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * communicate capabilities and to negotiate operating parameters. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * section enumerates these nodes which reside in the respective front and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) * backend portions of the XenStore, following the XenBus convention.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) * Any specified default value is in effect if the corresponding XenBus node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * is not present in the XenStore.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) * XenStore nodes in sections marked "PRIVATE" are solely for use by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * driver side whose XenBus tree contains them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) *****************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * Backend XenBus Nodes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) *****************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) *------------------ Backend Device Identification (PRIVATE) ------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * p-devname
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * Values: string
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * A free string used to identify the physical device (e.g. a disk name).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) * p-dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) * Values: string
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) * A string specifying the backend device: either a 4-tuple "h:c:t:l"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) * (host, controller, target, lun, all integers), or a WWN (e.g.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) * "naa.60014054ac780582").
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) * v-dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) * Values: string
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * A string specifying the frontend device in form of a 4-tuple "h:c:t:l"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) * (host, controller, target, lun, all integers).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) *--------------------------------- Features ---------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) * feature-sg-grant
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) * Values: unsigned [VSCSIIF_SG_TABLESIZE...65535]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) * Default Value: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) * Specifies the maximum number of scatter/gather elements in grant pages
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) * supported. If not set, the backend supports up to VSCSIIF_SG_TABLESIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) * SG elements specified directly in the request.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) *****************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) * Frontend XenBus Nodes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) *****************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) *----------------------- Request Transport Parameters -----------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) * event-channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) * Values: unsigned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) * The identifier of the Xen event channel used to signal activity
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) * in the ring buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) * ring-ref
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) * Values: unsigned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) * The Xen grant reference granting permission for the backend to map
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) * the sole page in a single page sized ring buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) * protocol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) * Values: string (XEN_IO_PROTO_ABI_*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) * Default Value: XEN_IO_PROTO_ABI_NATIVE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) * The machine ABI rules governing the format of all ring request and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) * response structures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) /* Requests from the frontend to the backend */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) * Request a SCSI operation specified via a CDB in vscsiif_request.cmnd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) * The target is specified via channel, id and lun.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) * The operation to be performed is specified via a CDB in cmnd[], the length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) * of the CDB is in cmd_len. sc_data_direction specifies the direction of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) * (to the device, from the device, or none at all).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) * If data is to be transferred to or from the device the buffer(s) in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) * guest memory is/are specified via one or multiple scsiif_request_segment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) * descriptors each specifying a memory page via a grant_ref_t, a offset into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) * the page and the length of the area in that page. All scsiif_request_segment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) * areas concatenated form the resulting data buffer used by the operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) * If the number of scsiif_request_segment areas is not too large (less than
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) * or equal VSCSIIF_SG_TABLESIZE) the areas can be specified directly in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) * seg[] array and the number of valid scsiif_request_segment elements is to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) * set in nr_segments.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) * If "feature-sg-grant" in the Xenstore is set it is possible to specify more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) * than VSCSIIF_SG_TABLESIZE scsiif_request_segment elements via indirection.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) * The maximum number of allowed scsiif_request_segment elements is the value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) * of the "feature-sg-grant" entry from Xenstore. When using indirection the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) * seg[] array doesn't contain specifications of the data buffers, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) * references to scsiif_request_segment arrays, which in turn reference the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) * data buffers. While nr_segments holds the number of populated seg[] entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) * (plus the set VSCSIIF_SG_GRANT bit), the number of scsiif_request_segment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) * elements referencing the target data buffers is calculated from the lengths
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) * of the seg[] elements (the sum of all valid seg[].length divided by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) * size of one scsiif_request_segment structure).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) #define VSCSIIF_ACT_SCSI_CDB 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) * Request abort of a running operation for the specified target given by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) * channel, id, lun and the operation's rqid in ref_rqid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) #define VSCSIIF_ACT_SCSI_ABORT 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) * Request a device reset of the specified target (channel and id).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) #define VSCSIIF_ACT_SCSI_RESET 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) * Preset scatter/gather elements for a following request. Deprecated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) * Keeping the define only to avoid usage of the value "4" for other actions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) #define VSCSIIF_ACT_SCSI_SG_PRESET 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) * Maximum scatter/gather segments per request.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) * Considering balance between allocating at least 16 "vscsiif_request"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) * structures on one page (4096 bytes) and the number of scatter/gather
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) * elements needed, we decided to use 26 as a magic number.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) * If "feature-sg-grant" is set, more scatter/gather elements can be specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) * by placing them in one or more (up to VSCSIIF_SG_TABLESIZE) granted pages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) * In this case the vscsiif_request seg elements don't contain references to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) * the user data, but to the SG elements referencing the user data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) #define VSCSIIF_SG_TABLESIZE 26
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) * based on Linux kernel 2.6.18, still valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) * Changing these values requires support of multiple protocols via the rings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) * as "old clients" will blindly use these values and the resulting structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) * sizes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) #define VSCSIIF_MAX_COMMAND_SIZE 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) #define VSCSIIF_SENSE_BUFFERSIZE 96
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) struct scsiif_request_segment {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) grant_ref_t gref;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) uint16_t offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) uint16_t length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) #define VSCSIIF_SG_PER_PAGE (PAGE_SIZE / sizeof(struct scsiif_request_segment))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) /* Size of one request is 252 bytes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) struct vscsiif_request {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) uint16_t rqid; /* private guest value, echoed in resp */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) uint8_t act; /* command between backend and frontend */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) uint8_t cmd_len; /* valid CDB bytes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) uint8_t cmnd[VSCSIIF_MAX_COMMAND_SIZE]; /* the CDB */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) uint16_t timeout_per_command; /* deprecated */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) uint16_t channel, id, lun; /* (virtual) device specification */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) uint16_t ref_rqid; /* command abort reference */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) uint8_t sc_data_direction; /* for DMA_TO_DEVICE(1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) DMA_FROM_DEVICE(2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) DMA_NONE(3) requests */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) uint8_t nr_segments; /* Number of pieces of scatter-gather */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) * flag in nr_segments: SG elements via grant page
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) * If VSCSIIF_SG_GRANT is set, the low 7 bits of nr_segments specify the number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) * of grant pages containing SG elements. Usable if "feature-sg-grant" set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) #define VSCSIIF_SG_GRANT 0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) struct scsiif_request_segment seg[VSCSIIF_SG_TABLESIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) uint32_t reserved[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) /* Size of one response is 252 bytes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) struct vscsiif_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) uint16_t rqid; /* identifies request */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) uint8_t padding;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) uint8_t sense_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) int32_t rslt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) uint32_t residual_len; /* request bufflen -
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) return the value from physical device */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) uint32_t reserved[36];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) DEFINE_RING_TYPES(vscsiif, struct vscsiif_request, struct vscsiif_response);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) #endif /*__XEN__PUBLIC_IO_SCSI_H__*/