Lines Matching refs:vha

23 	struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
25 struct qla_hw_data *ha = vha->hw;
64 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
66 struct qla_hw_data *ha = vha->hw;
78 ql_log(ql_log_info, vha, 0x705d,
79 "Firmware dump cleared on (%ld).\n", vha->host_no);
82 qla82xx_md_free(vha);
83 qla82xx_md_prep(vha);
92 ql_log(ql_log_info, vha, 0x705e,
94 vha->host_no);
98 qla2x00_alloc_fw_dump(vha);
103 qla82xx_set_reset_owner(vha);
107 qla82xx_set_reset_owner(vha);
110 qla2x00_system_error(vha);
116 ql_dbg(ql_dbg_user, vha, 0x705b,
119 ql_dbg(ql_dbg_user, vha, 0x709d,
125 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
130 ql_log(ql_log_info, vha, 0x70c1,
131 "MCTP dump cleared on (%ld).\n", vha->host_no);
138 ql_log(ql_log_info, vha, 0x70c2,
140 vha->host_no);
146 ql_log(ql_log_info, vha, 0x70e7,
147 "MPI firmware dump cleared on (%ld).\n", vha->host_no);
154 ql_log(ql_log_info, vha, 0x70e8,
156 vha->host_no);
161 ql_log(ql_log_info, vha, 0x70e9,
163 vha->host_no);
164 ha->isp_ops->mpi_fw_dump(vha, 0);
186 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
188 struct qla_hw_data *ha = vha->hw;
196 if (qla2x00_chip_is_down(vha)) {
208 qla28xx_get_aux_images(vha, &active_regions);
212 ha->isp_ops->read_optrom(vha, ha->nvram, faddr << 2, ha->nvram_size);
226 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
228 struct qla_hw_data *ha = vha->hw;
257 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) {
258 ql_log(ql_log_warn, vha, 0x705f,
264 if (qla2x00_chip_is_down(vha)) {
270 ha->isp_ops->write_nvram(vha, buf, ha->nvram_base, count);
271 ha->isp_ops->read_nvram(vha, ha->nvram, ha->nvram_base,
275 ql_dbg(ql_dbg_user, vha, 0x7060,
278 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
279 qla2xxx_wake_dpc(vha);
280 qla2x00_wait_for_chip_reset(vha);
300 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
302 struct qla_hw_data *ha = vha->hw;
324 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
326 struct qla_hw_data *ha = vha->hw;
362 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
364 struct qla_hw_data *ha = vha->hw;
384 if (qla2x00_chip_is_down(vha)) {
397 ql_dbg(ql_dbg_user, vha, 0x7061,
416 ql_log(ql_log_warn, vha, 0x7062,
425 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) {
426 ql_log(ql_log_warn, vha, 0x7063,
432 ql_dbg(ql_dbg_user, vha, 0x7064,
436 ha->isp_ops->read_optrom(vha, ha->optrom_buffer,
475 ql_log(ql_log_warn, vha, 0x7065,
487 ql_log(ql_log_warn, vha, 0x7066,
496 ql_dbg(ql_dbg_user, vha, 0x7067,
507 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) {
508 ql_log(ql_log_warn, vha, 0x7068,
514 ql_dbg(ql_dbg_user, vha, 0x7069,
518 rval = ha->isp_ops->write_optrom(vha, ha->optrom_buffer,
546 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
548 struct qla_hw_data *ha = vha->hw;
564 qla28xx_get_aux_images(vha, &active_regions);
568 ql_dbg(ql_dbg_init, vha, 0x7070,
575 if (qla2x00_chip_is_down(vha)) {
580 ha->isp_ops->read_optrom(vha, ha->vpd, faddr, ha->vpd_size);
583 ha->isp_ops->read_optrom(vha, ha->vpd, faddr, ha->vpd_size);
593 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
595 struct qla_hw_data *ha = vha->hw;
601 if (qla2x00_chip_is_down(vha))
608 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) {
609 ql_log(ql_log_warn, vha, 0x706a,
615 if (qla2x00_chip_is_down(vha)) {
621 ha->isp_ops->write_nvram(vha, buf, ha->vpd_base, count);
622 ha->isp_ops->read_nvram(vha, ha->vpd, ha->vpd_base, count);
633 ql_log(ql_log_warn, vha, 0x706b,
637 ha->isp_ops->get_flash_version(vha, tmp_data);
660 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
667 mutex_lock(&vha->hw->optrom_mutex);
668 if (qla2x00_chip_is_down(vha)) {
669 mutex_unlock(&vha->hw->optrom_mutex);
673 rval = qla2x00_read_sfp_dev(vha, buf, count);
674 mutex_unlock(&vha->hw->optrom_mutex);
696 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
698 struct qla_hw_data *ha = vha->hw;
710 ql_log(ql_log_info, vha, 0x706e,
713 if (vha->hw->flags.port_isolated) {
714 ql_log(ql_log_info, vha, 0x706e,
719 scsi_block_requests(vha->host);
723 qla82xx_set_reset_owner(vha);
731 qla82xx_set_reset_owner(vha);
734 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
735 qla2xxx_wake_dpc(vha);
737 qla2x00_wait_for_chip_reset(vha);
738 scsi_unblock_requests(vha->host);
745 ql_log(ql_log_info, vha, 0x706f,
751 qla83xx_idc_lock(vha, 0);
752 __qla83xx_get_idc_control(vha, &idc_control);
754 __qla83xx_set_idc_control(vha, idc_control);
755 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE,
757 qla83xx_idc_audit(vha, IDC_AUDIT_TIMESTAMP);
758 qla83xx_idc_unlock(vha, 0);
762 WARN_ON_ONCE(qla2x00_wait_for_hba_online(vha) !=
766 scsi_block_requests(vha->host);
767 if (qla81xx_restart_mpi_firmware(vha) != QLA_SUCCESS)
768 ql_log(ql_log_warn, vha, 0x7070,
770 scsi_unblock_requests(vha->host);
775 if (!IS_P3P_TYPE(ha) || vha != base_vha) {
776 ql_log(ql_log_info, vha, 0x7071,
781 ql_log(ql_log_info, vha, 0x7072,
783 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags);
784 qla2xxx_wake_dpc(vha);
785 qla2x00_wait_for_fcoe_ctx_reset(vha);
790 ql_log(ql_log_info, vha, 0x70bc,
792 qla83xx_idc_lock(vha, 0);
793 __qla83xx_get_idc_control(vha, &idc_control);
795 __qla83xx_set_idc_control(vha, idc_control);
796 qla83xx_idc_unlock(vha, 0);
801 ql_log(ql_log_info, vha, 0x70bd,
803 qla83xx_idc_lock(vha, 0);
804 __qla83xx_get_idc_control(vha, &idc_control);
806 __qla83xx_set_idc_control(vha, idc_control);
807 qla83xx_idc_unlock(vha, 0);
810 ql_dbg(ql_dbg_user, vha, 0x70e0,
815 ql_log(ql_log_warn, vha, 0x70e1,
819 ha->isp_ops->get_flash_version(vha, tmp_data);
840 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
848 if (unlikely(pci_channel_offline(vha->hw->pdev)))
851 if (qla2x00_chip_is_down(vha))
860 ql_log(ql_log_info, vha, 0xd04d, "portid=%02x%02x%02x done\n",
863 ql_log(ql_log_info, vha, 0x70e4, "%s: %d\n", __func__, type);
865 qla24xx_els_dcmd_iocb(vha, ELS_DCMD_LOGO, did);
883 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
885 struct qla_hw_data *ha = vha->hw;
894 mutex_lock(&vha->hw->optrom_mutex);
895 if (qla2x00_chip_is_down(vha)) {
896 mutex_unlock(&vha->hw->optrom_mutex);
906 mutex_unlock(&vha->hw->optrom_mutex);
907 ql_log(ql_log_warn, vha, 0x7076,
916 rval = qla2x00_get_xgmac_stats(vha, ha->xgmac_data_dma,
919 mutex_unlock(&vha->hw->optrom_mutex);
921 ql_log(ql_log_warn, vha, 0x7077,
946 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
948 struct qla_hw_data *ha = vha->hw;
954 mutex_lock(&vha->hw->optrom_mutex);
957 if (qla2x00_chip_is_down(vha)) {
958 mutex_unlock(&vha->hw->optrom_mutex);
965 mutex_unlock(&vha->hw->optrom_mutex);
966 ql_log(ql_log_warn, vha, 0x7078,
974 rval = qla2x00_get_dcbx_params(vha, ha->dcbx_tlv_dma,
977 mutex_unlock(&vha->hw->optrom_mutex);
980 ql_log(ql_log_warn, vha, 0x7079,
1018 qla2x00_alloc_sysfs_attr(scsi_qla_host_t *vha)
1020 struct Scsi_Host *host = vha->host;
1025 if (iter->type && !IS_FWI2_CAPABLE(vha->hw))
1027 if (iter->type == 2 && !IS_QLA25XX(vha->hw))
1029 if (iter->type == 3 && !(IS_CNA_CAPABLE(vha->hw)))
1035 ql_log(ql_log_warn, vha, 0x00f3,
1039 ql_dbg(ql_dbg_init, vha, 0x00f4,
1046 qla2x00_free_sysfs_attr(scsi_qla_host_t *vha, bool stop_beacon)
1048 struct Scsi_Host *host = vha->host;
1050 struct qla_hw_data *ha = vha->hw;
1065 ha->isp_ops->beacon_off(vha);
1074 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1075 struct qla_hw_data *ha = vha->hw;
1079 ha->isp_ops->fw_version_str(vha, fw_str, sizeof(fw_str)));
1086 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1087 struct qla_hw_data *ha = vha->hw;
1090 if (IS_QLAFX00(vha->hw)) {
1092 vha->hw->mr.serial_num);
1094 qla2xxx_get_vpd_field(vha, "SN", buf, PAGE_SIZE - 1);
1107 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1109 return scnprintf(buf, PAGE_SIZE, "ISP%04X\n", vha->hw->pdev->device);
1116 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1117 struct qla_hw_data *ha = vha->hw;
1119 if (IS_QLAFX00(vha->hw))
1121 vha->hw->mr.hw_version);
1132 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1134 return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_number);
1141 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1143 return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_desc);
1150 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1154 vha->hw->isp_ops->pci_info_str(vha, pci_info,
1162 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1163 struct qla_hw_data *ha = vha->hw;
1166 if (atomic_read(&vha->loop_state) == LOOP_DOWN ||
1167 atomic_read(&vha->loop_state) == LOOP_DEAD ||
1168 vha->device_flags & DFLG_NO_CABLE)
1170 else if (atomic_read(&vha->loop_state) != LOOP_READY ||
1171 qla2x00_chip_is_down(vha))
1202 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1205 switch (vha->hw->zio_mode) {
1220 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1221 struct qla_hw_data *ha = vha->hw;
1239 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
1248 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1250 return scnprintf(buf, PAGE_SIZE, "%d us\n", vha->hw->zio_timer * 100);
1257 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1267 vha->hw->zio_timer = zio_timer;
1276 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1279 vha->hw->last_zio_threshold);
1286 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1289 if (vha->hw->zio_mode != QLA_ZIO_MODE_6)
1296 atomic_set(&vha->hw->zio_threshold, val);
1304 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1307 if (vha->hw->beacon_blink_led)
1318 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1319 struct qla_hw_data *ha = vha->hw;
1329 mutex_lock(&vha->hw->optrom_mutex);
1330 if (qla2x00_chip_is_down(vha)) {
1331 mutex_unlock(&vha->hw->optrom_mutex);
1332 ql_log(ql_log_warn, vha, 0x707a,
1338 rval = ha->isp_ops->beacon_on(vha);
1340 rval = ha->isp_ops->beacon_off(vha);
1345 mutex_unlock(&vha->hw->optrom_mutex);
1354 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1355 struct qla_hw_data *ha = vha->hw;
1361 if (ql26xx_led_config(vha, 0, led))
1372 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1373 struct qla_hw_data *ha = vha->hw;
1417 if (ql26xx_led_config(vha, options, led))
1427 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1428 struct qla_hw_data *ha = vha->hw;
1438 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1439 struct qla_hw_data *ha = vha->hw;
1449 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1450 struct qla_hw_data *ha = vha->hw;
1460 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1461 struct qla_hw_data *ha = vha->hw;
1472 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1473 struct qla_hw_data *ha = vha->hw;
1488 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1491 vha->qla_stats.total_isp_aborts);
1500 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1501 struct qla_hw_data *ha = vha->hw;
1507 rval = qla84xx_verify_chip(vha, status);
1521 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1522 struct qla_hw_data *ha = vha->hw;
1536 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1537 struct qla_hw_data *ha = vha->hw;
1552 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1553 struct qla_hw_data *ha = vha->hw;
1566 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1567 struct qla_hw_data *ha = vha->hw;
1576 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1578 if (!IS_CNA_CAPABLE(vha->hw))
1581 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id);
1588 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1590 if (!IS_CNA_CAPABLE(vha->hw))
1593 return scnprintf(buf, PAGE_SIZE, "%pMR\n", vha->fcoe_vn_port_mac);
1600 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1602 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->hw->switch_cap);
1609 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1613 mutex_lock(&vha->hw->optrom_mutex);
1614 if (qla2x00_chip_is_down(vha)) {
1615 mutex_unlock(&vha->hw->optrom_mutex);
1616 ql_log(ql_log_warn, vha, 0x70dc, "ISP reset active.\n");
1620 if (vha->hw->flags.eeh_busy) {
1621 mutex_unlock(&vha->hw->optrom_mutex);
1622 ql_log(ql_log_warn, vha, 0x70dd, "PCI EEH busy.\n");
1626 rc = qla2x00_get_thermal_temp(vha, &temp);
1627 mutex_unlock(&vha->hw->optrom_mutex);
1639 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1644 if (IS_QLAFX00(vha->hw)) {
1649 mutex_lock(&vha->hw->optrom_mutex);
1650 if (qla2x00_chip_is_down(vha)) {
1651 mutex_unlock(&vha->hw->optrom_mutex);
1652 ql_log(ql_log_warn, vha, 0x707c,
1655 } else if (vha->hw->flags.eeh_busy) {
1656 mutex_unlock(&vha->hw->optrom_mutex);
1660 rval = qla2x00_get_firmware_state(vha, state);
1661 mutex_unlock(&vha->hw->optrom_mutex);
1665 rval = qla2x00_get_firmware_state(vha, state);
1676 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1678 if (!IS_BIDI_CAPABLE(vha->hw))
1681 return scnprintf(buf, PAGE_SIZE, "%llu\n", vha->bidi_stats.io_count);
1688 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1690 if (!IS_BIDI_CAPABLE(vha->hw))
1694 vha->bidi_stats.transfer_bytes >> 20);
1701 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1702 struct qla_hw_data *ha = vha->hw;
1719 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1721 if (!IS_P3P_TYPE(vha->hw))
1725 vha->hw->allow_cna_fw_dump ? "true" : "false");
1732 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1735 if (!IS_P3P_TYPE(vha->hw))
1741 vha->hw->allow_cna_fw_dump = val != 0;
1750 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1751 struct qla_hw_data *ha = vha->hw;
1764 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1765 struct qla_hw_data *ha = vha->hw;
1783 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1784 struct qla_hw_data *ha = vha->hw;
1799 struct scsi_qla_host *vha = shost_priv(dev_to_shost(dev));
1803 struct qla_hw_data *ha = vha->hw;
1806 ql_log(ql_log_warn, vha, 0x70d8,
1817 ql_dbg(ql_dbg_user, vha, 0x70d9,
1842 ql_log(ql_log_warn, vha, 0x1199,
1848 if (qla2x00_chip_is_down(vha) || (oldspeed == ha->set_data_rate))
1851 ql_log(ql_log_info, vha, 0x70da,
1854 rval = qla2x00_set_data_rate(vha, mode);
1877 struct scsi_qla_host *vha = shost_priv(dev_to_shost(dev));
1878 struct qla_hw_data *ha = vha->hw;
1883 rval = qla2x00_get_data_rate(vha);
1885 ql_log(ql_log_warn, vha, 0x70db,
1904 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1910 ql_log(ql_log_warn, vha, 0x7089, "Pausing MPI...\n");
1912 rval = qla83xx_wr_reg(vha, 0x002012d4, 0x30000001);
1915 ql_log(ql_log_warn, vha, 0x708a, "Unable to pause MPI.\n");
1929 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1938 switch (vha->qlini_mode) {
1969 static void qla_set_ini_mode(scsi_qla_host_t *vha, int op)
1981 switch (vha->qlini_mode) {
1985 if (qla_tgt_mode_enabled(vha)) {
1986 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
1987 vha->hw->flags.exchoffld_enabled)
1989 if (((vha->ql2xexchoffld !=
1990 vha->u_ql2xexchoffld) &&
1991 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
2007 if (qla_tgt_mode_enabled(vha)) {
2008 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
2009 vha->hw->flags.exchoffld_enabled)
2011 if (((vha->ql2xexchoffld !=
2012 vha->u_ql2xexchoffld) &&
2013 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
2031 if (qla_tgt_mode_enabled(vha)) {
2040 if (qla_tgt_mode_enabled(vha))
2053 if (qla_tgt_mode_enabled(vha)) {
2054 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
2055 vha->hw->flags.exchoffld_enabled)
2057 if (((vha->ql2xexchoffld !=
2058 vha->u_ql2xexchoffld) &&
2059 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
2075 if (qla_tgt_mode_enabled(vha)) {
2076 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
2077 vha->hw->flags.exchoffld_enabled)
2079 if (((vha->ql2xexchoffld !=
2080 vha->u_ql2xexchoffld) &&
2081 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
2091 if (qla_tgt_mode_enabled(vha)) {
2099 if (qla_tgt_mode_enabled(vha))
2102 if (vha->hw->flags.fw_started)
2114 if (NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg) !=
2115 vha->hw->flags.exchoffld_enabled)
2117 if (((vha->ql2xiniexchg != vha->u_ql2xiniexchg) &&
2118 NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg)) ||
2137 if (qla_tgt_mode_enabled(vha) ||
2138 qla_dual_mode_enabled(vha)) {
2139 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld +
2140 vha->u_ql2xiniexchg) !=
2141 vha->hw->flags.exchoffld_enabled)
2144 if ((((vha->ql2xexchoffld +
2145 vha->ql2xiniexchg) !=
2146 (vha->u_ql2xiniexchg +
2147 vha->u_ql2xexchoffld)) &&
2148 NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg +
2149 vha->u_ql2xexchoffld)) || eo_toggle)
2154 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld +
2155 vha->u_ql2xiniexchg) !=
2156 vha->hw->flags.exchoffld_enabled)
2159 if ((((vha->ql2xexchoffld + vha->ql2xiniexchg)
2160 != (vha->u_ql2xiniexchg +
2161 vha->u_ql2xexchoffld)) &&
2162 NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg +
2163 vha->u_ql2xexchoffld)) || eo_toggle)
2171 if (qla_tgt_mode_enabled(vha) ||
2172 qla_dual_mode_enabled(vha)) {
2182 if (qla_tgt_mode_enabled(vha) ||
2183 qla_dual_mode_enabled(vha)) {
2192 if (qla_tgt_mode_enabled(vha) ||
2193 qla_dual_mode_enabled(vha)) {
2204 ql_log(ql_log_warn, vha, 0xffff,
2206 mode_to_str[vha->qlini_mode], mode_to_str[op],
2207 vha->ql2xexchoffld, vha->u_ql2xexchoffld,
2208 vha->ql2xiniexchg, vha->u_ql2xiniexchg);
2210 vha->qlini_mode = op;
2211 vha->ql2xexchoffld = vha->u_ql2xexchoffld;
2212 vha->ql2xiniexchg = vha->u_ql2xiniexchg;
2214 qlt_set_mode(vha);
2215 vha->flags.online = 1;
2216 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
2220 ql_log(ql_log_warn, vha, 0xffff,
2222 mode_to_str[vha->qlini_mode], mode_to_str[op],
2223 vha->ql2xexchoffld, vha->u_ql2xexchoffld,
2224 vha->ql2xiniexchg, vha->u_ql2xiniexchg);
2225 vha->qlini_mode = op;
2226 vha->ql2xexchoffld = vha->u_ql2xexchoffld;
2227 vha->ql2xiniexchg = vha->u_ql2xiniexchg;
2231 ql_log(ql_log_warn, vha, 0xffff,
2237 ql_log(ql_log_warn, vha, 0xffff,
2239 vha->qlini_mode, op,
2240 vha->ql2xexchoffld, vha->u_ql2xexchoffld);
2249 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2270 qla_set_ini_mode(vha, ini);
2278 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2283 vha->u_ql2xexchoffld, vha->ql2xexchoffld);
2287 vha->host_no);
2296 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2307 vha->u_ql2xexchoffld = val;
2315 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2320 vha->u_ql2xiniexchg, vha->ql2xiniexchg);
2324 vha->host_no);
2333 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2344 vha->u_ql2xiniexchg = val;
2352 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2353 struct qla_hw_data *ha = vha->hw;
2366 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2367 struct qla_hw_data *ha = vha->hw;
2383 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2385 return scnprintf(buf, PAGE_SIZE, "%u\n", vha->hw->port_no);
2392 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2394 if (!IS_QLA83XX(vha->hw) && !IS_QLA27XX(vha->hw) &&
2395 !IS_QLA28XX(vha->hw))
2398 if (!*vha->dport_data)
2402 vha->dport_data[0], vha->dport_data[1],
2403 vha->dport_data[2], vha->dport_data[3]);
2549 scsi_qla_host_t *vha = shost_priv(shost);
2551 fc_host_port_id(shost) = vha->d_id.b.domain << 16 |
2552 vha->d_id.b.area << 8 | vha->d_id.b.al_pa;
2558 scsi_qla_host_t *vha = shost_priv(shost);
2561 if (IS_QLAFX00(vha->hw)) {
2566 switch (vha->hw->link_data_rate) {
2602 scsi_qla_host_t *vha = shost_priv(shost);
2605 if (vha->vp_idx) {
2609 switch (vha->hw->current_topology) {
2634 scsi_qla_host_t *vha = shost_priv(host);
2638 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2653 scsi_qla_host_t *vha = shost_priv(host);
2657 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2672 scsi_qla_host_t *vha = shost_priv(host);
2676 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2710 ql_dbg(ql_dbg_async, fcport->vha, 0x5101,
2733 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags))
2736 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) {
2738 ql_dbg(ql_dbg_aer, fcport->vha, 0x900c,
2741 qla_pci_set_eeh_busy(fcport->vha);
2742 qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24,
2752 scsi_qla_host_t *vha;
2757 if (test_bit(UNLOADING, &fcport->vha->dpc_flags))
2760 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags))
2762 vha = fcport->vha;
2764 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) {
2766 ql_dbg(ql_dbg_aer, fcport->vha, 0x900b,
2769 qla_pci_set_eeh_busy(vha);
2770 qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24,
2781 if (IS_FWI2_CAPABLE(fcport->vha->hw) &&
2787 ql_dbg(ql_dbg_disc, fcport->vha, 0x911e,
2792 } else if (!IS_FWI2_CAPABLE(fcport->vha->hw)) {
2793 qla2x00_port_logout(fcport->vha, fcport);
2798 if (qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24, 0, WAIT_TARGET)) {
2799 ql_log(ql_log_warn, vha, 0x300b,
2801 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
2802 qla2xxx_wake_dpc(vha);
2803 qla2x00_wait_for_chip_reset(vha);
2810 scsi_qla_host_t *vha = shost_priv(shost);
2812 if (IS_QLAFX00(vha->hw))
2815 if (vha->hw->flags.port_isolated)
2818 qla2x00_loop_reset(vha);
2825 scsi_qla_host_t *vha = shost_priv(shost);
2826 struct qla_hw_data *ha = vha->hw;
2831 struct fc_host_statistics *p = &vha->fc_host_stat;
2838 if (IS_QLAFX00(vha->hw))
2841 if (test_bit(UNLOADING, &vha->dpc_flags))
2847 if (qla2x00_chip_is_down(vha))
2853 ql_log(ql_log_warn, vha, 0x707d,
2872 for (i = 0; i < vha->hw->max_qpairs; i++) {
2873 qpair = vha->hw->queue_pair_map[i];
2886 ir += vha->qla_stats.input_requests;
2887 or += vha->qla_stats.output_requests;
2888 ib += vha->qla_stats.input_bytes;
2889 ob += vha->qla_stats.output_bytes;
2916 p->fcp_control_requests = vha->qla_stats.control_requests;
2922 get_jiffies_64() - vha->qla_stats.jiffies_at_last_reset;
2935 scsi_qla_host_t *vha = shost_priv(shost);
2936 struct qla_hw_data *ha = vha->hw;
2943 memset(&vha->qla_stats, 0, sizeof(vha->qla_stats));
2944 memset(&vha->fc_host_stat, 0, sizeof(vha->fc_host_stat));
2945 for (i = 0; i < vha->hw->max_qpairs; i++) {
2946 qpair = vha->hw->queue_pair_map[i];
2953 vha->qla_stats.jiffies_at_last_reset = get_jiffies_64();
2961 ql_log(ql_log_warn, vha, 0x70d7,
2969 ql_log(ql_log_warn, vha, 0x70de,
2981 scsi_qla_host_t *vha = shost_priv(shost);
2983 qla2x00_get_sym_node_name(vha, fc_host_symbolic_name(shost),
2990 scsi_qla_host_t *vha = shost_priv(shost);
2992 set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags);
2998 scsi_qla_host_t *vha = shost_priv(shost);
3004 if (vha->device_flags & SWITCH_FOUND)
3005 fabric_name = wwn_to_u64(vha->fabric_node_name);
3013 scsi_qla_host_t *vha = shost_priv(shost);
3014 struct scsi_qla_host *base_vha = pci_get_drvdata(vha->hw->pdev);
3049 scsi_qla_host_t *vha = NULL;
3057 ql_log(ql_log_warn, vha, 0x707e,
3062 vha = qla24xx_create_vhost(fc_vport);
3063 if (vha == NULL) {
3064 ql_log(ql_log_warn, vha, 0x707f, "Vport create host failed.\n");
3068 atomic_set(&vha->vp_state, VP_OFFLINE);
3071 atomic_set(&vha->vp_state, VP_FAILED);
3074 ql_log(ql_log_info, vha, 0x7080,
3075 "VP entry id %d assigned.\n", vha->vp_idx);
3078 atomic_set(&vha->loop_state, LOOP_DOWN);
3079 vha->vp_err_state = VP_ERR_PORTDWN;
3080 vha->vp_prev_err_state = VP_ERR_UNKWN;
3085 ql_dbg(ql_dbg_user, vha, 0x7081,
3087 atomic_set(&vha->loop_state, LOOP_DEAD);
3096 vha->flags.difdix_supported = 1;
3097 ql_dbg(ql_dbg_user, vha, 0x7082,
3099 scsi_host_set_prot(vha->host,
3113 scsi_host_set_guard(vha->host, guard);
3115 vha->flags.difdix_supported = 0;
3118 if (scsi_add_host_with_dma(vha->host, &fc_vport->dev,
3120 ql_dbg(ql_dbg_user, vha, 0x7083,
3121 "scsi_add_host failure for VP[%d].\n", vha->vp_idx);
3126 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count;
3127 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name);
3128 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name);
3129 fc_host_supported_classes(vha->host) =
3131 fc_host_supported_speeds(vha->host) =
3134 qlt_vport_create(vha, ha);
3142 if (memcmp(ha->npiv_info[cnt].port_name, vha->port_name, 8) == 0
3143 && memcmp(ha->npiv_info[cnt].node_name, vha->node_name,
3151 qpair = qla2xxx_create_qpair(vha, qos, vha->vp_idx, true);
3153 ql_log(ql_log_warn, vha, 0x7084,
3155 vha->vp_idx);
3157 ql_dbg(ql_dbg_multiq, vha, 0xc001,
3159 qpair->id, qos, vha->vp_idx);
3160 ql_dbg(ql_dbg_user, vha, 0x7085,
3162 qpair->id, qos, vha->vp_idx);
3164 vha->qpair = qpair;
3169 vha->req = req;
3173 qla24xx_disable_vp(vha);
3174 qla24xx_deallocate_vp_id(vha);
3175 scsi_host_put(vha->host);
3182 scsi_qla_host_t *vha = fc_vport->dd_data;
3183 struct qla_hw_data *ha = vha->hw;
3184 uint16_t id = vha->vp_idx;
3186 set_bit(VPORT_DELETE, &vha->dpc_flags);
3188 while (test_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags))
3192 qla24xx_disable_vp(vha);
3193 qla2x00_wait_for_sess_deletion(vha);
3195 qla_nvme_delete(vha);
3196 qla_enode_stop(vha);
3197 qla_edb_stop(vha);
3199 vha->flags.delete_progress = 1;
3201 qlt_remove_target(ha, vha);
3203 fc_remove_host(vha->host);
3205 scsi_remove_host(vha->host);
3208 qla24xx_deallocate_vp_id(vha);
3210 if (vha->timer_active) {
3211 qla2x00_vp_stop_timer(vha);
3212 ql_dbg(ql_dbg_user, vha, 0x7086,
3213 "Timer for the VP[%d] has stopped\n", vha->vp_idx);
3216 qla2x00_free_fcports(vha);
3220 clear_bit(vha->vp_idx, ha->vp_idx_map);
3223 dma_free_coherent(&ha->pdev->dev, vha->gnl.size, vha->gnl.l,
3224 vha->gnl.ldma);
3226 vha->gnl.l = NULL;
3228 vfree(vha->scan.l);
3230 if (vha->qpair && vha->qpair->vp_idx == vha->vp_idx) {
3231 if (qla2xxx_delete_qpair(vha, vha->qpair) != QLA_SUCCESS)
3232 ql_log(ql_log_warn, vha, 0x7087,
3236 ql_log(ql_log_info, vha, 0x7088, "VP[%d] deleted.\n", id);
3237 scsi_host_put(vha->host);
3244 scsi_qla_host_t *vha = fc_vport->dd_data;
3247 qla24xx_disable_vp(vha);
3249 qla24xx_enable_vp(vha);
3347 qla2x00_get_host_supported_speeds(scsi_qla_host_t *vha, uint speeds)
3370 qla2x00_init_host_attr(scsi_qla_host_t *vha)
3372 struct qla_hw_data *ha = vha->hw;
3375 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count;
3376 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name);
3377 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name);
3378 fc_host_supported_classes(vha->host) = ha->base_qpair->enable_class_2 ?
3380 fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports;
3381 fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count;
3384 speeds = qla2x00_get_host_supported_speeds(vha, fdmi_speed);
3386 fc_host_supported_speeds(vha->host) = speeds;