aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/sg.h
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-04-27 10:30:15 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2021-05-31 22:48:21 -0400
commit464a00c9e0ad45e3f42ff6ea705491a356df818e (patch)
tree2e5cbde03f97f84da0913242a8a3baf4f4c1fa46 /include/scsi/sg.h
parentscsi: core: Introduce scsi_status_is_check_condition() (diff)
downloadlinux-dev-464a00c9e0ad45e3f42ff6ea705491a356df818e.tar.xz
linux-dev-464a00c9e0ad45e3f42ff6ea705491a356df818e.zip
scsi: core: Kill DRIVER_SENSE
Replace the check for DRIVER_SENSE with a check for scsi_status_is_check_condition(). Audit all callsites to ensure the SAM status is set correctly. For backwards compability move the DRIVER_SENSE definition to sg.h, and update sg, bsg, and scsi_ioctl to set the DRIVER_SENSE driver_status whenever SAM_STAT_CHECK_CONDITION is present. [mkp: fix zeroday srp warning] Link: https://lore.kernel.org/r/20210427083046.31620-10-hare@suse.de Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> fix
Diffstat (limited to 'include/scsi/sg.h')
-rw-r--r--include/scsi/sg.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/scsi/sg.h b/include/scsi/sg.h
index e1a42c2409cc..d5c17775c3b4 100644
--- a/include/scsi/sg.h
+++ b/include/scsi/sg.h
@@ -131,6 +131,17 @@ struct compat_sg_io_hdr {
#define SG_INFO_DIRECT_IO 0x2 /* direct IO requested and performed */
#define SG_INFO_MIXED_IO 0x4 /* part direct, part indirect IO */
+/*
+ * Obsolete DRIVER_SENSE driver byte
+ *
+ * Originally the SCSI midlayer would set the DRIVER_SENSE driver byte when
+ * a sense code was generated and a sense buffer was allocated.
+ * However, as nowadays every scsi command has a sense code allocated this
+ * distinction became moot as one could check the sense buffer directly.
+ * Consequently this byte is not set anymore from the midlayer, but SG will
+ * keep setting this byte to be compatible with previous releases.
+ */
+#define DRIVER_SENSE 0x08
typedef struct sg_scsi_id { /* used by SG_GET_SCSI_ID ioctl() */
int host_no; /* as in "scsi<n>" where 'n' is one of 0, 1, 2 etc */