summaryrefslogtreecommitdiff
path: root/include/scsi
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-04-27 10:30:46 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2021-05-31 23:59:18 -0400
commit3d45cefc8edd7f560e6c97a8d9928ad571f76dec (patch)
tree0692fdf11728f56b0f61af245f7f32240028c905 /include/scsi
parent502071489548b984957cc84d41da9aca59d92ea7 (diff)
scsi: core: Drop obsolete Linux-specific SCSI status codes
Originally the SCSI subsystem has been using 'special' SCSI status codes, which were the SAM-specified ones but shifted by 1. As most drivers have now been modified to use the SAM-specified ones, having two nearly identical sets of definitions only causes confusion. The Linux-specifed SCSI status codes have been marked obsolete for several years so drop them and use the SAM-specified status codes throughout. Link: https://lore.kernel.org/r/20210427083046.31620-41-hare@suse.de Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/scsi.h1
-rw-r--r--include/scsi/scsi_proto.h22
-rw-r--r--include/scsi/sg.h20
3 files changed, 21 insertions, 22 deletions
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index f4fb7e7728b4..358f969f368f 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -184,7 +184,6 @@ enum scsi_disposition {
* msg_byte (unused)
* host_byte = set by low-level driver to indicate status.
*/
-#define status_byte(result) (((result) >> 1) & 0x7f)
#define host_byte(result) (((result) >> 16) & 0xff)
#define sense_class(sense) (((sense) >> 4) & 0x7)
diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h
index 5c106c4f249e..cb218a576bcf 100644
--- a/include/scsi/scsi_proto.h
+++ b/include/scsi/scsi_proto.h
@@ -202,27 +202,7 @@ struct scsi_varlen_cdb_hdr {
#define SAM_STAT_ACA_ACTIVE 0x30
#define SAM_STAT_TASK_ABORTED 0x40
-/*
- * Status codes. These are deprecated as they are shifted 1 bit right
- * from those found in the SCSI standards. This causes confusion for
- * applications that are ported to several OSes. Prefer SAM Status codes
- * above.
- */
-
-#define GOOD 0x00
-#define CHECK_CONDITION 0x01
-#define CONDITION_GOOD 0x02
-#define BUSY 0x04
-#define INTERMEDIATE_GOOD 0x08
-#define INTERMEDIATE_C_GOOD 0x0a
-#define RESERVATION_CONFLICT 0x0c
-#define COMMAND_TERMINATED 0x11
-#define QUEUE_FULL 0x14
-#define ACA_ACTIVE 0x18
-#define TASK_ABORTED 0x20
-
-#define STATUS_MASK 0xfe
-
+#define STATUS_MASK 0xfe
/*
* SENSE KEYS
*/
diff --git a/include/scsi/sg.h b/include/scsi/sg.h
index e9dd5477ca7a..843cefb8efce 100644
--- a/include/scsi/sg.h
+++ b/include/scsi/sg.h
@@ -145,6 +145,26 @@ struct compat_sg_io_hdr {
/* Obsolete driver_byte() declaration */
#define driver_byte(result) (((result) >> 24) & 0xff)
+/*
+ * Original linux SCSI Status codes. They are shifted 1 bit right
+ * from those found in the SCSI standards.
+ */
+
+#define GOOD 0x00
+#define CHECK_CONDITION 0x01
+#define CONDITION_GOOD 0x02
+#define BUSY 0x04
+#define INTERMEDIATE_GOOD 0x08
+#define INTERMEDIATE_C_GOOD 0x0a
+#define RESERVATION_CONFLICT 0x0c
+#define COMMAND_TERMINATED 0x11
+#define QUEUE_FULL 0x14
+#define ACA_ACTIVE 0x18
+#define TASK_ABORTED 0x20
+
+/* Obsolete status_byte() declaration */
+#define status_byte(result) (((result) >> 1) & 0x7f)
+
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 */
int channel;