summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi/scsi_all.h
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-05-08 07:00:45 +0000
committermav <mav@FreeBSD.org>2014-05-08 07:00:45 +0000
commit2d5dc4736b59caac5805f2d92e46374abedecf49 (patch)
treec75899a669ba98fd8ca7a2f96c817567197fb91c /sys/cam/scsi/scsi_all.h
parent246a5ae3a0e73281e07ad2f26b1e62374f1bccf3 (diff)
downloadFreeBSD-src-2d5dc4736b59caac5805f2d92e46374abedecf49.zip
FreeBSD-src-2d5dc4736b59caac5805f2d92e46374abedecf49.tar.gz
MFC r264274, r264279, r264283, r264296, r264297:
Add support for SCSI UNMAP commands to CTL. This patch adds support for three new SCSI commands: UNMAP, WRITE SAME(10) and WRITE SAME(16). WRITE SAME commands support both normal write mode and UNMAP flag. To properly report UNMAP capabilities this patch also adds support for reporting two new VPD pages: Block limits and Logical Block Provisioning. UNMAP support can be enabled per-LUN by adding "-o unmap=on" to `ctladm create` command line or "option unmap on" to lun sections of /etc/ctl.conf. At this moment UNMAP supported for ramdisks and device-backed block LUNs. It was tested to work great with ZFS ZVOLs. For file-backed LUNs UNMAP support is unfortunately missing due to absence of respective VFS KPI. Sponsored by: iXsystems, Inc
Diffstat (limited to 'sys/cam/scsi/scsi_all.h')
-rw-r--r--sys/cam/scsi/scsi_all.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h
index 83b7041..0fa121f 100644
--- a/sys/cam/scsi/scsi_all.h
+++ b/sys/cam/scsi/scsi_all.h
@@ -854,6 +854,20 @@ struct scsi_unmap
uint8_t control;
};
+struct scsi_unmap_header
+{
+ uint8_t length[2];
+ uint8_t desc_length[2];
+ uint8_t reserved[4];
+};
+
+struct scsi_unmap_desc
+{
+ uint8_t lba[8];
+ uint8_t length[4];
+ uint8_t reserved[4];
+};
+
struct scsi_write_verify_10
{
uint8_t opcode;
OpenPOWER on IntegriCloud