aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/virtio_blk.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/virtio_blk.h')
-rw-r--r--include/linux/virtio_blk.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index d4695a3356d..c1aef85243b 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -1,5 +1,7 @@
1#ifndef _LINUX_VIRTIO_BLK_H 1#ifndef _LINUX_VIRTIO_BLK_H
2#define _LINUX_VIRTIO_BLK_H 2#define _LINUX_VIRTIO_BLK_H
3/* This header is BSD licensed so anyone can use the definitions to implement
4 * compatible drivers/servers. */
3#include <linux/virtio_config.h> 5#include <linux/virtio_config.h>
4 6
5/* The ID for virtio_block */ 7/* The ID for virtio_block */
@@ -10,21 +12,25 @@
10#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ 12#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */
11#define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ 13#define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */
12#define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ 14#define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */
15#define VIRTIO_BLK_F_RO 5 /* Disk is read-only */
16#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/
13 17
14struct virtio_blk_config 18struct virtio_blk_config
15{ 19{
16 /* The capacity (in 512-byte sectors). */ 20 /* The capacity (in 512-byte sectors). */
17 __le64 capacity; 21 __u64 capacity;
18 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ 22 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
19 __le32 size_max; 23 __u32 size_max;
20 /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */ 24 /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
21 __le32 seg_max; 25 __u32 seg_max;
22 /* geometry the device (if VIRTIO_BLK_F_GEOMETRY) */ 26 /* geometry the device (if VIRTIO_BLK_F_GEOMETRY) */
23 struct virtio_blk_geometry { 27 struct virtio_blk_geometry {
24 __le16 cylinders; 28 __u16 cylinders;
25 __u8 heads; 29 __u8 heads;
26 __u8 sectors; 30 __u8 sectors;
27 } geometry; 31 } geometry;
32 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
33 __u32 blk_size;
28} __attribute__((packed)); 34} __attribute__((packed));
29 35
30/* These two define direction. */ 36/* These two define direction. */