diff options
Diffstat (limited to 'include/uapi/linux/virtio_blk.h')
-rw-r--r-- | include/uapi/linux/virtio_blk.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h index 247c8ba8544a..3c53eec4ae22 100644 --- a/include/uapi/linux/virtio_blk.h +++ b/include/uapi/linux/virtio_blk.h | |||
@@ -31,22 +31,25 @@ | |||
31 | #include <linux/virtio_types.h> | 31 | #include <linux/virtio_types.h> |
32 | 32 | ||
33 | /* Feature bits */ | 33 | /* Feature bits */ |
34 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ | ||
35 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ | 34 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ |
36 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ | 35 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ |
37 | #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ | 36 | #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ |
38 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ | 37 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ |
39 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ | 38 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ |
40 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ | ||
41 | #define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */ | ||
42 | #define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ | 39 | #define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ |
43 | #define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */ | ||
44 | #define VIRTIO_BLK_F_MQ 12 /* support more than one vq */ | 40 | #define VIRTIO_BLK_F_MQ 12 /* support more than one vq */ |
45 | 41 | ||
42 | /* Legacy feature bits */ | ||
43 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
44 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ | ||
45 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ | ||
46 | #define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */ | ||
47 | #define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */ | ||
46 | #ifndef __KERNEL__ | 48 | #ifndef __KERNEL__ |
47 | /* Old (deprecated) name for VIRTIO_BLK_F_WCE. */ | 49 | /* Old (deprecated) name for VIRTIO_BLK_F_WCE. */ |
48 | #define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE | 50 | #define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE |
49 | #endif | 51 | #endif |
52 | #endif /* !VIRTIO_BLK_NO_LEGACY */ | ||
50 | 53 | ||
51 | #define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ | 54 | #define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ |
52 | 55 | ||
@@ -100,8 +103,10 @@ struct virtio_blk_config { | |||
100 | #define VIRTIO_BLK_T_IN 0 | 103 | #define VIRTIO_BLK_T_IN 0 |
101 | #define VIRTIO_BLK_T_OUT 1 | 104 | #define VIRTIO_BLK_T_OUT 1 |
102 | 105 | ||
106 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
103 | /* This bit says it's a scsi command, not an actual read or write. */ | 107 | /* This bit says it's a scsi command, not an actual read or write. */ |
104 | #define VIRTIO_BLK_T_SCSI_CMD 2 | 108 | #define VIRTIO_BLK_T_SCSI_CMD 2 |
109 | #endif /* VIRTIO_BLK_NO_LEGACY */ | ||
105 | 110 | ||
106 | /* Cache flush command */ | 111 | /* Cache flush command */ |
107 | #define VIRTIO_BLK_T_FLUSH 4 | 112 | #define VIRTIO_BLK_T_FLUSH 4 |
@@ -109,8 +114,10 @@ struct virtio_blk_config { | |||
109 | /* Get device ID command */ | 114 | /* Get device ID command */ |
110 | #define VIRTIO_BLK_T_GET_ID 8 | 115 | #define VIRTIO_BLK_T_GET_ID 8 |
111 | 116 | ||
117 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
112 | /* Barrier before this op. */ | 118 | /* Barrier before this op. */ |
113 | #define VIRTIO_BLK_T_BARRIER 0x80000000 | 119 | #define VIRTIO_BLK_T_BARRIER 0x80000000 |
120 | #endif /* !VIRTIO_BLK_NO_LEGACY */ | ||
114 | 121 | ||
115 | /* This is the first element of the read scatter-gather list. */ | 122 | /* This is the first element of the read scatter-gather list. */ |
116 | struct virtio_blk_outhdr { | 123 | struct virtio_blk_outhdr { |
@@ -122,12 +129,14 @@ struct virtio_blk_outhdr { | |||
122 | __virtio64 sector; | 129 | __virtio64 sector; |
123 | }; | 130 | }; |
124 | 131 | ||
132 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
125 | struct virtio_scsi_inhdr { | 133 | struct virtio_scsi_inhdr { |
126 | __virtio32 errors; | 134 | __virtio32 errors; |
127 | __virtio32 data_len; | 135 | __virtio32 data_len; |
128 | __virtio32 sense_len; | 136 | __virtio32 sense_len; |
129 | __virtio32 residual; | 137 | __virtio32 residual; |
130 | }; | 138 | }; |
139 | #endif /* !VIRTIO_BLK_NO_LEGACY */ | ||
131 | 140 | ||
132 | /* And this is the final byte of the write scatter-gather list. */ | 141 | /* And this is the final byte of the write scatter-gather list. */ |
133 | #define VIRTIO_BLK_S_OK 0 | 142 | #define VIRTIO_BLK_S_OK 0 |