aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx/ql4_mbx.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-02-29 19:25:20 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 13:15:43 -0400
commitce5450392fa3ab54f0a84aa3b7589f8d6f2a58af (patch)
tree17b051094ab95842b41d9ef3bdb5b2a1ef20370a /drivers/scsi/qla4xxx/ql4_mbx.c
parent30bd7df8ced23eefec87a5cda96dc99b002ed9da (diff)
[SCSI] qla4xxx: Add target reset functionality
This patch adds target reset functionalty. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Acked-by: David Somayajulu <david.somayajulu@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_mbx.c')
-rw-r--r--drivers/scsi/qla4xxx/ql4_mbx.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 35cd73c72a68..c577d79bd7e8 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -713,6 +713,45 @@ int qla4xxx_reset_lun(struct scsi_qla_host * ha, struct ddb_entry * ddb_entry,
713 return status; 713 return status;
714} 714}
715 715
716/**
717 * qla4xxx_reset_target - issues target Reset
718 * @ha: Pointer to host adapter structure.
719 * @db_entry: Pointer to device database entry
720 * @un_entry: Pointer to lun entry structure
721 *
722 * This routine performs a TARGET RESET on the specified target.
723 * The caller must ensure that the ddb_entry pointers
724 * are valid before calling this routine.
725 **/
726int qla4xxx_reset_target(struct scsi_qla_host *ha,
727 struct ddb_entry *ddb_entry)
728{
729 uint32_t mbox_cmd[MBOX_REG_COUNT];
730 uint32_t mbox_sts[MBOX_REG_COUNT];
731 int status = QLA_SUCCESS;
732
733 DEBUG2(printk("scsi%ld:%d: target reset issued\n", ha->host_no,
734 ddb_entry->os_target_id));
735
736 /*
737 * Send target reset command to ISP, so that the ISP will return all
738 * outstanding requests with RESET status
739 */
740 memset(&mbox_cmd, 0, sizeof(mbox_cmd));
741 memset(&mbox_sts, 0, sizeof(mbox_sts));
742
743 mbox_cmd[0] = MBOX_CMD_TARGET_WARM_RESET;
744 mbox_cmd[1] = ddb_entry->fw_ddb_index;
745 mbox_cmd[5] = 0x01; /* Immediate Command Enable */
746
747 qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0],
748 &mbox_sts[0]);
749 if (mbox_sts[0] != MBOX_STS_COMMAND_COMPLETE &&
750 mbox_sts[0] != MBOX_STS_COMMAND_ERROR)
751 status = QLA_ERROR;
752
753 return status;
754}
716 755
717int qla4xxx_get_flash(struct scsi_qla_host * ha, dma_addr_t dma_addr, 756int qla4xxx_get_flash(struct scsi_qla_host * ha, dma_addr_t dma_addr,
718 uint32_t offset, uint32_t len) 757 uint32_t offset, uint32_t len)