~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/xen/interface/io/vscsiif.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/xen/interface/io/vscsiif.h (Architecture ppc) and /include/xen/interface/io/vscsiif.h (Architecture sparc)


  1 /* SPDX-License-Identifier: MIT */                  1 /* SPDX-License-Identifier: MIT */
  2 /*********************************************      2 /******************************************************************************
  3  * vscsiif.h                                        3  * vscsiif.h
  4  *                                                  4  *
  5  * Based on the blkif.h code.                       5  * Based on the blkif.h code.
  6  *                                                  6  *
  7  * Copyright(c) FUJITSU Limited 2008.               7  * Copyright(c) FUJITSU Limited 2008.
  8  */                                                 8  */
  9                                                     9 
 10 #ifndef __XEN__PUBLIC_IO_SCSI_H__                  10 #ifndef __XEN__PUBLIC_IO_SCSI_H__
 11 #define __XEN__PUBLIC_IO_SCSI_H__                  11 #define __XEN__PUBLIC_IO_SCSI_H__
 12                                                    12 
 13 #include "ring.h"                                  13 #include "ring.h"
 14 #include "../grant_table.h"                        14 #include "../grant_table.h"
 15                                                    15 
 16 /*                                                 16 /*
 17  * Feature and Parameter Negotiation               17  * Feature and Parameter Negotiation
 18  * =================================               18  * =================================
 19  * The two halves of a Xen pvSCSI driver utili     19  * The two halves of a Xen pvSCSI driver utilize nodes within the XenStore to
 20  * communicate capabilities and to negotiate o     20  * communicate capabilities and to negotiate operating parameters.  This
 21  * section enumerates these nodes which reside     21  * section enumerates these nodes which reside in the respective front and
 22  * backend portions of the XenStore, following     22  * backend portions of the XenStore, following the XenBus convention.
 23  *                                                 23  *
 24  * Any specified default value is in effect if     24  * Any specified default value is in effect if the corresponding XenBus node
 25  * is not present in the XenStore.                 25  * is not present in the XenStore.
 26  *                                                 26  *
 27  * XenStore nodes in sections marked "PRIVATE"     27  * XenStore nodes in sections marked "PRIVATE" are solely for use by the
 28  * driver side whose XenBus tree contains them     28  * driver side whose XenBus tree contains them.
 29  *                                                 29  *
 30  *********************************************     30  *****************************************************************************
 31  *                            Backend XenBus N     31  *                            Backend XenBus Nodes
 32  *********************************************     32  *****************************************************************************
 33  *                                                 33  *
 34  *------------------ Backend Device Identifica     34  *------------------ Backend Device Identification (PRIVATE) ------------------
 35  *                                                 35  *
 36  * p-devname                                       36  * p-devname
 37  *      Values:         string                     37  *      Values:         string
 38  *                                                 38  *
 39  *      A free string used to identify the phy     39  *      A free string used to identify the physical device (e.g. a disk name).
 40  *                                                 40  *
 41  * p-dev                                           41  * p-dev
 42  *      Values:         string                     42  *      Values:         string
 43  *                                                 43  *
 44  *      A string specifying the backend device     44  *      A string specifying the backend device: either a 4-tuple "h:c:t:l"
 45  *      (host, controller, target, lun, all in     45  *      (host, controller, target, lun, all integers), or a WWN (e.g.
 46  *      "naa.60014054ac780582:0").                 46  *      "naa.60014054ac780582:0").
 47  *                                                 47  *
 48  * v-dev                                           48  * v-dev
 49  *      Values:         string                     49  *      Values:         string
 50  *                                                 50  *
 51  *      A string specifying the frontend devic     51  *      A string specifying the frontend device in form of a 4-tuple "h:c:t:l"
 52  *      (host, controller, target, lun, all in     52  *      (host, controller, target, lun, all integers).
 53  *                                                 53  *
 54  *--------------------------------- Features -     54  *--------------------------------- Features ---------------------------------
 55  *                                                 55  *
 56  * feature-sg-grant                                56  * feature-sg-grant
 57  *      Values:         unsigned [VSCSIIF_SG_T     57  *      Values:         unsigned [VSCSIIF_SG_TABLESIZE...65535]
 58  *      Default Value:  0                          58  *      Default Value:  0
 59  *                                                 59  *
 60  *      Specifies the maximum number of scatte     60  *      Specifies the maximum number of scatter/gather elements in grant pages
 61  *      supported. If not set, the backend sup     61  *      supported. If not set, the backend supports up to VSCSIIF_SG_TABLESIZE
 62  *      SG elements specified directly in the      62  *      SG elements specified directly in the request.
 63  *                                                 63  *
 64  *********************************************     64  *****************************************************************************
 65  *                            Frontend XenBus      65  *                            Frontend XenBus Nodes
 66  *********************************************     66  *****************************************************************************
 67  *                                                 67  *
 68  *----------------------- Request Transport Pa     68  *----------------------- Request Transport Parameters -----------------------
 69  *                                                 69  *
 70  * event-channel                                   70  * event-channel
 71  *      Values:         unsigned                   71  *      Values:         unsigned
 72  *                                                 72  *
 73  *      The identifier of the Xen event channe     73  *      The identifier of the Xen event channel used to signal activity
 74  *      in the ring buffer.                        74  *      in the ring buffer.
 75  *                                                 75  *
 76  * ring-ref                                        76  * ring-ref
 77  *      Values:         unsigned                   77  *      Values:         unsigned
 78  *                                                 78  *
 79  *      The Xen grant reference granting permi     79  *      The Xen grant reference granting permission for the backend to map
 80  *      the sole page in a single page sized r     80  *      the sole page in a single page sized ring buffer.
 81  *                                                 81  *
 82  * protocol                                        82  * protocol
 83  *      Values:         string (XEN_IO_PROTO_A     83  *      Values:         string (XEN_IO_PROTO_ABI_*)
 84  *      Default Value:  XEN_IO_PROTO_ABI_NATIV     84  *      Default Value:  XEN_IO_PROTO_ABI_NATIVE
 85  *                                                 85  *
 86  *      The machine ABI rules governing the fo     86  *      The machine ABI rules governing the format of all ring request and
 87  *      response structures.                       87  *      response structures.
 88  */                                                88  */
 89                                                    89 
 90 /*                                                 90 /*
 91  * Xenstore format in practice                     91  * Xenstore format in practice
 92  * ===========================                     92  * ===========================
 93  *                                                 93  *
 94  * The backend driver uses a single_host:many_     94  * The backend driver uses a single_host:many_devices notation to manage domU
 95  * devices. Everything is stored in /local/dom     95  * devices. Everything is stored in /local/domain/<backend_domid>/backend/vscsi/.
 96  * The xenstore layout looks like this (dom0 i     96  * The xenstore layout looks like this (dom0 is assumed to be the backend_domid):
 97  *                                                 97  *
 98  *     <domid>/<vhost>/feature-host = ""           98  *     <domid>/<vhost>/feature-host = ""
 99  *     <domid>/<vhost>/frontend = "/local/doma     99  *     <domid>/<vhost>/frontend = "/local/domain/<domid>/device/vscsi/0"
100  *     <domid>/<vhost>/frontend-id = "<domid>"    100  *     <domid>/<vhost>/frontend-id = "<domid>"
101  *     <domid>/<vhost>/online = "1"               101  *     <domid>/<vhost>/online = "1"
102  *     <domid>/<vhost>/state = "4"                102  *     <domid>/<vhost>/state = "4"
103  *     <domid>/<vhost>/vscsi-devs/dev-0/p-dev     103  *     <domid>/<vhost>/vscsi-devs/dev-0/p-dev = "8:0:2:1" or "naa.wwn:lun"
104  *     <domid>/<vhost>/vscsi-devs/dev-0/state     104  *     <domid>/<vhost>/vscsi-devs/dev-0/state = "4"
105  *     <domid>/<vhost>/vscsi-devs/dev-0/v-dev     105  *     <domid>/<vhost>/vscsi-devs/dev-0/v-dev = "0:0:0:0"
106  *     <domid>/<vhost>/vscsi-devs/dev-1/p-dev     106  *     <domid>/<vhost>/vscsi-devs/dev-1/p-dev = "8:0:2:2"
107  *     <domid>/<vhost>/vscsi-devs/dev-1/state     107  *     <domid>/<vhost>/vscsi-devs/dev-1/state = "4"
108  *     <domid>/<vhost>/vscsi-devs/dev-1/v-dev     108  *     <domid>/<vhost>/vscsi-devs/dev-1/v-dev = "0:0:1:0"
109  *                                                109  *
110  * The frontend driver maintains its state in     110  * The frontend driver maintains its state in
111  * /local/domain/<domid>/device/vscsi/.           111  * /local/domain/<domid>/device/vscsi/.
112  *                                                112  *
113  *     <vhost>/backend = "/local/domain/0/back    113  *     <vhost>/backend = "/local/domain/0/backend/vscsi/<domid>/<vhost>"
114  *     <vhost>/backend-id = ""                    114  *     <vhost>/backend-id = ""
115  *     <vhost>/event-channel = "20"               115  *     <vhost>/event-channel = "20"
116  *     <vhost>/ring-ref = "43"                    116  *     <vhost>/ring-ref = "43"
117  *     <vhost>/state = "4"                        117  *     <vhost>/state = "4"
118  *     <vhost>/vscsi-devs/dev-0/state = "4"       118  *     <vhost>/vscsi-devs/dev-0/state = "4"
119  *     <vhost>/vscsi-devs/dev-1/state = "4"       119  *     <vhost>/vscsi-devs/dev-1/state = "4"
120  *                                                120  *
121  * In addition to the entries for backend and     121  * In addition to the entries for backend and frontend these flags are stored
122  * for the toolstack:                             122  * for the toolstack:
123  *                                                123  *
124  *     <domid>/<vhost>/vscsi-devs/dev-1/p-devn    124  *     <domid>/<vhost>/vscsi-devs/dev-1/p-devname = "/dev/$device"
125  *     <domid>/<vhost>/libxl_ctrl_index = ""      125  *     <domid>/<vhost>/libxl_ctrl_index = ""
126  *                                                126  *
127  *                                                127  *
128  * Backend/frontend protocol                      128  * Backend/frontend protocol
129  * =========================                      129  * =========================
130  *                                                130  *
131  * To create a vhost along with a device:         131  * To create a vhost along with a device:
132  *     <domid>/<vhost>/feature-host = ""          132  *     <domid>/<vhost>/feature-host = ""
133  *     <domid>/<vhost>/frontend = "/local/doma    133  *     <domid>/<vhost>/frontend = "/local/domain/<domid>/device/vscsi/0"
134  *     <domid>/<vhost>/frontend-id = "<domid>"    134  *     <domid>/<vhost>/frontend-id = "<domid>"
135  *     <domid>/<vhost>/online = "1"               135  *     <domid>/<vhost>/online = "1"
136  *     <domid>/<vhost>/state = "1"                136  *     <domid>/<vhost>/state = "1"
137  *     <domid>/<vhost>/vscsi-devs/dev-0/p-dev     137  *     <domid>/<vhost>/vscsi-devs/dev-0/p-dev = "8:0:2:1"
138  *     <domid>/<vhost>/vscsi-devs/dev-0/state     138  *     <domid>/<vhost>/vscsi-devs/dev-0/state = "1"
139  *     <domid>/<vhost>/vscsi-devs/dev-0/v-dev     139  *     <domid>/<vhost>/vscsi-devs/dev-0/v-dev = "0:0:0:0"
140  * Wait for <domid>/<vhost>/state + <domid>/<v    140  * Wait for <domid>/<vhost>/state + <domid>/<vhost>/vscsi-devs/dev-0/state become 4
141  *                                                141  *
142  * To add another device to a vhost:              142  * To add another device to a vhost:
143  *     <domid>/<vhost>/state = "7"                143  *     <domid>/<vhost>/state = "7"
144  *     <domid>/<vhost>/vscsi-devs/dev-1/p-dev     144  *     <domid>/<vhost>/vscsi-devs/dev-1/p-dev = "8:0:2:2"
145  *     <domid>/<vhost>/vscsi-devs/dev-1/state     145  *     <domid>/<vhost>/vscsi-devs/dev-1/state = "1"
146  *     <domid>/<vhost>/vscsi-devs/dev-1/v-dev     146  *     <domid>/<vhost>/vscsi-devs/dev-1/v-dev = "0:0:1:0"
147  * Wait for <domid>/<vhost>/state + <domid>/<v    147  * Wait for <domid>/<vhost>/state + <domid>/<vhost>/vscsi-devs/dev-1/state become 4
148  *                                                148  *
149  * To remove a device from a vhost:               149  * To remove a device from a vhost:
150  *     <domid>/<vhost>/state = "7"                150  *     <domid>/<vhost>/state = "7"
151  *     <domid>/<vhost>/vscsi-devs/dev-1/state     151  *     <domid>/<vhost>/vscsi-devs/dev-1/state = "5"
152  * Wait for <domid>/<vhost>/state to become 4     152  * Wait for <domid>/<vhost>/state to become 4
153  * Wait for <domid>/<vhost>/vscsi-devs/dev-1/s    153  * Wait for <domid>/<vhost>/vscsi-devs/dev-1/state become 6
154  * Remove <domid>/<vhost>/vscsi-devs/dev-1/{st    154  * Remove <domid>/<vhost>/vscsi-devs/dev-1/{state,p-dev,v-dev,p-devname}
155  * Remove <domid>/<vhost>/vscsi-devs/dev-1/       155  * Remove <domid>/<vhost>/vscsi-devs/dev-1/
156  *                                                156  *
157  */                                               157  */
158                                                   158 
159 /* Requests from the frontend to the backend *    159 /* Requests from the frontend to the backend */
160                                                   160 
161 /*                                                161 /*
162  * Request a SCSI operation specified via a CD    162  * Request a SCSI operation specified via a CDB in vscsiif_request.cmnd.
163  * The target is specified via channel, id and    163  * The target is specified via channel, id and lun.
164  *                                                164  *
165  * The operation to be performed is specified     165  * The operation to be performed is specified via a CDB in cmnd[], the length
166  * of the CDB is in cmd_len. sc_data_direction    166  * of the CDB is in cmd_len. sc_data_direction specifies the direction of data
167  * (to the device, from the device, or none at    167  * (to the device, from the device, or none at all).
168  *                                                168  *
169  * If data is to be transferred to or from the    169  * If data is to be transferred to or from the device the buffer(s) in the
170  * guest memory is/are specified via one or mu    170  * guest memory is/are specified via one or multiple scsiif_request_segment
171  * descriptors each specifying a memory page v    171  * descriptors each specifying a memory page via a grant_ref_t, a offset into
172  * the page and the length of the area in that    172  * the page and the length of the area in that page. All scsiif_request_segment
173  * areas concatenated form the resulting data     173  * areas concatenated form the resulting data buffer used by the operation.
174  * If the number of scsiif_request_segment are    174  * If the number of scsiif_request_segment areas is not too large (less than
175  * or equal VSCSIIF_SG_TABLESIZE) the areas ca    175  * or equal VSCSIIF_SG_TABLESIZE) the areas can be specified directly in the
176  * seg[] array and the number of valid scsiif_    176  * seg[] array and the number of valid scsiif_request_segment elements is to be
177  * set in nr_segments.                            177  * set in nr_segments.
178  *                                                178  *
179  * If "feature-sg-grant" in the Xenstore is se    179  * If "feature-sg-grant" in the Xenstore is set it is possible to specify more
180  * than VSCSIIF_SG_TABLESIZE scsiif_request_se    180  * than VSCSIIF_SG_TABLESIZE scsiif_request_segment elements via indirection.
181  * The maximum number of allowed scsiif_reques    181  * The maximum number of allowed scsiif_request_segment elements is the value
182  * of the "feature-sg-grant" entry from Xensto    182  * of the "feature-sg-grant" entry from Xenstore. When using indirection the
183  * seg[] array doesn't contain specifications     183  * seg[] array doesn't contain specifications of the data buffers, but
184  * references to scsiif_request_segment arrays    184  * references to scsiif_request_segment arrays, which in turn reference the
185  * data buffers. While nr_segments holds the n    185  * data buffers. While nr_segments holds the number of populated seg[] entries
186  * (plus the set VSCSIIF_SG_GRANT bit), the nu    186  * (plus the set VSCSIIF_SG_GRANT bit), the number of scsiif_request_segment
187  * elements referencing the target data buffer    187  * elements referencing the target data buffers is calculated from the lengths
188  * of the seg[] elements (the sum of all valid    188  * of the seg[] elements (the sum of all valid seg[].length divided by the
189  * size of one scsiif_request_segment structur    189  * size of one scsiif_request_segment structure). The frontend may use a mix of
190  * direct and indirect requests.                  190  * direct and indirect requests.
191  */                                               191  */
192 #define VSCSIIF_ACT_SCSI_CDB            1         192 #define VSCSIIF_ACT_SCSI_CDB            1
193                                                   193 
194 /*                                                194 /*
195  * Request abort of a running operation for th    195  * Request abort of a running operation for the specified target given by
196  * channel, id, lun and the operation's rqid i    196  * channel, id, lun and the operation's rqid in ref_rqid.
197  */                                               197  */
198 #define VSCSIIF_ACT_SCSI_ABORT          2         198 #define VSCSIIF_ACT_SCSI_ABORT          2
199                                                   199 
200 /*                                                200 /*
201  * Request a device reset of the specified tar    201  * Request a device reset of the specified target (channel and id).
202  */                                               202  */
203 #define VSCSIIF_ACT_SCSI_RESET          3         203 #define VSCSIIF_ACT_SCSI_RESET          3
204                                                   204 
205 /*                                                205 /*
206  * Preset scatter/gather elements for a follow    206  * Preset scatter/gather elements for a following request. Deprecated.
207  * Keeping the define only to avoid usage of t    207  * Keeping the define only to avoid usage of the value "4" for other actions.
208  */                                               208  */
209 #define VSCSIIF_ACT_SCSI_SG_PRESET      4         209 #define VSCSIIF_ACT_SCSI_SG_PRESET      4
210                                                   210 
211 /*                                                211 /*
212  * Maximum scatter/gather segments per request    212  * Maximum scatter/gather segments per request.
213  *                                                213  *
214  * Considering balance between allocating at l    214  * Considering balance between allocating at least 16 "vscsiif_request"
215  * structures on one page (4096 bytes) and the    215  * structures on one page (4096 bytes) and the number of scatter/gather
216  * elements needed, we decided to use 26 as a     216  * elements needed, we decided to use 26 as a magic number.
217  *                                                217  *
218  * If "feature-sg-grant" is set, more scatter/    218  * If "feature-sg-grant" is set, more scatter/gather elements can be specified
219  * by placing them in one or more (up to VSCSI    219  * by placing them in one or more (up to VSCSIIF_SG_TABLESIZE) granted pages.
220  * In this case the vscsiif_request seg elemen    220  * In this case the vscsiif_request seg elements don't contain references to
221  * the user data, but to the SG elements refer    221  * the user data, but to the SG elements referencing the user data.
222  */                                               222  */
223 #define VSCSIIF_SG_TABLESIZE            26        223 #define VSCSIIF_SG_TABLESIZE            26
224                                                   224 
225 /*                                                225 /*
226  * based on Linux kernel 2.6.18, still valid      226  * based on Linux kernel 2.6.18, still valid
227  *                                                227  *
228  * Changing these values requires support of m    228  * Changing these values requires support of multiple protocols via the rings
229  * as "old clients" will blindly use these val    229  * as "old clients" will blindly use these values and the resulting structure
230  * sizes.                                         230  * sizes.
231  */                                               231  */
232 #define VSCSIIF_MAX_COMMAND_SIZE        16        232 #define VSCSIIF_MAX_COMMAND_SIZE        16
233 #define VSCSIIF_SENSE_BUFFERSIZE        96        233 #define VSCSIIF_SENSE_BUFFERSIZE        96
234 #define VSCSIIF_PAGE_SIZE               4096      234 #define VSCSIIF_PAGE_SIZE               4096
235                                                   235 
236 struct scsiif_request_segment {                   236 struct scsiif_request_segment {
237         grant_ref_t gref;                         237         grant_ref_t gref;
238         uint16_t offset;                          238         uint16_t offset;
239         uint16_t length;                          239         uint16_t length;
240 };                                                240 };
241                                                   241 
242 #define VSCSIIF_SG_PER_PAGE     (VSCSIIF_PAGE_    242 #define VSCSIIF_SG_PER_PAGE     (VSCSIIF_PAGE_SIZE / \
243                                  sizeof(struct    243                                  sizeof(struct scsiif_request_segment))
244                                                   244 
245 /* Size of one request is 252 bytes */            245 /* Size of one request is 252 bytes */
246 struct vscsiif_request {                          246 struct vscsiif_request {
247         uint16_t rqid;          /* private gue    247         uint16_t rqid;          /* private guest value, echoed in resp  */
248         uint8_t act;            /* command bet    248         uint8_t act;            /* command between backend and frontend */
249         uint8_t cmd_len;        /* valid CDB b    249         uint8_t cmd_len;        /* valid CDB bytes */
250                                                   250 
251         uint8_t cmnd[VSCSIIF_MAX_COMMAND_SIZE]    251         uint8_t cmnd[VSCSIIF_MAX_COMMAND_SIZE]; /* the CDB */
252         uint16_t timeout_per_command;   /* dep    252         uint16_t timeout_per_command;   /* deprecated */
253         uint16_t channel, id, lun;      /* (vi    253         uint16_t channel, id, lun;      /* (virtual) device specification */
254         uint16_t ref_rqid;              /* com    254         uint16_t ref_rqid;              /* command abort reference */
255         uint8_t sc_data_direction;      /* for    255         uint8_t sc_data_direction;      /* for DMA_TO_DEVICE(1)
256                                            DMA    256                                            DMA_FROM_DEVICE(2)
257                                            DMA    257                                            DMA_NONE(3) requests */
258         uint8_t nr_segments;            /* Num    258         uint8_t nr_segments;            /* Number of pieces of scatter-gather */
259 /*                                                259 /*
260  * flag in nr_segments: SG elements via grant     260  * flag in nr_segments: SG elements via grant page
261  *                                                261  *
262  * If VSCSIIF_SG_GRANT is set, the low 7 bits     262  * If VSCSIIF_SG_GRANT is set, the low 7 bits of nr_segments specify the number
263  * of grant pages containing SG elements. Usab    263  * of grant pages containing SG elements. Usable if "feature-sg-grant" set.
264  */                                               264  */
265 #define VSCSIIF_SG_GRANT        0x80              265 #define VSCSIIF_SG_GRANT        0x80
266                                                   266 
267         struct scsiif_request_segment seg[VSCS    267         struct scsiif_request_segment seg[VSCSIIF_SG_TABLESIZE];
268         uint32_t reserved[3];                     268         uint32_t reserved[3];
269 };                                                269 };
270                                                   270 
271 /* Size of one response is 252 bytes */           271 /* Size of one response is 252 bytes */
272 struct vscsiif_response {                         272 struct vscsiif_response {
273         uint16_t rqid;          /* identifies     273         uint16_t rqid;          /* identifies request */
274         uint8_t padding;                          274         uint8_t padding;
275         uint8_t sense_len;                        275         uint8_t sense_len;
276         uint8_t sense_buffer[VSCSIIF_SENSE_BUF    276         uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];
277         int32_t rslt;                             277         int32_t rslt;
278         uint32_t residual_len;  /* request buf    278         uint32_t residual_len;  /* request bufflen -
279                                    return the     279                                    return the value from physical device */
280         uint32_t reserved[36];                    280         uint32_t reserved[36];
281 };                                                281 };
282                                                   282 
283 /* SCSI I/O status from vscsiif_response->rslt    283 /* SCSI I/O status from vscsiif_response->rslt */
284 #define XEN_VSCSIIF_RSLT_STATUS(x)  ((x) & 0x0    284 #define XEN_VSCSIIF_RSLT_STATUS(x)  ((x) & 0x00ff)
285                                                   285 
286 /* Host I/O status from vscsiif_response->rslt    286 /* Host I/O status from vscsiif_response->rslt */
287 #define XEN_VSCSIIF_RSLT_HOST(x)    (((x) & 0x    287 #define XEN_VSCSIIF_RSLT_HOST(x)    (((x) & 0x00ff0000) >> 16)
288 #define XEN_VSCSIIF_RSLT_HOST_OK                  288 #define XEN_VSCSIIF_RSLT_HOST_OK                   0
289 /* Couldn't connect before timeout */             289 /* Couldn't connect before timeout */
290 #define XEN_VSCSIIF_RSLT_HOST_NO_CONNECT          290 #define XEN_VSCSIIF_RSLT_HOST_NO_CONNECT           1
291 /* Bus busy through timeout */                    291 /* Bus busy through timeout */
292 #define XEN_VSCSIIF_RSLT_HOST_BUS_BUSY            292 #define XEN_VSCSIIF_RSLT_HOST_BUS_BUSY             2
293 /* Timed out for other reason */                  293 /* Timed out for other reason */
294 #define XEN_VSCSIIF_RSLT_HOST_TIME_OUT            294 #define XEN_VSCSIIF_RSLT_HOST_TIME_OUT             3
295 /* Bad target */                                  295 /* Bad target */
296 #define XEN_VSCSIIF_RSLT_HOST_BAD_TARGET          296 #define XEN_VSCSIIF_RSLT_HOST_BAD_TARGET           4
297 /* Abort for some other reason */                 297 /* Abort for some other reason */
298 #define XEN_VSCSIIF_RSLT_HOST_ABORT               298 #define XEN_VSCSIIF_RSLT_HOST_ABORT                5
299 /* Parity error */                                299 /* Parity error */
300 #define XEN_VSCSIIF_RSLT_HOST_PARITY              300 #define XEN_VSCSIIF_RSLT_HOST_PARITY               6
301 /* Internal error */                              301 /* Internal error */
302 #define XEN_VSCSIIF_RSLT_HOST_ERROR               302 #define XEN_VSCSIIF_RSLT_HOST_ERROR                7
303 /* Reset by somebody */                           303 /* Reset by somebody */
304 #define XEN_VSCSIIF_RSLT_HOST_RESET               304 #define XEN_VSCSIIF_RSLT_HOST_RESET                8
305 /* Unexpected interrupt */                        305 /* Unexpected interrupt */
306 #define XEN_VSCSIIF_RSLT_HOST_BAD_INTR            306 #define XEN_VSCSIIF_RSLT_HOST_BAD_INTR             9
307 /* Force command past mid-layer */                307 /* Force command past mid-layer */
308 #define XEN_VSCSIIF_RSLT_HOST_PASSTHROUGH         308 #define XEN_VSCSIIF_RSLT_HOST_PASSTHROUGH         10
309 /* Retry requested */                             309 /* Retry requested */
310 #define XEN_VSCSIIF_RSLT_HOST_SOFT_ERROR          310 #define XEN_VSCSIIF_RSLT_HOST_SOFT_ERROR          11
311 /* Hidden retry requested */                      311 /* Hidden retry requested */
312 #define XEN_VSCSIIF_RSLT_HOST_IMM_RETRY           312 #define XEN_VSCSIIF_RSLT_HOST_IMM_RETRY           12
313 /* Requeue command requested */                   313 /* Requeue command requested */
314 #define XEN_VSCSIIF_RSLT_HOST_REQUEUE             314 #define XEN_VSCSIIF_RSLT_HOST_REQUEUE             13
315 /* Transport error disrupted I/O */               315 /* Transport error disrupted I/O */
316 #define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_DISRUP    316 #define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_DISRUPTED 14
317 /* Transport class fastfailed */                  317 /* Transport class fastfailed */
318 #define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_FAILFA    318 #define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_FAILFAST  15
319 /* Permanent target failure */                    319 /* Permanent target failure */
320 #define XEN_VSCSIIF_RSLT_HOST_TARGET_FAILURE      320 #define XEN_VSCSIIF_RSLT_HOST_TARGET_FAILURE      16
321 /* Permanent nexus failure on path */             321 /* Permanent nexus failure on path */
322 #define XEN_VSCSIIF_RSLT_HOST_NEXUS_FAILURE       322 #define XEN_VSCSIIF_RSLT_HOST_NEXUS_FAILURE       17
323 /* Space allocation on device failed */           323 /* Space allocation on device failed */
324 #define XEN_VSCSIIF_RSLT_HOST_ALLOC_FAILURE       324 #define XEN_VSCSIIF_RSLT_HOST_ALLOC_FAILURE       18
325 /* Medium error */                                325 /* Medium error */
326 #define XEN_VSCSIIF_RSLT_HOST_MEDIUM_ERROR        326 #define XEN_VSCSIIF_RSLT_HOST_MEDIUM_ERROR        19
327 /* Transport marginal errors */                   327 /* Transport marginal errors */
328 #define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_MARGIN    328 #define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_MARGINAL  20
329                                                   329 
330 /* Result values of reset operations */           330 /* Result values of reset operations */
331 #define XEN_VSCSIIF_RSLT_RESET_SUCCESS  0x2002    331 #define XEN_VSCSIIF_RSLT_RESET_SUCCESS  0x2002
332 #define XEN_VSCSIIF_RSLT_RESET_FAILED   0x2003    332 #define XEN_VSCSIIF_RSLT_RESET_FAILED   0x2003
333                                                   333 
334 DEFINE_RING_TYPES(vscsiif, struct vscsiif_requ    334 DEFINE_RING_TYPES(vscsiif, struct vscsiif_request, struct vscsiif_response);
335                                                   335 
336                                                   336 
337 #endif  /*__XEN__PUBLIC_IO_SCSI_H__*/             337 #endif  /*__XEN__PUBLIC_IO_SCSI_H__*/
338                                                   338 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php