aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-11-23 10:49:12 -0500
committerMichael S. Tsirkin <mst@redhat.com>2014-12-09 05:06:31 -0500
commitfba7f020e80d59a90d6135b0965cd488cc86f695 (patch)
treedb09e2130b2f5ce6b7ce9b893b23e2736489f283 /include
parent106d81f58a5e7f41e857b8805e9d899e87d7a874 (diff)
virtio_scsi: export to userspace
Replace uXX by __uXX and _packed by __attribute((packed)) as seems to be the norm for userspace headers. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/virtio_scsi.h74
2 files changed, 38 insertions, 37 deletions
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 615f96a6022a..2e8fd10f0299 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -428,6 +428,7 @@ header-y += virtio_net.h
428header-y += virtio_pci.h 428header-y += virtio_pci.h
429header-y += virtio_ring.h 429header-y += virtio_ring.h
430header-y += virtio_rng.h 430header-y += virtio_rng.h
431header-y += virtio_scsi.h
431header-y += vm_sockets.h 432header-y += vm_sockets.h
432header-y += vt.h 433header-y += vt.h
433header-y += wait.h 434header-y += wait.h
diff --git a/include/uapi/linux/virtio_scsi.h b/include/uapi/linux/virtio_scsi.h
index af448649a975..42b9370771b0 100644
--- a/include/uapi/linux/virtio_scsi.h
+++ b/include/uapi/linux/virtio_scsi.h
@@ -34,78 +34,78 @@
34 34
35/* SCSI command request, followed by data-out */ 35/* SCSI command request, followed by data-out */
36struct virtio_scsi_cmd_req { 36struct virtio_scsi_cmd_req {
37 u8 lun[8]; /* Logical Unit Number */ 37 __u8 lun[8]; /* Logical Unit Number */
38 __virtio64 tag; /* Command identifier */ 38 __virtio64 tag; /* Command identifier */
39 u8 task_attr; /* Task attribute */ 39 __u8 task_attr; /* Task attribute */
40 u8 prio; /* SAM command priority field */ 40 __u8 prio; /* SAM command priority field */
41 u8 crn; 41 __u8 crn;
42 u8 cdb[VIRTIO_SCSI_CDB_SIZE]; 42 __u8 cdb[VIRTIO_SCSI_CDB_SIZE];
43} __packed; 43} __attribute__((packed));
44 44
45/* SCSI command request, followed by protection information */ 45/* SCSI command request, followed by protection information */
46struct virtio_scsi_cmd_req_pi { 46struct virtio_scsi_cmd_req_pi {
47 u8 lun[8]; /* Logical Unit Number */ 47 __u8 lun[8]; /* Logical Unit Number */
48 __virtio64 tag; /* Command identifier */ 48 __virtio64 tag; /* Command identifier */
49 u8 task_attr; /* Task attribute */ 49 __u8 task_attr; /* Task attribute */
50 u8 prio; /* SAM command priority field */ 50 __u8 prio; /* SAM command priority field */
51 u8 crn; 51 __u8 crn;
52 __virtio32 pi_bytesout; /* DataOUT PI Number of bytes */ 52 __virtio32 pi_bytesout; /* DataOUT PI Number of bytes */
53 __virtio32 pi_bytesin; /* DataIN PI Number of bytes */ 53 __virtio32 pi_bytesin; /* DataIN PI Number of bytes */
54 u8 cdb[VIRTIO_SCSI_CDB_SIZE]; 54 __u8 cdb[VIRTIO_SCSI_CDB_SIZE];
55} __packed; 55} __attribute__((packed));
56 56
57/* Response, followed by sense data and data-in */ 57/* Response, followed by sense data and data-in */
58struct virtio_scsi_cmd_resp { 58struct virtio_scsi_cmd_resp {
59 __virtio32 sense_len; /* Sense data length */ 59 __virtio32 sense_len; /* Sense data length */
60 __virtio32 resid; /* Residual bytes in data buffer */ 60 __virtio32 resid; /* Residual bytes in data buffer */
61 __virtio16 status_qualifier; /* Status qualifier */ 61 __virtio16 status_qualifier; /* Status qualifier */
62 u8 status; /* Command completion status */ 62 __u8 status; /* Command completion status */
63 u8 response; /* Response values */ 63 __u8 response; /* Response values */
64 u8 sense[VIRTIO_SCSI_SENSE_SIZE]; 64 __u8 sense[VIRTIO_SCSI_SENSE_SIZE];
65} __packed; 65} __attribute__((packed));
66 66
67/* Task Management Request */ 67/* Task Management Request */
68struct virtio_scsi_ctrl_tmf_req { 68struct virtio_scsi_ctrl_tmf_req {
69 __virtio32 type; 69 __virtio32 type;
70 __virtio32 subtype; 70 __virtio32 subtype;
71 u8 lun[8]; 71 __u8 lun[8];
72 __virtio64 tag; 72 __virtio64 tag;
73} __packed; 73} __attribute__((packed));
74 74
75struct virtio_scsi_ctrl_tmf_resp { 75struct virtio_scsi_ctrl_tmf_resp {
76 u8 response; 76 __u8 response;
77} __packed; 77} __attribute__((packed));
78 78
79/* Asynchronous notification query/subscription */ 79/* Asynchronous notification query/subscription */
80struct virtio_scsi_ctrl_an_req { 80struct virtio_scsi_ctrl_an_req {
81 __virtio32 type; 81 __virtio32 type;
82 u8 lun[8]; 82 __u8 lun[8];
83 __virtio32 event_requested; 83 __virtio32 event_requested;
84} __packed; 84} __attribute__((packed));
85 85
86struct virtio_scsi_ctrl_an_resp { 86struct virtio_scsi_ctrl_an_resp {
87 __virtio32 event_actual; 87 __virtio32 event_actual;
88 u8 response; 88 __u8 response;
89} __packed; 89} __attribute__((packed));
90 90
91struct virtio_scsi_event { 91struct virtio_scsi_event {
92 __virtio32 event; 92 __virtio32 event;
93 u8 lun[8]; 93 __u8 lun[8];
94 __virtio32 reason; 94 __virtio32 reason;
95} __packed; 95} __attribute__((packed));
96 96
97struct virtio_scsi_config { 97struct virtio_scsi_config {
98 u32 num_queues; 98 __u32 num_queues;
99 u32 seg_max; 99 __u32 seg_max;
100 u32 max_sectors; 100 __u32 max_sectors;
101 u32 cmd_per_lun; 101 __u32 cmd_per_lun;
102 u32 event_info_size; 102 __u32 event_info_size;
103 u32 sense_size; 103 __u32 sense_size;
104 u32 cdb_size; 104 __u32 cdb_size;
105 u16 max_channel; 105 __u16 max_channel;
106 u16 max_target; 106 __u16 max_target;
107 u32 max_lun; 107 __u32 max_lun;
108} __packed; 108} __attribute__((packed));
109 109
110/* Feature Bits */ 110/* Feature Bits */
111#define VIRTIO_SCSI_F_INOUT 0 111#define VIRTIO_SCSI_F_INOUT 0