@@ -1342,7 +1342,8 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
/* If error, command failed */
if (error == 1) {
/* Ask for a host reset */
- cmd->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
+ cmd->result =
+ (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
}
/* Report residual bytes for single sgl */
@@ -429,7 +429,8 @@ static int tw_decode_sense(TW_Device_Extension *tw_dev, int request_id, int fill
/* Additional sense code qualifier */
tw_dev->srb[request_id]->sense_buffer[13] = tw_sense_table[i][3];
- tw_dev->srb[request_id]->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
+ tw_dev->srb[request_id]->result =
+ (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
return TW_ISR_DONT_RESULT; /* Special case for isr to not over-write result */
}
}
@@ -2161,7 +2162,8 @@ static irqreturn_t tw_interrupt(int irq, void *dev_instance)
/* If error, command failed */
if (error == 1) {
/* Ask for a host reset */
- tw_dev->srb[request_id]->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
+ tw_dev->srb[request_id]->result =
+ (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
}
/* Now complete the io */
@@ -1337,7 +1337,7 @@ static void arcmsr_report_sense_info(struct CommandControlBlock *ccb)
struct scsi_cmnd *pcmd = ccb->pcmd;
struct SENSE_DATA *sensebuffer = (struct SENSE_DATA *)pcmd->sense_buffer;
- pcmd->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
+ pcmd->result = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
if (sensebuffer) {
int sense_data_length =
sizeof(struct SENSE_DATA) < SCSI_SENSE_BUFFERSIZE
@@ -1585,7 +1585,7 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status)
cmd->result = (DRIVER_SENSE << 24) |
(DID_OK << 16) |
- (CHECK_CONDITION << 1);
+ SAM_STAT_CHECK_CONDITION;
}
else {
if (mbox->m_out.cmd == MEGA_MBOXCMD_EXTPTHRU) {
@@ -1595,11 +1595,11 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status)
cmd->result = (DRIVER_SENSE << 24) |
(DID_OK << 16) |
- (CHECK_CONDITION << 1);
+ SAM_STAT_CHECK_CONDITION;
} else {
cmd->sense_buffer[0] = 0x70;
cmd->sense_buffer[2] = ABORTED_COMMAND;
- cmd->result |= (CHECK_CONDITION << 1);
+ cmd->result |= SAM_STAT_CHECK_CONDITION;
}
}
break;
@@ -1577,7 +1577,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy)
scp->sense_buffer[0] = 0x70;
scp->sense_buffer[2] = ILLEGAL_REQUEST;
scp->sense_buffer[12] = MEGA_INVALID_FIELD_IN_CDB;
- scp->result = CHECK_CONDITION << 1;
+ scp->result = SAM_STAT_CHECK_CONDITION;
return NULL;
}
@@ -2302,7 +2302,7 @@ megaraid_mbox_dpc(unsigned long devp)
14);
scp->result = DRIVER_SENSE << 24 |
- DID_OK << 16 | CHECK_CONDITION << 1;
+ DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
}
else {
if (mbox->cmd == MBOXCMD_EXTPTHRU) {
@@ -2312,11 +2312,11 @@ megaraid_mbox_dpc(unsigned long devp)
scp->result = DRIVER_SENSE << 24 |
DID_OK << 16 |
- CHECK_CONDITION << 1;
+ SAM_STAT_CHECK_CONDITION;
} else {
scp->sense_buffer[0] = 0x70;
scp->sense_buffer[2] = ABORTED_COMMAND;
- scp->result = CHECK_CONDITION << 1;
+ scp->result = SAM_STAT_CHECK_CONDITION;
}
}
break;
Use standard SAM status values intead of shifting the linux ones. Signed-off-by: Hannes Reinecke <hare@suse.de> --- drivers/scsi/3w-9xxx.c | 3 ++- drivers/scsi/3w-xxxx.c | 6 ++++-- drivers/scsi/arcmsr/arcmsr_hba.c | 2 +- drivers/scsi/megaraid.c | 6 +++--- drivers/scsi/megaraid/megaraid_mbox.c | 8 ++++---- 5 files changed, 14 insertions(+), 11 deletions(-)