diff options
Diffstat (limited to 'include/linux/virtio_blk.h')
-rw-r--r-- | include/linux/virtio_blk.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h index bca0b10d7947..5f79a5f9de79 100644 --- a/include/linux/virtio_blk.h +++ b/include/linux/virtio_blk.h | |||
@@ -9,15 +9,23 @@ | |||
9 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ | 9 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ |
10 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ | 10 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ |
11 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ | 11 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ |
12 | #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ | ||
13 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ | ||
12 | 14 | ||
13 | struct virtio_blk_config | 15 | struct virtio_blk_config |
14 | { | 16 | { |
15 | /* The capacity (in 512-byte sectors). */ | 17 | /* The capacity (in 512-byte sectors). */ |
16 | __le64 capacity; | 18 | __u64 capacity; |
17 | /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ | 19 | /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ |
18 | __le32 size_max; | 20 | __u32 size_max; |
19 | /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */ | 21 | /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */ |
20 | __le32 seg_max; | 22 | __u32 seg_max; |
23 | /* geometry the device (if VIRTIO_BLK_F_GEOMETRY) */ | ||
24 | struct virtio_blk_geometry { | ||
25 | __u16 cylinders; | ||
26 | __u8 heads; | ||
27 | __u8 sectors; | ||
28 | } geometry; | ||
21 | } __attribute__((packed)); | 29 | } __attribute__((packed)); |
22 | 30 | ||
23 | /* These two define direction. */ | 31 | /* These two define direction. */ |
@@ -41,13 +49,8 @@ struct virtio_blk_outhdr | |||
41 | __u64 sector; | 49 | __u64 sector; |
42 | }; | 50 | }; |
43 | 51 | ||
52 | /* And this is the final byte of the write scatter-gather list. */ | ||
44 | #define VIRTIO_BLK_S_OK 0 | 53 | #define VIRTIO_BLK_S_OK 0 |
45 | #define VIRTIO_BLK_S_IOERR 1 | 54 | #define VIRTIO_BLK_S_IOERR 1 |
46 | #define VIRTIO_BLK_S_UNSUPP 2 | 55 | #define VIRTIO_BLK_S_UNSUPP 2 |
47 | |||
48 | /* This is the first element of the write scatter-gather list */ | ||
49 | struct virtio_blk_inhdr | ||
50 | { | ||
51 | unsigned char status; | ||
52 | }; | ||
53 | #endif /* _LINUX_VIRTIO_BLK_H */ | 56 | #endif /* _LINUX_VIRTIO_BLK_H */ |