Skip to content

Commit

Permalink
[SCSI] Correctly set the scsi host/msg/status bytes
Browse files Browse the repository at this point in the history
Resubmitting as my previous post had format issues and did not go llinux-scsi.
This patch changes the function to set_msg_byte, set_host_byte and
set_driver_byte to correctly set the corresponding bytes appropriately.

It will reset the original setting and correctly set it to the new value.  The
previous OR operation does not always set it back to new value. Look at patch
2/2 for an example.

Signed-off-by: Babu Moger <babu.moger@netapp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Moger, Babu authored and James Bottomley committed Feb 19, 2012
1 parent 98788a1 commit 3384db9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/scsi/scsi_cmnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,17 @@ static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd)

static inline void set_msg_byte(struct scsi_cmnd *cmd, char status)
{
cmd->result |= status << 8;
cmd->result = (cmd->result & 0xffff00ff) | (status << 8);
}

static inline void set_host_byte(struct scsi_cmnd *cmd, char status)
{
cmd->result |= status << 16;
cmd->result = (cmd->result & 0xff00ffff) | (status << 16);
}

static inline void set_driver_byte(struct scsi_cmnd *cmd, char status)
{
cmd->result |= status << 24;
cmd->result = (cmd->result & 0x00ffffff) | (status << 24);
}

#endif /* _SCSI_SCSI_CMND_H */

0 comments on commit 3384db9

Please sign in to comment.