Commit f6b5a697 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

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.deReviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 7b25bdb1
......@@ -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)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment