aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-11-23 10:28:57 -0500
committerMichael S. Tsirkin <mst@redhat.com>2014-12-09 05:05:31 -0500
commitd75dff39dfb86b0b8925f10b1f13fc353ae9f1b0 (patch)
tree6060b1abd3873a90f20cb6974fbfb01d3d4221c2 /include/linux
parent6ae7feb316d656b6b9b182dc6caa5526f0edce51 (diff)
virtio_scsi: v1.0 support
Note: for consistency, and to avoid sparse errors, convert all fields, even those no longer in use for virtio v1.0. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/virtio_scsi.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/include/linux/virtio_scsi.h b/include/linux/virtio_scsi.h
index de429d1f4357..af448649a975 100644
--- a/include/linux/virtio_scsi.h
+++ b/include/linux/virtio_scsi.h
@@ -27,13 +27,15 @@
27#ifndef _LINUX_VIRTIO_SCSI_H 27#ifndef _LINUX_VIRTIO_SCSI_H
28#define _LINUX_VIRTIO_SCSI_H 28#define _LINUX_VIRTIO_SCSI_H
29 29
30#include <linux/virtio_types.h>
31
30#define VIRTIO_SCSI_CDB_SIZE 32 32#define VIRTIO_SCSI_CDB_SIZE 32
31#define VIRTIO_SCSI_SENSE_SIZE 96 33#define VIRTIO_SCSI_SENSE_SIZE 96
32 34
33/* SCSI command request, followed by data-out */ 35/* SCSI command request, followed by data-out */
34struct virtio_scsi_cmd_req { 36struct virtio_scsi_cmd_req {
35 u8 lun[8]; /* Logical Unit Number */ 37 u8 lun[8]; /* Logical Unit Number */
36 u64 tag; /* Command identifier */ 38 __virtio64 tag; /* Command identifier */
37 u8 task_attr; /* Task attribute */ 39 u8 task_attr; /* Task attribute */
38 u8 prio; /* SAM command priority field */ 40 u8 prio; /* SAM command priority field */
39 u8 crn; 41 u8 crn;
@@ -43,20 +45,20 @@ struct virtio_scsi_cmd_req {
43/* SCSI command request, followed by protection information */ 45/* SCSI command request, followed by protection information */
44struct virtio_scsi_cmd_req_pi { 46struct virtio_scsi_cmd_req_pi {
45 u8 lun[8]; /* Logical Unit Number */ 47 u8 lun[8]; /* Logical Unit Number */
46 u64 tag; /* Command identifier */ 48 __virtio64 tag; /* Command identifier */
47 u8 task_attr; /* Task attribute */ 49 u8 task_attr; /* Task attribute */
48 u8 prio; /* SAM command priority field */ 50 u8 prio; /* SAM command priority field */
49 u8 crn; 51 u8 crn;
50 u32 pi_bytesout; /* DataOUT PI Number of bytes */ 52 __virtio32 pi_bytesout; /* DataOUT PI Number of bytes */
51 u32 pi_bytesin; /* DataIN PI Number of bytes */ 53 __virtio32 pi_bytesin; /* DataIN PI Number of bytes */
52 u8 cdb[VIRTIO_SCSI_CDB_SIZE]; 54 u8 cdb[VIRTIO_SCSI_CDB_SIZE];
53} __packed; 55} __packed;
54 56
55/* Response, followed by sense data and data-in */ 57/* Response, followed by sense data and data-in */
56struct virtio_scsi_cmd_resp { 58struct virtio_scsi_cmd_resp {
57 u32 sense_len; /* Sense data length */ 59 __virtio32 sense_len; /* Sense data length */
58 u32 resid; /* Residual bytes in data buffer */ 60 __virtio32 resid; /* Residual bytes in data buffer */
59 u16 status_qualifier; /* Status qualifier */ 61 __virtio16 status_qualifier; /* Status qualifier */
60 u8 status; /* Command completion status */ 62 u8 status; /* Command completion status */
61 u8 response; /* Response values */ 63 u8 response; /* Response values */
62 u8 sense[VIRTIO_SCSI_SENSE_SIZE]; 64 u8 sense[VIRTIO_SCSI_SENSE_SIZE];
@@ -64,10 +66,10 @@ struct virtio_scsi_cmd_resp {
64 66
65/* Task Management Request */ 67/* Task Management Request */
66struct virtio_scsi_ctrl_tmf_req { 68struct virtio_scsi_ctrl_tmf_req {
67 u32 type; 69 __virtio32 type;
68 u32 subtype; 70 __virtio32 subtype;
69 u8 lun[8]; 71 u8 lun[8];
70 u64 tag; 72 __virtio64 tag;
71} __packed; 73} __packed;
72 74
73struct virtio_scsi_ctrl_tmf_resp { 75struct virtio_scsi_ctrl_tmf_resp {
@@ -76,20 +78,20 @@ struct virtio_scsi_ctrl_tmf_resp {
76 78
77/* Asynchronous notification query/subscription */ 79/* Asynchronous notification query/subscription */
78struct virtio_scsi_ctrl_an_req { 80struct virtio_scsi_ctrl_an_req {
79 u32 type; 81 __virtio32 type;
80 u8 lun[8]; 82 u8 lun[8];
81 u32 event_requested; 83 __virtio32 event_requested;
82} __packed; 84} __packed;
83 85
84struct virtio_scsi_ctrl_an_resp { 86struct virtio_scsi_ctrl_an_resp {
85 u32 event_actual; 87 __virtio32 event_actual;
86 u8 response; 88 u8 response;
87} __packed; 89} __packed;
88 90
89struct virtio_scsi_event { 91struct virtio_scsi_event {
90 u32 event; 92 __virtio32 event;
91 u8 lun[8]; 93 u8 lun[8];
92 u32 reason; 94 __virtio32 reason;
93} __packed; 95} __packed;
94 96
95struct virtio_scsi_config { 97struct virtio_scsi_config {