summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-04-27 10:30:22 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2021-05-31 22:48:22 -0400
commitf6b5a697064900c207876c12af55e176ec83f49e (patch)
treef320a7da059006ce8c907384f5f90133de7f1720 /include
parent7b25bdb1c828719a4732600faeaf0ba3f34816e6 (diff)
scsi: core: Add get_{status,host}_byte() accessor functions
Add accessor functions for the host and status byte. Link: https://lore.kernel.org/r/20210427083046.31620-17-hare@suse.de Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/scsi/scsi_cmnd.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index e7986b9babaf..760990116024 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -315,6 +315,11 @@ static inline void set_status_byte(struct scsi_cmnd *cmd, char status)
cmd->result = (cmd->result & 0xffffff00) | status;
}
+static inline u8 get_status_byte(struct scsi_cmnd *cmd)
+{
+ return cmd->result & 0xff;
+}
+
static inline void set_msg_byte(struct scsi_cmnd *cmd, char status)
{
cmd->result = (cmd->result & 0xffff00ff) | (status << 8);
@@ -325,6 +330,11 @@ static inline void set_host_byte(struct scsi_cmnd *cmd, char status)
cmd->result = (cmd->result & 0xff00ffff) | (status << 16);
}
+static inline u8 get_host_byte(struct scsi_cmnd *cmd)
+{
+ return (cmd->result >> 16) & 0xff;
+}
+
static inline unsigned scsi_transfer_length(struct scsi_cmnd *scmd)
{