aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorjohn cooper <john.cooper@redhat.com>2009-06-09 08:41:40 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-06-09 08:41:40 -0400
commit1d589bb16b825b3a7b4edd34d997f1f1f953033d (patch)
tree2abc78cb296b6f341c3b08b3f261392e77d6668c /include
parent77634f33d4078542cf1087995cced0ffdae25aa2 (diff)
Add serial number support for virtio_blk, V4a
This patch extracts the opaque data from pci i/o region 0 via the added VIRTIO_BLK_F_IDENTIFY field. By convention this data takes the form of that returned by an ATA IDENTIFY DEVICE command, however the driver (except for structure size) makes no interpretation of the data. The structure data is copied wholesale to userspace via a HDIO_GET_IDENTITY ioctl command (eg: hdparm -i <dev>). Signed-off-by: john cooper <john.cooper@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/virtio_blk.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index 4dbcbc1c3481..be7d255fc7cf 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -16,6 +16,9 @@
16#define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ 16#define VIRTIO_BLK_F_RO 5 /* Disk is read-only */
17#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ 17#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/
18#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ 18#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */
19#define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */
20
21#define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */
19 22
20struct virtio_blk_config 23struct virtio_blk_config
21{ 24{
@@ -33,6 +36,7 @@ struct virtio_blk_config
33 } geometry; 36 } geometry;
34 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ 37 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
35 __u32 blk_size; 38 __u32 blk_size;
39 __u8 identify[VIRTIO_BLK_ID_BYTES];
36} __attribute__((packed)); 40} __attribute__((packed));
37 41
38/* These two define direction. */ 42/* These two define direction. */