diff options
author | Vikas Chaudhary <vikas.chaudhary@qlogic.com> | 2010-04-28 02:12:24 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-05-02 15:40:12 -0400 |
commit | 09a0f719896659a6c32df11426e55795012c06ff (patch) | |
tree | d80dce19cc98f247970c98a0b003fa1f97f98764 /drivers/scsi/qla4xxx/ql4_mbx.c | |
parent | 5369887a95da9509163931b21f61a94da09dac15 (diff) |
[SCSI] qla4xxx: added support for abort task management command
* Handles SCSI command aborts.
* Serialization srb between error handler and command
completion path.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_mbx.c')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_mbx.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index 43581ce3a1b6..e1315cd8c261 100644 --- a/drivers/scsi/qla4xxx/ql4_mbx.c +++ b/drivers/scsi/qla4xxx/ql4_mbx.c | |||
@@ -762,6 +762,59 @@ exit_get_event_log: | |||
762 | } | 762 | } |
763 | 763 | ||
764 | /** | 764 | /** |
765 | * qla4xxx_abort_task - issues Abort Task | ||
766 | * @ha: Pointer to host adapter structure. | ||
767 | * @srb: Pointer to srb entry | ||
768 | * | ||
769 | * This routine performs a LUN RESET on the specified target/lun. | ||
770 | * The caller must ensure that the ddb_entry and lun_entry pointers | ||
771 | * are valid before calling this routine. | ||
772 | **/ | ||
773 | int qla4xxx_abort_task(struct scsi_qla_host *ha, struct srb *srb) | ||
774 | { | ||
775 | uint32_t mbox_cmd[MBOX_REG_COUNT]; | ||
776 | uint32_t mbox_sts[MBOX_REG_COUNT]; | ||
777 | struct scsi_cmnd *cmd = srb->cmd; | ||
778 | int status = QLA_SUCCESS; | ||
779 | unsigned long flags = 0; | ||
780 | uint32_t index; | ||
781 | |||
782 | /* | ||
783 | * Send abort task command to ISP, so that the ISP will return | ||
784 | * request with ABORT status | ||
785 | */ | ||
786 | memset(&mbox_cmd, 0, sizeof(mbox_cmd)); | ||
787 | memset(&mbox_sts, 0, sizeof(mbox_sts)); | ||
788 | |||
789 | spin_lock_irqsave(&ha->hardware_lock, flags); | ||
790 | index = (unsigned long)(unsigned char *)cmd->host_scribble; | ||
791 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | ||
792 | |||
793 | /* Firmware already posted completion on response queue */ | ||
794 | if (index == MAX_SRBS) | ||
795 | return status; | ||
796 | |||
797 | mbox_cmd[0] = MBOX_CMD_ABORT_TASK; | ||
798 | mbox_cmd[1] = srb->fw_ddb_index; | ||
799 | mbox_cmd[2] = index; | ||
800 | /* Immediate Command Enable */ | ||
801 | mbox_cmd[5] = 0x01; | ||
802 | |||
803 | qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], | ||
804 | &mbox_sts[0]); | ||
805 | if (mbox_sts[0] != MBOX_STS_COMMAND_COMPLETE) { | ||
806 | status = QLA_ERROR; | ||
807 | |||
808 | DEBUG2(printk(KERN_WARNING "scsi%ld:%d:%d: abort task FAILED: " | ||
809 | "mbx0=%04X, mb1=%04X, mb2=%04X, mb3=%04X, mb4=%04X\n", | ||
810 | ha->host_no, cmd->device->id, cmd->device->lun, mbox_sts[0], | ||
811 | mbox_sts[1], mbox_sts[2], mbox_sts[3], mbox_sts[4])); | ||
812 | } | ||
813 | |||
814 | return status; | ||
815 | } | ||
816 | |||
817 | /** | ||
765 | * qla4xxx_reset_lun - issues LUN Reset | 818 | * qla4xxx_reset_lun - issues LUN Reset |
766 | * @ha: Pointer to host adapter structure. | 819 | * @ha: Pointer to host adapter structure. |
767 | * @db_entry: Pointer to device database entry | 820 | * @db_entry: Pointer to device database entry |