summaryrefslogtreecommitdiff
path: root/include/scsi/scsi_proto.h
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2021-05-23 19:54:56 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2021-06-02 23:09:39 -0400
commit149d0e489e807f1e6dc265f975a793cea11ecbea (patch)
treea0e16e90e239694ff6a13f0551dd55a07be67985 /include/scsi/scsi_proto.h
parentd377f415dddc18b33c88dcd41cfe4fe6d9db82fb (diff)
downloadlinux-next-149d0e489e807f1e6dc265f975a793cea11ecbea.tar.gz
linux-next-149d0e489e807f1e6dc265f975a793cea11ecbea.zip
scsi: core: Introduce enums for the SAM and host status codes
Make it possible for the compiler to verify whether SAM and host status codes are used correctly. [mkp: resolve conflicts with Hannes' SCSI result series] Link: https://lore.kernel.org/r/20210524025457.11299-3-bvanassche@acm.org Cc: Hannes Reinecke <hare@suse.com> Reviewed-by: John Garry <john.garry@huawei.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/scsi/scsi_proto.h')
-rw-r--r--include/scsi/scsi_proto.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h
index cb218a576bcf..f017843a8124 100644
--- a/include/scsi/scsi_proto.h
+++ b/include/scsi/scsi_proto.h
@@ -190,17 +190,19 @@ struct scsi_varlen_cdb_hdr {
* SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
* T10/1561-D Revision 4 Draft dated 7th November 2002.
*/
-#define SAM_STAT_GOOD 0x00
-#define SAM_STAT_CHECK_CONDITION 0x02
-#define SAM_STAT_CONDITION_MET 0x04
-#define SAM_STAT_BUSY 0x08
-#define SAM_STAT_INTERMEDIATE 0x10
-#define SAM_STAT_INTERMEDIATE_CONDITION_MET 0x14
-#define SAM_STAT_RESERVATION_CONFLICT 0x18
-#define SAM_STAT_COMMAND_TERMINATED 0x22 /* obsolete in SAM-3 */
-#define SAM_STAT_TASK_SET_FULL 0x28
-#define SAM_STAT_ACA_ACTIVE 0x30
-#define SAM_STAT_TASK_ABORTED 0x40
+enum sam_status {
+ SAM_STAT_GOOD = 0x00,
+ SAM_STAT_CHECK_CONDITION = 0x02,
+ SAM_STAT_CONDITION_MET = 0x04,
+ SAM_STAT_BUSY = 0x08,
+ SAM_STAT_INTERMEDIATE = 0x10,
+ SAM_STAT_INTERMEDIATE_CONDITION_MET = 0x14,
+ SAM_STAT_RESERVATION_CONFLICT = 0x18,
+ SAM_STAT_COMMAND_TERMINATED = 0x22, /* obsolete in SAM-3 */
+ SAM_STAT_TASK_SET_FULL = 0x28,
+ SAM_STAT_ACA_ACTIVE = 0x30,
+ SAM_STAT_TASK_ABORTED = 0x40,
+};
#define STATUS_MASK 0xfe
/*