summaryrefslogtreecommitdiff
path: root/include/linux/virtio_scsi.h
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2014-03-17 01:51:35 +0400
committerNicholas Bellinger <nab@linux-iscsi.org>2014-06-02 23:41:33 +0400
commit1b49dcf3d7c765ad18ca7167a0e441824eb1f7af (patch)
tree5bb2c91afddab39abe6a29e507acde2f6b67ee18 /include/linux/virtio_scsi.h
parent5f80ff8eccba50832dcc640ac89add4c7fced963 (diff)
downloadlinux-1b49dcf3d7c765ad18ca7167a0e441824eb1f7af.tar.xz
virtio-scsi.h: Add virtio_scsi_cmd_req_pi + VIRTIO_SCSI_F_T10_PI bits
This patch adds a virtio_scsi_cmd_req_pi header as recommened by Paolo that contains pi_bytesout + pi_bytesin elements used for signaling when protection information buffers (in bytes) are expected to preceed the data payload buffers. Also add new VIRTIO_SCSI_F_T10_PI feature bit to be used to signal host support. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.de> Cc: Sagi Grimberg <sagig@dev.mellanox.co.il> Cc: H. Peter Anvin <hpa@zytor.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/linux/virtio_scsi.h')
-rw-r--r--include/linux/virtio_scsi.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/virtio_scsi.h b/include/linux/virtio_scsi.h
index 4195b97a3def..de429d1f4357 100644
--- a/include/linux/virtio_scsi.h
+++ b/include/linux/virtio_scsi.h
@@ -35,11 +35,23 @@ struct virtio_scsi_cmd_req {
u8 lun[8]; /* Logical Unit Number */
u64 tag; /* Command identifier */
u8 task_attr; /* Task attribute */
- u8 prio;
+ u8 prio; /* SAM command priority field */
u8 crn;
u8 cdb[VIRTIO_SCSI_CDB_SIZE];
} __packed;
+/* SCSI command request, followed by protection information */
+struct virtio_scsi_cmd_req_pi {
+ u8 lun[8]; /* Logical Unit Number */
+ u64 tag; /* Command identifier */
+ u8 task_attr; /* Task attribute */
+ u8 prio; /* SAM command priority field */
+ u8 crn;
+ u32 pi_bytesout; /* DataOUT PI Number of bytes */
+ u32 pi_bytesin; /* DataIN PI Number of bytes */
+ u8 cdb[VIRTIO_SCSI_CDB_SIZE];
+} __packed;
+
/* Response, followed by sense data and data-in */
struct virtio_scsi_cmd_resp {
u32 sense_len; /* Sense data length */
@@ -97,6 +109,7 @@ struct virtio_scsi_config {
#define VIRTIO_SCSI_F_INOUT 0
#define VIRTIO_SCSI_F_HOTPLUG 1
#define VIRTIO_SCSI_F_CHANGE 2
+#define VIRTIO_SCSI_F_T10_PI 3
/* Response codes */
#define VIRTIO_SCSI_S_OK 0