aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx
diff options
context:
space:
mode:
authorNilesh Javali <nilesh.javali@qlogic.com>2012-09-20 07:35:10 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-09-24 04:41:53 -0400
commit320a61de9dc9ca1ed2b69c9a95968e0207c348df (patch)
tree3d6af8e69bda7cafeefda42166ec116b357d0a23 /drivers/scsi/qla4xxx
parenta9b0347f4dbbe670199f41f7825046333b4044d6 (diff)
[SCSI] qla4xxx: IDC implementation for Loopback
Handle IDC Request Notify AEN and post IDC Acknowledgement while participating in Loopback IDC. Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r--drivers/scsi/qla4xxx/ql4_83xx.h8
-rw-r--r--drivers/scsi/qla4xxx/ql4_def.h3
-rw-r--r--drivers/scsi/qla4xxx/ql4_fw.h6
-rw-r--r--drivers/scsi/qla4xxx/ql4_glbl.h1
-rw-r--r--drivers/scsi/qla4xxx/ql4_isr.c37
-rw-r--r--drivers/scsi/qla4xxx/ql4_mbx.c33
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c4
7 files changed, 91 insertions, 1 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_83xx.h b/drivers/scsi/qla4xxx/ql4_83xx.h
index a67926383940..18d86abbf276 100644
--- a/drivers/scsi/qla4xxx/ql4_83xx.h
+++ b/drivers/scsi/qla4xxx/ql4_83xx.h
@@ -259,4 +259,12 @@ struct qla83xx_minidump_entry_pollrdmwr {
259 uint32_t data_size; 259 uint32_t data_size;
260}; 260};
261 261
262/* IDC additional information */
263struct qla4_83xx_idc_information {
264 uint32_t request_desc; /* IDC request descriptor */
265 uint32_t info1; /* IDC additional info */
266 uint32_t info2; /* IDC additional info */
267 uint32_t info3; /* IDC additional info */
268};
269
262#endif 270#endif
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index 8e061eaa3167..329d553eae94 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -531,7 +531,7 @@ struct scsi_qla_host {
531#define DPC_RESET_ACTIVE 20 /* 0x00040000 */ 531#define DPC_RESET_ACTIVE 20 /* 0x00040000 */
532#define DPC_HA_UNRECOVERABLE 21 /* 0x00080000 ISP-82xx only*/ 532#define DPC_HA_UNRECOVERABLE 21 /* 0x00080000 ISP-82xx only*/
533#define DPC_HA_NEED_QUIESCENT 22 /* 0x00100000 ISP-82xx only*/ 533#define DPC_HA_NEED_QUIESCENT 22 /* 0x00100000 ISP-82xx only*/
534 534#define DPC_POST_IDC_ACK 23 /* 0x00200000 */
535 535
536 struct Scsi_Host *host; /* pointer to host data */ 536 struct Scsi_Host *host; /* pointer to host data */
537 uint32_t tot_ddbs; 537 uint32_t tot_ddbs;
@@ -756,6 +756,7 @@ struct scsi_qla_host {
756 struct device_reg_83xx __iomem *qla4_83xx_reg; /* Base I/O address 756 struct device_reg_83xx __iomem *qla4_83xx_reg; /* Base I/O address
757 for ISP8324 */ 757 for ISP8324 */
758 uint32_t pf_bit; 758 uint32_t pf_bit;
759 struct qla4_83xx_idc_information idc_info;
759}; 760};
760 761
761struct ql4_task_data { 762struct ql4_task_data {
diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index 69a21718f4d0..1c4795020357 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -454,6 +454,10 @@ struct qla_flt_region {
454#define MBOX_CMD_GET_CRASH_RECORD 0x0076 /* 4010 only */ 454#define MBOX_CMD_GET_CRASH_RECORD 0x0076 /* 4010 only */
455#define MBOX_CMD_GET_CONN_EVENT_LOG 0x0077 455#define MBOX_CMD_GET_CONN_EVENT_LOG 0x0077
456 456
457#define MBOX_CMD_IDC_ACK 0x0101
458#define MBOX_CMD_PORT_RESET 0x0120
459#define MBOX_CMD_SET_PORT_CONFIG 0x0122
460
457/* Mailbox status definitions */ 461/* Mailbox status definitions */
458#define MBOX_COMPLETION_STATUS 4 462#define MBOX_COMPLETION_STATUS 4
459#define MBOX_STS_BUSY 0x0007 463#define MBOX_STS_BUSY 0x0007
@@ -490,6 +494,8 @@ struct qla_flt_region {
490#define MBOX_ASTS_IPV6_ND_PREFIX_IGNORED 0x802C 494#define MBOX_ASTS_IPV6_ND_PREFIX_IGNORED 0x802C
491#define MBOX_ASTS_IPV6_LCL_PREFIX_IGNORED 0x802D 495#define MBOX_ASTS_IPV6_LCL_PREFIX_IGNORED 0x802D
492#define MBOX_ASTS_ICMPV6_ERROR_MSG_RCVD 0x802E 496#define MBOX_ASTS_ICMPV6_ERROR_MSG_RCVD 0x802E
497#define MBOX_ASTS_IDC_COMPLETE 0x8100
498#define MBOX_ASTS_IDC_NOTIFY 0x8101
493#define MBOX_ASTS_TXSCVR_INSERTED 0x8130 499#define MBOX_ASTS_TXSCVR_INSERTED 0x8130
494#define MBOX_ASTS_TXSCVR_REMOVED 0x8131 500#define MBOX_ASTS_TXSCVR_REMOVED 0x8131
495 501
diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h
index 0580f8048f63..3eb5fd957c4a 100644
--- a/drivers/scsi/qla4xxx/ql4_glbl.h
+++ b/drivers/scsi/qla4xxx/ql4_glbl.h
@@ -257,6 +257,7 @@ int qla4_8xxx_mbx_intr_disable(struct scsi_qla_host *ha);
257int qla4_8xxx_mbx_intr_enable(struct scsi_qla_host *ha); 257int qla4_8xxx_mbx_intr_enable(struct scsi_qla_host *ha);
258int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param); 258int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param);
259int qla4_8xxx_update_idc_reg(struct scsi_qla_host *ha); 259int qla4_8xxx_update_idc_reg(struct scsi_qla_host *ha);
260int qla4_83xx_post_idc_ack(struct scsi_qla_host *ha);
260 261
261extern int ql4xextended_error_logging; 262extern int ql4xextended_error_logging;
262extern int ql4xdontresethba; 263extern int ql4xdontresethba;
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index 50503217b069..15ea81465ce4 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -806,6 +806,43 @@ static void qla4xxx_isr_decode_mailbox(struct scsi_qla_host * ha,
806 " removed\n", ha->host_no, mbox_sts[0])); 806 " removed\n", ha->host_no, mbox_sts[0]));
807 break; 807 break;
808 808
809 case MBOX_ASTS_IDC_NOTIFY:
810 {
811 uint32_t opcode;
812 if (is_qla8032(ha)) {
813 DEBUG2(ql4_printk(KERN_INFO, ha,
814 "scsi%ld: AEN %04x, mbox_sts[1]=%08x, mbox_sts[2]=%08x, mbox_sts[3]=%08x, mbox_sts[4]=%08x\n",
815 ha->host_no, mbox_sts[0],
816 mbox_sts[1], mbox_sts[2],
817 mbox_sts[3], mbox_sts[4]));
818 opcode = mbox_sts[1] >> 16;
819 if ((opcode == MBOX_CMD_SET_PORT_CONFIG) ||
820 (opcode == MBOX_CMD_PORT_RESET)) {
821 set_bit(DPC_POST_IDC_ACK,
822 &ha->dpc_flags);
823 ha->idc_info.request_desc = mbox_sts[1];
824 ha->idc_info.info1 = mbox_sts[2];
825 ha->idc_info.info2 = mbox_sts[3];
826 ha->idc_info.info3 = mbox_sts[4];
827 qla4xxx_wake_dpc(ha);
828 }
829 }
830 break;
831 }
832
833 case MBOX_ASTS_IDC_COMPLETE:
834 if (is_qla8032(ha)) {
835 DEBUG2(ql4_printk(KERN_INFO, ha,
836 "scsi%ld: AEN %04x, mbox_sts[1]=%08x, mbox_sts[2]=%08x, mbox_sts[3]=%08x, mbox_sts[4]=%08x\n",
837 ha->host_no, mbox_sts[0],
838 mbox_sts[1], mbox_sts[2],
839 mbox_sts[3], mbox_sts[4]));
840 DEBUG2(ql4_printk(KERN_INFO, ha,
841 "scsi:%ld: AEN %04x IDC Complete notification\n",
842 ha->host_no, mbox_sts[0]));
843 }
844 break;
845
809 default: 846 default:
810 DEBUG2(printk(KERN_WARNING 847 DEBUG2(printk(KERN_WARNING
811 "scsi%ld: AEN %04x UNKNOWN\n", 848 "scsi%ld: AEN %04x UNKNOWN\n",
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index f31e79b6aa6d..0d3d641f891b 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -1968,3 +1968,36 @@ int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param)
1968exit_set_param: 1968exit_set_param:
1969 return status; 1969 return status;
1970} 1970}
1971
1972/**
1973 * qla4_83xx_post_idc_ack - post IDC ACK
1974 * @ha: Pointer to host adapter structure.
1975 *
1976 * Posts IDC ACK for IDC Request Notification AEN.
1977 **/
1978int qla4_83xx_post_idc_ack(struct scsi_qla_host *ha)
1979{
1980 uint32_t mbox_cmd[MBOX_REG_COUNT];
1981 uint32_t mbox_sts[MBOX_REG_COUNT];
1982 int status;
1983
1984 memset(&mbox_cmd, 0, sizeof(mbox_cmd));
1985 memset(&mbox_sts, 0, sizeof(mbox_sts));
1986
1987 mbox_cmd[0] = MBOX_CMD_IDC_ACK;
1988 mbox_cmd[1] = ha->idc_info.request_desc;
1989 mbox_cmd[2] = ha->idc_info.info1;
1990 mbox_cmd[3] = ha->idc_info.info2;
1991 mbox_cmd[4] = ha->idc_info.info3;
1992
1993 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, MBOX_REG_COUNT,
1994 mbox_cmd, mbox_sts);
1995 if (status == QLA_ERROR)
1996 ql4_printk(KERN_ERR, ha, "%s: failed status %04X\n", __func__,
1997 mbox_sts[0]);
1998 else
1999 DEBUG2(ql4_printk(KERN_INFO, ha, "%s: IDC ACK posted\n",
2000 __func__));
2001
2002 return status;
2003}
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 97ce44bb1ce9..35546807c9f7 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -3398,6 +3398,10 @@ static void qla4xxx_do_dpc(struct work_struct *work)
3398 ql4_printk(KERN_INFO, ha, "HW State: FAILED\n"); 3398 ql4_printk(KERN_INFO, ha, "HW State: FAILED\n");
3399 qla4_8xxx_device_state_handler(ha); 3399 qla4_8xxx_device_state_handler(ha);
3400 } 3400 }
3401
3402 if (test_and_clear_bit(DPC_POST_IDC_ACK, &ha->dpc_flags))
3403 qla4_83xx_post_idc_ack(ha);
3404
3401 if (test_and_clear_bit(DPC_HA_NEED_QUIESCENT, &ha->dpc_flags)) { 3405 if (test_and_clear_bit(DPC_HA_NEED_QUIESCENT, &ha->dpc_flags)) {
3402 qla4_8xxx_need_qsnt_handler(ha); 3406 qla4_8xxx_need_qsnt_handler(ha);
3403 } 3407 }