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
428header-y += virtio_pci.h428header-y += virtio_pci.h
429header-y += virtio_ring.h429header-y += virtio_ring.h
430header-y += virtio_rng.h430header-y += virtio_rng.h
431header-y += virtio_scsi.h
431header-y += vm_sockets.h432header-y += vm_sockets.h
432header-y += vt.h433header-y += vt.h
433header-y += wait.h434header-y += wait.h
include/uapi/linux/virtio_scsi.h+37−37
@@ -34,78 +34,78 @@ · 33 unmodified lines
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 0111#define VIRTIO_SCSI_F_INOUT 0