diff options
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 8 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_fw.h | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 6 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 16 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 159 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.h | 14 |
8 files changed, 187 insertions, 25 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index f7cdd259ef0b..e690d052246a 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -39,7 +39,7 @@ | |||
39 | * | MultiQ | 0xc00c | | | 39 | * | MultiQ | 0xc00c | | |
40 | * | Misc | 0xd010 | | | 40 | * | Misc | 0xd010 | | |
41 | * | Target Mode | 0xe06f | | | 41 | * | Target Mode | 0xe06f | | |
42 | * | Target Mode Management | 0xf071 | | | 42 | * | Target Mode Management | 0xf072 | | |
43 | * | Target Mode Task Management | 0x1000b | | | 43 | * | Target Mode Task Management | 0x1000b | | |
44 | * ---------------------------------------------------------------------- | 44 | * ---------------------------------------------------------------------- |
45 | */ | 45 | */ |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 06c6271d5911..b5fc478e90c1 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -537,6 +537,8 @@ struct device_reg_25xxmq { | |||
537 | uint32_t req_q_out; | 537 | uint32_t req_q_out; |
538 | uint32_t rsp_q_in; | 538 | uint32_t rsp_q_in; |
539 | uint32_t rsp_q_out; | 539 | uint32_t rsp_q_out; |
540 | uint32_t atio_q_in; | ||
541 | uint32_t atio_q_out; | ||
540 | }; | 542 | }; |
541 | 543 | ||
542 | typedef union { | 544 | typedef union { |
@@ -563,6 +565,9 @@ typedef union { | |||
563 | &(reg)->u.isp2100.mailbox5 : \ | 565 | &(reg)->u.isp2100.mailbox5 : \ |
564 | &(reg)->u.isp2300.rsp_q_out) | 566 | &(reg)->u.isp2300.rsp_q_out) |
565 | 567 | ||
568 | #define ISP_ATIO_Q_IN(vha) (vha->hw->tgt.atio_q_in) | ||
569 | #define ISP_ATIO_Q_OUT(vha) (vha->hw->tgt.atio_q_out) | ||
570 | |||
566 | #define MAILBOX_REG(ha, reg, num) \ | 571 | #define MAILBOX_REG(ha, reg, num) \ |
567 | (IS_QLA2100(ha) || IS_QLA2200(ha) ? \ | 572 | (IS_QLA2100(ha) || IS_QLA2200(ha) ? \ |
568 | (num < 8 ? \ | 573 | (num < 8 ? \ |
@@ -2559,6 +2564,8 @@ struct qlt_hw_data { | |||
2559 | struct atio *atio_ring_ptr; /* Current address. */ | 2564 | struct atio *atio_ring_ptr; /* Current address. */ |
2560 | uint16_t atio_ring_index; /* Current index. */ | 2565 | uint16_t atio_ring_index; /* Current index. */ |
2561 | uint16_t atio_q_length; | 2566 | uint16_t atio_q_length; |
2567 | uint32_t __iomem *atio_q_in; | ||
2568 | uint32_t __iomem *atio_q_out; | ||
2562 | 2569 | ||
2563 | void *target_lport_ptr; | 2570 | void *target_lport_ptr; |
2564 | struct qla_tgt_func_tmpl *tgt_ops; | 2571 | struct qla_tgt_func_tmpl *tgt_ops; |
@@ -2790,6 +2797,7 @@ struct qla_hw_data { | |||
2790 | #define IS_PI_SPLIT_DET_CAPABLE_HBA(ha) (IS_QLA83XX(ha)) | 2797 | #define IS_PI_SPLIT_DET_CAPABLE_HBA(ha) (IS_QLA83XX(ha)) |
2791 | #define IS_PI_SPLIT_DET_CAPABLE(ha) (IS_PI_SPLIT_DET_CAPABLE_HBA(ha) && \ | 2798 | #define IS_PI_SPLIT_DET_CAPABLE(ha) (IS_PI_SPLIT_DET_CAPABLE_HBA(ha) && \ |
2792 | (((ha)->fw_attributes_h << 16 | (ha)->fw_attributes) & BIT_22)) | 2799 | (((ha)->fw_attributes_h << 16 | (ha)->fw_attributes) & BIT_22)) |
2800 | #define IS_ATIO_MSIX_CAPABLE(ha) (IS_QLA83XX(ha)) | ||
2793 | 2801 | ||
2794 | /* HBA serial number */ | 2802 | /* HBA serial number */ |
2795 | uint8_t serial0; | 2803 | uint8_t serial0; |
diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index be6d61a89edc..7105d5e794e4 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h | |||
@@ -300,7 +300,8 @@ struct init_cb_24xx { | |||
300 | uint32_t prio_request_q_address[2]; | 300 | uint32_t prio_request_q_address[2]; |
301 | 301 | ||
302 | uint16_t msix; | 302 | uint16_t msix; |
303 | uint8_t reserved_2[6]; | 303 | uint16_t msix_atio; |
304 | uint8_t reserved_2[4]; | ||
304 | 305 | ||
305 | uint16_t atio_q_inpointer; | 306 | uint16_t atio_q_inpointer; |
306 | uint16_t atio_q_length; | 307 | uint16_t atio_q_length; |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 81e8ccacf55b..a581c850ad74 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -1964,7 +1964,7 @@ qla24xx_config_rings(struct scsi_qla_host *vha) | |||
1964 | WRT_REG_DWORD(®->isp24.rsp_q_in, 0); | 1964 | WRT_REG_DWORD(®->isp24.rsp_q_in, 0); |
1965 | WRT_REG_DWORD(®->isp24.rsp_q_out, 0); | 1965 | WRT_REG_DWORD(®->isp24.rsp_q_out, 0); |
1966 | } | 1966 | } |
1967 | qlt_24xx_config_rings(vha, reg); | 1967 | qlt_24xx_config_rings(vha); |
1968 | 1968 | ||
1969 | /* PCI posting */ | 1969 | /* PCI posting */ |
1970 | RD_REG_DWORD(&ioreg->hccr); | 1970 | RD_REG_DWORD(&ioreg->hccr); |
@@ -5579,6 +5579,8 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) | |||
5579 | if (IS_T10_PI_CAPABLE(ha)) | 5579 | if (IS_T10_PI_CAPABLE(ha)) |
5580 | nv->frame_payload_size &= ~7; | 5580 | nv->frame_payload_size &= ~7; |
5581 | 5581 | ||
5582 | qlt_81xx_config_nvram_stage1(vha, nv); | ||
5583 | |||
5582 | /* Reset Initialization control block */ | 5584 | /* Reset Initialization control block */ |
5583 | memset(icb, 0, ha->init_cb_size); | 5585 | memset(icb, 0, ha->init_cb_size); |
5584 | 5586 | ||
@@ -5619,6 +5621,8 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) | |||
5619 | qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name), | 5621 | qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name), |
5620 | "QLE8XXX"); | 5622 | "QLE8XXX"); |
5621 | 5623 | ||
5624 | qlt_81xx_config_nvram_stage2(vha, icb); | ||
5625 | |||
5622 | /* Use alternate WWN? */ | 5626 | /* Use alternate WWN? */ |
5623 | if (nv->host_p & __constant_cpu_to_le32(BIT_15)) { | 5627 | if (nv->host_p & __constant_cpu_to_le32(BIT_15)) { |
5624 | memcpy(icb->node_name, nv->alternate_node_name, WWN_SIZE); | 5628 | memcpy(icb->node_name, nv->alternate_node_name, WWN_SIZE); |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 1b192c8bb133..26a3086a7e3a 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -13,6 +13,8 @@ | |||
13 | #include <scsi/scsi_bsg_fc.h> | 13 | #include <scsi/scsi_bsg_fc.h> |
14 | #include <scsi/scsi_eh.h> | 14 | #include <scsi/scsi_eh.h> |
15 | 15 | ||
16 | #include "qla_target.h" | ||
17 | |||
16 | static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t); | 18 | static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t); |
17 | static void qla2x00_process_completed_request(struct scsi_qla_host *, | 19 | static void qla2x00_process_completed_request(struct scsi_qla_host *, |
18 | struct req_que *, uint32_t); | 20 | struct req_que *, uint32_t); |
@@ -2751,6 +2753,12 @@ static struct qla_init_msix_entry qla82xx_msix_entries[2] = { | |||
2751 | { "qla2xxx (rsp_q)", qla82xx_msix_rsp_q }, | 2753 | { "qla2xxx (rsp_q)", qla82xx_msix_rsp_q }, |
2752 | }; | 2754 | }; |
2753 | 2755 | ||
2756 | static struct qla_init_msix_entry qla83xx_msix_entries[3] = { | ||
2757 | { "qla2xxx (default)", qla24xx_msix_default }, | ||
2758 | { "qla2xxx (rsp_q)", qla24xx_msix_rsp_q }, | ||
2759 | { "qla2xxx (atio_q)", qla83xx_msix_atio_q }, | ||
2760 | }; | ||
2761 | |||
2754 | static void | 2762 | static void |
2755 | qla24xx_disable_msix(struct qla_hw_data *ha) | 2763 | qla24xx_disable_msix(struct qla_hw_data *ha) |
2756 | { | 2764 | { |
@@ -2831,9 +2839,13 @@ msix_failed: | |||
2831 | } | 2839 | } |
2832 | 2840 | ||
2833 | /* Enable MSI-X vectors for the base queue */ | 2841 | /* Enable MSI-X vectors for the base queue */ |
2834 | for (i = 0; i < 2; i++) { | 2842 | for (i = 0; i < ha->msix_count; i++) { |
2835 | qentry = &ha->msix_entries[i]; | 2843 | qentry = &ha->msix_entries[i]; |
2836 | if (IS_QLA82XX(ha)) { | 2844 | if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) { |
2845 | ret = request_irq(qentry->vector, | ||
2846 | qla83xx_msix_entries[i].handler, | ||
2847 | 0, qla83xx_msix_entries[i].name, rsp); | ||
2848 | } else if (IS_QLA82XX(ha)) { | ||
2837 | ret = request_irq(qentry->vector, | 2849 | ret = request_irq(qentry->vector, |
2838 | qla82xx_msix_entries[i].handler, | 2850 | qla82xx_msix_entries[i].handler, |
2839 | 0, qla82xx_msix_entries[i].name, rsp); | 2851 | 0, qla82xx_msix_entries[i].name, rsp); |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index da86d3828c1d..e93408f8e7e1 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1812,6 +1812,9 @@ qla83xx_iospace_config(struct qla_hw_data *ha) | |||
1812 | 1812 | ||
1813 | mqiobase_exit: | 1813 | mqiobase_exit: |
1814 | ha->msix_count = ha->max_rsp_queues + 1; | 1814 | ha->msix_count = ha->max_rsp_queues + 1; |
1815 | |||
1816 | qlt_83xx_iospace_config(ha); | ||
1817 | |||
1815 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x011f, | 1818 | ql_dbg_pci(ql_dbg_init, ha->pdev, 0x011f, |
1816 | "MSIX Count:%d.\n", ha->msix_count); | 1819 | "MSIX Count:%d.\n", ha->msix_count); |
1817 | return 0; | 1820 | return 0; |
@@ -2390,6 +2393,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2390 | ha->mbx_count = MAILBOX_REGISTER_COUNT; | 2393 | ha->mbx_count = MAILBOX_REGISTER_COUNT; |
2391 | req_length = REQUEST_ENTRY_CNT_24XX; | 2394 | req_length = REQUEST_ENTRY_CNT_24XX; |
2392 | rsp_length = RESPONSE_ENTRY_CNT_2300; | 2395 | rsp_length = RESPONSE_ENTRY_CNT_2300; |
2396 | ha->tgt.atio_q_length = ATIO_ENTRY_CNT_24XX; | ||
2393 | ha->max_loop_id = SNS_LAST_LOOP_ID_2300; | 2397 | ha->max_loop_id = SNS_LAST_LOOP_ID_2300; |
2394 | ha->init_cb_size = sizeof(struct mid_init_cb_81xx); | 2398 | ha->init_cb_size = sizeof(struct mid_init_cb_81xx); |
2395 | ha->gid_list_info_size = 8; | 2399 | ha->gid_list_info_size = 8; |
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index aa2e86917a0a..cb8ea4463886 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -52,7 +52,7 @@ MODULE_PARM_DESC(qlini_mode, | |||
52 | "\"disabled\" - initiator mode will never be enabled; " | 52 | "\"disabled\" - initiator mode will never be enabled; " |
53 | "\"enabled\" (default) - initiator mode will always stay enabled."); | 53 | "\"enabled\" (default) - initiator mode will always stay enabled."); |
54 | 54 | ||
55 | static int ql2x_ini_mode = QLA2XXX_INI_MODE_EXCLUSIVE; | 55 | int ql2x_ini_mode = QLA2XXX_INI_MODE_EXCLUSIVE; |
56 | 56 | ||
57 | /* | 57 | /* |
58 | * From scsi/fc/fc_fcp.h | 58 | * From scsi/fc/fc_fcp.h |
@@ -1119,6 +1119,7 @@ static void qlt_send_notify_ack(struct scsi_qla_host *vha, | |||
1119 | nack->u.isp24.srr_rx_id = ntfy->u.isp24.srr_rx_id; | 1119 | nack->u.isp24.srr_rx_id = ntfy->u.isp24.srr_rx_id; |
1120 | nack->u.isp24.status = ntfy->u.isp24.status; | 1120 | nack->u.isp24.status = ntfy->u.isp24.status; |
1121 | nack->u.isp24.status_subcode = ntfy->u.isp24.status_subcode; | 1121 | nack->u.isp24.status_subcode = ntfy->u.isp24.status_subcode; |
1122 | nack->u.isp24.fw_handle = ntfy->u.isp24.fw_handle; | ||
1122 | nack->u.isp24.exchange_address = ntfy->u.isp24.exchange_address; | 1123 | nack->u.isp24.exchange_address = ntfy->u.isp24.exchange_address; |
1123 | nack->u.isp24.srr_rel_offs = ntfy->u.isp24.srr_rel_offs; | 1124 | nack->u.isp24.srr_rel_offs = ntfy->u.isp24.srr_rel_offs; |
1124 | nack->u.isp24.srr_ui = ntfy->u.isp24.srr_ui; | 1125 | nack->u.isp24.srr_ui = ntfy->u.isp24.srr_ui; |
@@ -4666,7 +4667,6 @@ void | |||
4666 | qlt_24xx_process_atio_queue(struct scsi_qla_host *vha) | 4667 | qlt_24xx_process_atio_queue(struct scsi_qla_host *vha) |
4667 | { | 4668 | { |
4668 | struct qla_hw_data *ha = vha->hw; | 4669 | struct qla_hw_data *ha = vha->hw; |
4669 | struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; | ||
4670 | struct atio_from_isp *pkt; | 4670 | struct atio_from_isp *pkt; |
4671 | int cnt, i; | 4671 | int cnt, i; |
4672 | 4672 | ||
@@ -4694,26 +4694,28 @@ qlt_24xx_process_atio_queue(struct scsi_qla_host *vha) | |||
4694 | } | 4694 | } |
4695 | 4695 | ||
4696 | /* Adjust ring index */ | 4696 | /* Adjust ring index */ |
4697 | WRT_REG_DWORD(®->atio_q_out, ha->tgt.atio_ring_index); | 4697 | WRT_REG_DWORD(ISP_ATIO_Q_OUT(vha), ha->tgt.atio_ring_index); |
4698 | } | 4698 | } |
4699 | 4699 | ||
4700 | void | 4700 | void |
4701 | qlt_24xx_config_rings(struct scsi_qla_host *vha, device_reg_t __iomem *reg) | 4701 | qlt_24xx_config_rings(struct scsi_qla_host *vha) |
4702 | { | 4702 | { |
4703 | struct qla_hw_data *ha = vha->hw; | 4703 | struct qla_hw_data *ha = vha->hw; |
4704 | if (!QLA_TGT_MODE_ENABLED()) | ||
4705 | return; | ||
4704 | 4706 | ||
4705 | /* FIXME: atio_q in/out for ha->mqenable=1..? */ | 4707 | WRT_REG_DWORD(ISP_ATIO_Q_IN(vha), 0); |
4706 | if (ha->mqenable) { | 4708 | WRT_REG_DWORD(ISP_ATIO_Q_OUT(vha), 0); |
4707 | #if 0 | 4709 | RD_REG_DWORD(ISP_ATIO_Q_OUT(vha)); |
4708 | WRT_REG_DWORD(®->isp25mq.atio_q_in, 0); | 4710 | |
4709 | WRT_REG_DWORD(®->isp25mq.atio_q_out, 0); | 4711 | if (IS_ATIO_MSIX_CAPABLE(ha)) { |
4710 | RD_REG_DWORD(®->isp25mq.atio_q_out); | 4712 | struct qla_msix_entry *msix = &ha->msix_entries[2]; |
4711 | #endif | 4713 | struct init_cb_24xx *icb = (struct init_cb_24xx *)ha->init_cb; |
4712 | } else { | 4714 | |
4713 | /* Setup APTIO registers for target mode */ | 4715 | icb->msix_atio = cpu_to_le16(msix->entry); |
4714 | WRT_REG_DWORD(®->isp24.atio_q_in, 0); | 4716 | ql_dbg(ql_dbg_init, vha, 0xf072, |
4715 | WRT_REG_DWORD(®->isp24.atio_q_out, 0); | 4717 | "Registering ICB vector 0x%x for atio que.\n", |
4716 | RD_REG_DWORD(®->isp24.atio_q_out); | 4718 | msix->entry); |
4717 | } | 4719 | } |
4718 | } | 4720 | } |
4719 | 4721 | ||
@@ -4796,6 +4798,101 @@ qlt_24xx_config_nvram_stage2(struct scsi_qla_host *vha, | |||
4796 | } | 4798 | } |
4797 | } | 4799 | } |
4798 | 4800 | ||
4801 | void | ||
4802 | qlt_81xx_config_nvram_stage1(struct scsi_qla_host *vha, struct nvram_81xx *nv) | ||
4803 | { | ||
4804 | struct qla_hw_data *ha = vha->hw; | ||
4805 | |||
4806 | if (!QLA_TGT_MODE_ENABLED()) | ||
4807 | return; | ||
4808 | |||
4809 | if (qla_tgt_mode_enabled(vha)) { | ||
4810 | if (!ha->tgt.saved_set) { | ||
4811 | /* We save only once */ | ||
4812 | ha->tgt.saved_exchange_count = nv->exchange_count; | ||
4813 | ha->tgt.saved_firmware_options_1 = | ||
4814 | nv->firmware_options_1; | ||
4815 | ha->tgt.saved_firmware_options_2 = | ||
4816 | nv->firmware_options_2; | ||
4817 | ha->tgt.saved_firmware_options_3 = | ||
4818 | nv->firmware_options_3; | ||
4819 | ha->tgt.saved_set = 1; | ||
4820 | } | ||
4821 | |||
4822 | nv->exchange_count = __constant_cpu_to_le16(0xFFFF); | ||
4823 | |||
4824 | /* Enable target mode */ | ||
4825 | nv->firmware_options_1 |= __constant_cpu_to_le32(BIT_4); | ||
4826 | |||
4827 | /* Disable ini mode, if requested */ | ||
4828 | if (!qla_ini_mode_enabled(vha)) | ||
4829 | nv->firmware_options_1 |= | ||
4830 | __constant_cpu_to_le32(BIT_5); | ||
4831 | |||
4832 | /* Disable Full Login after LIP */ | ||
4833 | nv->firmware_options_1 &= __constant_cpu_to_le32(~BIT_13); | ||
4834 | /* Enable initial LIP */ | ||
4835 | nv->firmware_options_1 &= __constant_cpu_to_le32(~BIT_9); | ||
4836 | /* Enable FC tapes support */ | ||
4837 | nv->firmware_options_2 |= __constant_cpu_to_le32(BIT_12); | ||
4838 | /* Disable Full Login after LIP */ | ||
4839 | nv->host_p &= __constant_cpu_to_le32(~BIT_10); | ||
4840 | /* Enable target PRLI control */ | ||
4841 | nv->firmware_options_2 |= __constant_cpu_to_le32(BIT_14); | ||
4842 | } else { | ||
4843 | if (ha->tgt.saved_set) { | ||
4844 | nv->exchange_count = ha->tgt.saved_exchange_count; | ||
4845 | nv->firmware_options_1 = | ||
4846 | ha->tgt.saved_firmware_options_1; | ||
4847 | nv->firmware_options_2 = | ||
4848 | ha->tgt.saved_firmware_options_2; | ||
4849 | nv->firmware_options_3 = | ||
4850 | ha->tgt.saved_firmware_options_3; | ||
4851 | } | ||
4852 | return; | ||
4853 | } | ||
4854 | |||
4855 | /* out-of-order frames reassembly */ | ||
4856 | nv->firmware_options_3 |= BIT_6|BIT_9; | ||
4857 | |||
4858 | if (ha->tgt.enable_class_2) { | ||
4859 | if (vha->flags.init_done) | ||
4860 | fc_host_supported_classes(vha->host) = | ||
4861 | FC_COS_CLASS2 | FC_COS_CLASS3; | ||
4862 | |||
4863 | nv->firmware_options_2 |= __constant_cpu_to_le32(BIT_8); | ||
4864 | } else { | ||
4865 | if (vha->flags.init_done) | ||
4866 | fc_host_supported_classes(vha->host) = FC_COS_CLASS3; | ||
4867 | |||
4868 | nv->firmware_options_2 &= ~__constant_cpu_to_le32(BIT_8); | ||
4869 | } | ||
4870 | } | ||
4871 | |||
4872 | void | ||
4873 | qlt_81xx_config_nvram_stage2(struct scsi_qla_host *vha, | ||
4874 | struct init_cb_81xx *icb) | ||
4875 | { | ||
4876 | struct qla_hw_data *ha = vha->hw; | ||
4877 | |||
4878 | if (!QLA_TGT_MODE_ENABLED()) | ||
4879 | return; | ||
4880 | |||
4881 | if (ha->tgt.node_name_set) { | ||
4882 | memcpy(icb->node_name, ha->tgt.tgt_node_name, WWN_SIZE); | ||
4883 | icb->firmware_options_1 |= __constant_cpu_to_le32(BIT_14); | ||
4884 | } | ||
4885 | } | ||
4886 | |||
4887 | void | ||
4888 | qlt_83xx_iospace_config(struct qla_hw_data *ha) | ||
4889 | { | ||
4890 | if (!QLA_TGT_MODE_ENABLED()) | ||
4891 | return; | ||
4892 | |||
4893 | ha->msix_count += 1; /* For ATIO Q */ | ||
4894 | } | ||
4895 | |||
4799 | int | 4896 | int |
4800 | qlt_24xx_process_response_error(struct scsi_qla_host *vha, | 4897 | qlt_24xx_process_response_error(struct scsi_qla_host *vha, |
4801 | struct sts_entry_24xx *pkt) | 4898 | struct sts_entry_24xx *pkt) |
@@ -4828,11 +4925,41 @@ qlt_probe_one_stage1(struct scsi_qla_host *base_vha, struct qla_hw_data *ha) | |||
4828 | if (!QLA_TGT_MODE_ENABLED()) | 4925 | if (!QLA_TGT_MODE_ENABLED()) |
4829 | return; | 4926 | return; |
4830 | 4927 | ||
4928 | if (ha->mqenable || IS_QLA83XX(ha)) { | ||
4929 | ISP_ATIO_Q_IN(base_vha) = &ha->mqiobase->isp25mq.atio_q_in; | ||
4930 | ISP_ATIO_Q_OUT(base_vha) = &ha->mqiobase->isp25mq.atio_q_out; | ||
4931 | } else { | ||
4932 | ISP_ATIO_Q_IN(base_vha) = &ha->iobase->isp24.atio_q_in; | ||
4933 | ISP_ATIO_Q_OUT(base_vha) = &ha->iobase->isp24.atio_q_out; | ||
4934 | } | ||
4935 | |||
4831 | mutex_init(&ha->tgt.tgt_mutex); | 4936 | mutex_init(&ha->tgt.tgt_mutex); |
4832 | mutex_init(&ha->tgt.tgt_host_action_mutex); | 4937 | mutex_init(&ha->tgt.tgt_host_action_mutex); |
4833 | qlt_clear_mode(base_vha); | 4938 | qlt_clear_mode(base_vha); |
4834 | } | 4939 | } |
4835 | 4940 | ||
4941 | irqreturn_t | ||
4942 | qla83xx_msix_atio_q(int irq, void *dev_id) | ||
4943 | { | ||
4944 | struct rsp_que *rsp; | ||
4945 | scsi_qla_host_t *vha; | ||
4946 | struct qla_hw_data *ha; | ||
4947 | unsigned long flags; | ||
4948 | |||
4949 | rsp = (struct rsp_que *) dev_id; | ||
4950 | ha = rsp->hw; | ||
4951 | vha = pci_get_drvdata(ha->pdev); | ||
4952 | |||
4953 | spin_lock_irqsave(&ha->hardware_lock, flags); | ||
4954 | |||
4955 | qlt_24xx_process_atio_queue(vha); | ||
4956 | qla24xx_process_response_queue(vha, rsp); | ||
4957 | |||
4958 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | ||
4959 | |||
4960 | return IRQ_HANDLED; | ||
4961 | } | ||
4962 | |||
4836 | int | 4963 | int |
4837 | qlt_mem_alloc(struct qla_hw_data *ha) | 4964 | qlt_mem_alloc(struct qla_hw_data *ha) |
4838 | { | 4965 | { |
diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index fc61d6ab925e..ff9ccb9fd036 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h | |||
@@ -162,7 +162,7 @@ struct imm_ntfy_from_isp { | |||
162 | uint16_t srr_rx_id; | 162 | uint16_t srr_rx_id; |
163 | uint16_t status; | 163 | uint16_t status; |
164 | uint8_t status_subcode; | 164 | uint8_t status_subcode; |
165 | uint8_t reserved_3; | 165 | uint8_t fw_handle; |
166 | uint32_t exchange_address; | 166 | uint32_t exchange_address; |
167 | uint32_t srr_rel_offs; | 167 | uint32_t srr_rel_offs; |
168 | uint16_t srr_ui; | 168 | uint16_t srr_ui; |
@@ -218,7 +218,7 @@ struct nack_to_isp { | |||
218 | uint16_t srr_rx_id; | 218 | uint16_t srr_rx_id; |
219 | uint16_t status; | 219 | uint16_t status; |
220 | uint8_t status_subcode; | 220 | uint8_t status_subcode; |
221 | uint8_t reserved_3; | 221 | uint8_t fw_handle; |
222 | uint32_t exchange_address; | 222 | uint32_t exchange_address; |
223 | uint32_t srr_rel_offs; | 223 | uint32_t srr_rel_offs; |
224 | uint16_t srr_ui; | 224 | uint16_t srr_ui; |
@@ -949,6 +949,7 @@ extern void qlt_update_vp_map(struct scsi_qla_host *, int); | |||
949 | * is not set. Right now, ha value is ignored. | 949 | * is not set. Right now, ha value is ignored. |
950 | */ | 950 | */ |
951 | #define QLA_TGT_MODE_ENABLED() (ql2x_ini_mode != QLA2XXX_INI_MODE_ENABLED) | 951 | #define QLA_TGT_MODE_ENABLED() (ql2x_ini_mode != QLA2XXX_INI_MODE_ENABLED) |
952 | extern int ql2x_ini_mode; | ||
952 | 953 | ||
953 | static inline bool qla_tgt_mode_enabled(struct scsi_qla_host *ha) | 954 | static inline bool qla_tgt_mode_enabled(struct scsi_qla_host *ha) |
954 | { | 955 | { |
@@ -986,12 +987,15 @@ extern void qlt_vport_create(struct scsi_qla_host *, struct qla_hw_data *); | |||
986 | extern void qlt_rff_id(struct scsi_qla_host *, struct ct_sns_req *); | 987 | extern void qlt_rff_id(struct scsi_qla_host *, struct ct_sns_req *); |
987 | extern void qlt_init_atio_q_entries(struct scsi_qla_host *); | 988 | extern void qlt_init_atio_q_entries(struct scsi_qla_host *); |
988 | extern void qlt_24xx_process_atio_queue(struct scsi_qla_host *); | 989 | extern void qlt_24xx_process_atio_queue(struct scsi_qla_host *); |
989 | extern void qlt_24xx_config_rings(struct scsi_qla_host *, | 990 | extern void qlt_24xx_config_rings(struct scsi_qla_host *); |
990 | device_reg_t __iomem *); | ||
991 | extern void qlt_24xx_config_nvram_stage1(struct scsi_qla_host *, | 991 | extern void qlt_24xx_config_nvram_stage1(struct scsi_qla_host *, |
992 | struct nvram_24xx *); | 992 | struct nvram_24xx *); |
993 | extern void qlt_24xx_config_nvram_stage2(struct scsi_qla_host *, | 993 | extern void qlt_24xx_config_nvram_stage2(struct scsi_qla_host *, |
994 | struct init_cb_24xx *); | 994 | struct init_cb_24xx *); |
995 | extern void qlt_81xx_config_nvram_stage2(struct scsi_qla_host *, | ||
996 | struct init_cb_81xx *); | ||
997 | extern void qlt_81xx_config_nvram_stage1(struct scsi_qla_host *, | ||
998 | struct nvram_81xx *); | ||
995 | extern int qlt_24xx_process_response_error(struct scsi_qla_host *, | 999 | extern int qlt_24xx_process_response_error(struct scsi_qla_host *, |
996 | struct sts_entry_24xx *); | 1000 | struct sts_entry_24xx *); |
997 | extern void qlt_modify_vp_config(struct scsi_qla_host *, | 1001 | extern void qlt_modify_vp_config(struct scsi_qla_host *, |
@@ -1001,5 +1005,7 @@ extern int qlt_mem_alloc(struct qla_hw_data *); | |||
1001 | extern void qlt_mem_free(struct qla_hw_data *); | 1005 | extern void qlt_mem_free(struct qla_hw_data *); |
1002 | extern void qlt_stop_phase1(struct qla_tgt *); | 1006 | extern void qlt_stop_phase1(struct qla_tgt *); |
1003 | extern void qlt_stop_phase2(struct qla_tgt *); | 1007 | extern void qlt_stop_phase2(struct qla_tgt *); |
1008 | extern irqreturn_t qla83xx_msix_atio_q(int, void *); | ||
1009 | extern void qlt_83xx_iospace_config(struct qla_hw_data *); | ||
1004 | 1010 | ||
1005 | #endif /* __QLA_TARGET_H */ | 1011 | #endif /* __QLA_TARGET_H */ |