History

virtio_scsi: export to userspace

Replace uXX by __uXX and _packed by __attribute((packed)) as seems to be the norm for userspace headers.

Michael S. Tsirkin committed 11 years ago

Commit fba7f021 parent 106d81f2 files · +38 −37Browse files

Showing the changes to include/uapi/linux (2 of 2 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/Kbuild +1 −0
  2. include/uapi/linux/virtio_scsi.h +37 −37
include/uapi/linux/Kbuild+1−0
@@ -428,6 +428,7 @@ header-y += virtio_net.h · 427 unmodified lines
428428 header-y += virtio_pci.h
429429 header-y += virtio_ring.h
430430 header-y += virtio_rng.h
431+header-y += virtio_scsi.h
431432 header-y += vm_sockets.h
432433 header-y += vt.h
433434 header-y += wait.h
include/uapi/linux/virtio_scsi.h+37−37
@@ -34,78 +34,78 @@ · 33 unmodified lines
3434
3535 /* SCSI command request, followed by data-out */
3636 struct virtio_scsi_cmd_req {
37− u8 lun[8]; /* Logical Unit Number */
37+ __u8 lun[8]; /* Logical Unit Number */
3838 __virtio64 tag; /* Command identifier */
39− u8 task_attr; /* Task attribute */
40− u8 prio; /* SAM command priority field */
41− u8 crn;
42− u8 cdb[VIRTIO_SCSI_CDB_SIZE];
43−} __packed;
39+ __u8 task_attr; /* Task attribute */
40+ __u8 prio; /* SAM command priority field */
41+ __u8 crn;
42+ __u8 cdb[VIRTIO_SCSI_CDB_SIZE];
43+} __attribute__((packed));
4444
4545 /* SCSI command request, followed by protection information */
4646 struct virtio_scsi_cmd_req_pi {
47− u8 lun[8]; /* Logical Unit Number */
47+ __u8 lun[8]; /* Logical Unit Number */
4848 __virtio64 tag; /* Command identifier */
49− u8 task_attr; /* Task attribute */
50− u8 prio; /* SAM command priority field */
51− u8 crn;
49+ __u8 task_attr; /* Task attribute */
50+ __u8 prio; /* SAM command priority field */
51+ __u8 crn;
5252 __virtio32 pi_bytesout; /* DataOUT PI Number of bytes */
5353 __virtio32 pi_bytesin; /* DataIN PI Number of bytes */
54− u8 cdb[VIRTIO_SCSI_CDB_SIZE];
55−} __packed;
54+ __u8 cdb[VIRTIO_SCSI_CDB_SIZE];
55+} __attribute__((packed));
5656
5757 /* Response, followed by sense data and data-in */
5858 struct virtio_scsi_cmd_resp {
5959 __virtio32 sense_len; /* Sense data length */
6060 __virtio32 resid; /* Residual bytes in data buffer */
6161 __virtio16 status_qualifier; /* Status qualifier */
62− u8 status; /* Command completion status */
63− u8 response; /* Response values */
64− u8 sense[VIRTIO_SCSI_SENSE_SIZE];
65−} __packed;
62+ __u8 status; /* Command completion status */
63+ __u8 response; /* Response values */
64+ __u8 sense[VIRTIO_SCSI_SENSE_SIZE];
65+} __attribute__((packed));
6666
6767 /* Task Management Request */
6868 struct virtio_scsi_ctrl_tmf_req {
6969 __virtio32 type;
7070 __virtio32 subtype;
71− u8 lun[8];
71+ __u8 lun[8];
7272 __virtio64 tag;
73−} __packed;
73+} __attribute__((packed));
7474
7575 struct virtio_scsi_ctrl_tmf_resp {
76− u8 response;
77−} __packed;
76+ __u8 response;
77+} __attribute__((packed));
7878
7979 /* Asynchronous notification query/subscription */
8080 struct virtio_scsi_ctrl_an_req {
8181 __virtio32 type;
82− u8 lun[8];
82+ __u8 lun[8];
8383 __virtio32 event_requested;
84−} __packed;
84+} __attribute__((packed));
8585
8686 struct virtio_scsi_ctrl_an_resp {
8787 __virtio32 event_actual;
88− u8 response;
89−} __packed;
88+ __u8 response;
89+} __attribute__((packed));
9090
9191 struct virtio_scsi_event {
9292 __virtio32 event;
93− u8 lun[8];
93+ __u8 lun[8];
9494 __virtio32 reason;
95−} __packed;
95+} __attribute__((packed));
9696
9797 struct virtio_scsi_config {
98− u32 num_queues;
99− u32 seg_max;
100− u32 max_sectors;
101− u32 cmd_per_lun;
102− u32 event_info_size;
103− u32 sense_size;
104− u32 cdb_size;
105− u16 max_channel;
106− u16 max_target;
107− u32 max_lun;
108−} __packed;
98+ __u32 num_queues;
99+ __u32 seg_max;
100+ __u32 max_sectors;
101+ __u32 cmd_per_lun;
102+ __u32 event_info_size;
103+ __u32 sense_size;
104+ __u32 cdb_size;
105+ __u16 max_channel;
106+ __u16 max_target;
107+ __u32 max_lun;
108+} __attribute__((packed));
109109
110110 /* Feature Bits */
111111 #define VIRTIO_SCSI_F_INOUT 0