diff options
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_mbox.c')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_mbox.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index 145fde302d7d..d3fac99db786 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -1574,10 +1574,8 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) } if (scp->cmnd[1] & MEGA_SCSI_INQ_EVPD) { - 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; + scsi_build_sense(scp, 0, ILLEGAL_REQUEST, + MEGA_INVALID_FIELD_IN_CDB, 0); return NULL; } @@ -2301,8 +2299,7 @@ megaraid_mbox_dpc(unsigned long devp) memcpy(scp->sense_buffer, pthru->reqsensearea, 14); - scp->result = DRIVER_SENSE << 24 | - DID_OK << 16 | CHECK_CONDITION << 1; + scp->result = SAM_STAT_CHECK_CONDITION; } else { if (mbox->cmd == MBOXCMD_EXTPTHRU) { @@ -2310,14 +2307,10 @@ megaraid_mbox_dpc(unsigned long devp) memcpy(scp->sense_buffer, epthru->reqsensearea, 14); - scp->result = DRIVER_SENSE << 24 | - DID_OK << 16 | - CHECK_CONDITION << 1; - } else { - scp->sense_buffer[0] = 0x70; - scp->sense_buffer[2] = ABORTED_COMMAND; - scp->result = CHECK_CONDITION << 1; - } + scp->result = SAM_STAT_CHECK_CONDITION; + } else + scsi_build_sense(scp, 0, + ABORTED_COMMAND, 0, 0); } break; @@ -2334,7 +2327,7 @@ megaraid_mbox_dpc(unsigned long devp) */ if (scp->cmnd[0] == TEST_UNIT_READY) { scp->result = DID_ERROR << 16 | - RESERVATION_CONFLICT << 1; + SAM_STAT_RESERVATION_CONFLICT; } else /* @@ -2345,7 +2338,7 @@ megaraid_mbox_dpc(unsigned long devp) scp->cmnd[0] == RELEASE)) { scp->result = DID_ERROR << 16 | - RESERVATION_CONFLICT << 1; + SAM_STAT_RESERVATION_CONFLICT; } else { scp->result = DID_BAD_TARGET << 16 | status; @@ -3240,8 +3233,6 @@ megaraid_mbox_fire_sync_cmd(adapter_t *adapter) int i; uint32_t dword; - mbox = (mbox_t *)raw_mbox; - memset((caddr_t)raw_mbox, 0, sizeof(mbox_t)); raw_mbox[0] = 0xFF; |