aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2009-05-18 08:41:30 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-05-18 08:41:30 -0400
commit1cde26f928863d90e9e7c1217880c8450464d305 (patch)
treee0f6e5157cccc8ab8b87b1192a1da6ddc6113e82 /include
parent6c3b46f74587d46e71b8c2b78fdca626a3aca280 (diff)
virtio_blk: SG_IO passthru support
Add support for SG_IO passthru to virtio_blk. We add the scsi command block after the normal outhdr, and the scsi inhdr with full status information aswell as the sense buffer before the regular inhdr. [hch: forward ported, added the VIRTIO_BLK_F_SCSI flags, some comments and tested the whole beast] [axboe: updated to use ->resid and not dual-path the byte count] Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (+ checkpatch.pl tweak) Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/virtio_blk.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index 94c56d29869d..4dbcbc1c3481 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -15,6 +15,7 @@
15#define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ 15#define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */
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 19
19struct virtio_blk_config 20struct virtio_blk_config
20{ 21{
@@ -55,6 +56,13 @@ struct virtio_blk_outhdr
55 __u64 sector; 56 __u64 sector;
56}; 57};
57 58
59struct virtio_scsi_inhdr {
60 __u32 errors;
61 __u32 data_len;
62 __u32 sense_len;
63 __u32 residual;
64};
65
58/* And this is the final byte of the write scatter-gather list. */ 66/* And this is the final byte of the write scatter-gather list. */
59#define VIRTIO_BLK_S_OK 0 67#define VIRTIO_BLK_S_OK 0
60#define VIRTIO_BLK_S_IOERR 1 68#define VIRTIO_BLK_S_IOERR 1