Lines Matching defs: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 scsi_block_requests(vha->host);
717 qla82xx_set_reset_owner(vha);
725 qla82xx_set_reset_owner(vha);
728 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
729 qla2xxx_wake_dpc(vha);
731 qla2x00_wait_for_chip_reset(vha);
732 scsi_unblock_requests(vha->host);
739 ql_log(ql_log_info, vha, 0x706f,
745 qla83xx_idc_lock(vha, 0);
746 __qla83xx_get_idc_control(vha, &idc_control);
748 __qla83xx_set_idc_control(vha, idc_control);
749 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE,
751 qla83xx_idc_audit(vha, IDC_AUDIT_TIMESTAMP);
752 qla83xx_idc_unlock(vha, 0);
756 WARN_ON_ONCE(qla2x00_wait_for_hba_online(vha) !=
760 scsi_block_requests(vha->host);
761 if (qla81xx_restart_mpi_firmware(vha) != QLA_SUCCESS)
762 ql_log(ql_log_warn, vha, 0x7070,
764 scsi_unblock_requests(vha->host);
769 if (!IS_P3P_TYPE(ha) || vha != base_vha) {
770 ql_log(ql_log_info, vha, 0x7071,
775 ql_log(ql_log_info, vha, 0x7072,
777 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags);
778 qla2xxx_wake_dpc(vha);
779 qla2x00_wait_for_fcoe_ctx_reset(vha);
784 ql_log(ql_log_info, vha, 0x70bc,
786 qla83xx_idc_lock(vha, 0);
787 __qla83xx_get_idc_control(vha, &idc_control);
789 __qla83xx_set_idc_control(vha, idc_control);
790 qla83xx_idc_unlock(vha, 0);
795 ql_log(ql_log_info, vha, 0x70bd,
797 qla83xx_idc_lock(vha, 0);
798 __qla83xx_get_idc_control(vha, &idc_control);
800 __qla83xx_set_idc_control(vha, idc_control);
801 qla83xx_idc_unlock(vha, 0);
804 ql_dbg(ql_dbg_user, vha, 0x70e0,
809 ql_log(ql_log_warn, vha, 0x70e1,
813 ha->isp_ops->get_flash_version(vha, tmp_data);
834 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
842 if (unlikely(pci_channel_offline(vha->hw->pdev)))
845 if (qla2x00_chip_is_down(vha))
854 ql_log(ql_log_info, vha, 0xd04d, "portid=%02x%02x%02x done\n",
857 ql_log(ql_log_info, vha, 0x70e4, "%s: %d\n", __func__, type);
859 qla24xx_els_dcmd_iocb(vha, ELS_DCMD_LOGO, did);
877 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
879 struct qla_hw_data *ha = vha->hw;
888 mutex_lock(&vha->hw->optrom_mutex);
889 if (qla2x00_chip_is_down(vha)) {
890 mutex_unlock(&vha->hw->optrom_mutex);
900 mutex_unlock(&vha->hw->optrom_mutex);
901 ql_log(ql_log_warn, vha, 0x7076,
910 rval = qla2x00_get_xgmac_stats(vha, ha->xgmac_data_dma,
913 mutex_unlock(&vha->hw->optrom_mutex);
915 ql_log(ql_log_warn, vha, 0x7077,
940 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
942 struct qla_hw_data *ha = vha->hw;
950 mutex_lock(&vha->hw->optrom_mutex);
951 if (qla2x00_chip_is_down(vha)) {
952 mutex_unlock(&vha->hw->optrom_mutex);
959 mutex_unlock(&vha->hw->optrom_mutex);
960 ql_log(ql_log_warn, vha, 0x7078,
968 rval = qla2x00_get_dcbx_params(vha, ha->dcbx_tlv_dma,
971 mutex_unlock(&vha->hw->optrom_mutex);
974 ql_log(ql_log_warn, vha, 0x7079,
1012 qla2x00_alloc_sysfs_attr(scsi_qla_host_t *vha)
1014 struct Scsi_Host *host = vha->host;
1019 if (iter->type && !IS_FWI2_CAPABLE(vha->hw))
1021 if (iter->type == 2 && !IS_QLA25XX(vha->hw))
1023 if (iter->type == 3 && !(IS_CNA_CAPABLE(vha->hw)))
1029 ql_log(ql_log_warn, vha, 0x00f3,
1033 ql_dbg(ql_dbg_init, vha, 0x00f4,
1040 qla2x00_free_sysfs_attr(scsi_qla_host_t *vha, bool stop_beacon)
1042 struct Scsi_Host *host = vha->host;
1044 struct qla_hw_data *ha = vha->hw;
1059 ha->isp_ops->beacon_off(vha);
1075 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1076 struct qla_hw_data *ha = vha->hw;
1080 ha->isp_ops->fw_version_str(vha, fw_str, sizeof(fw_str)));
1087 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1088 struct qla_hw_data *ha = vha->hw;
1091 if (IS_QLAFX00(vha->hw)) {
1093 vha->hw->mr.serial_num);
1095 qla2xxx_get_vpd_field(vha, "SN", buf, PAGE_SIZE - 1);
1108 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1110 return scnprintf(buf, PAGE_SIZE, "ISP%04X\n", vha->hw->pdev->device);
1117 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1118 struct qla_hw_data *ha = vha->hw;
1120 if (IS_QLAFX00(vha->hw))
1122 vha->hw->mr.hw_version);
1133 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1135 return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_number);
1142 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1144 return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_desc);
1151 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1155 vha->hw->isp_ops->pci_info_str(vha, pci_info,
1163 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1164 struct qla_hw_data *ha = vha->hw;
1167 if (atomic_read(&vha->loop_state) == LOOP_DOWN ||
1168 atomic_read(&vha->loop_state) == LOOP_DEAD ||
1169 vha->device_flags & DFLG_NO_CABLE)
1171 else if (atomic_read(&vha->loop_state) != LOOP_READY ||
1172 qla2x00_chip_is_down(vha))
1203 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1206 switch (vha->hw->zio_mode) {
1221 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1222 struct qla_hw_data *ha = vha->hw;
1240 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
1249 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1251 return scnprintf(buf, PAGE_SIZE, "%d us\n", vha->hw->zio_timer * 100);
1258 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1268 vha->hw->zio_timer = zio_timer;
1277 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1280 vha->hw->last_zio_threshold);
1287 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1290 if (vha->hw->zio_mode != QLA_ZIO_MODE_6)
1297 atomic_set(&vha->hw->zio_threshold, val);
1305 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1308 if (vha->hw->beacon_blink_led)
1319 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1320 struct qla_hw_data *ha = vha->hw;
1330 mutex_lock(&vha->hw->optrom_mutex);
1331 if (qla2x00_chip_is_down(vha)) {
1332 mutex_unlock(&vha->hw->optrom_mutex);
1333 ql_log(ql_log_warn, vha, 0x707a,
1339 rval = ha->isp_ops->beacon_on(vha);
1341 rval = ha->isp_ops->beacon_off(vha);
1346 mutex_unlock(&vha->hw->optrom_mutex);
1355 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1356 struct qla_hw_data *ha = vha->hw;
1362 if (ql26xx_led_config(vha, 0, led))
1373 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1374 struct qla_hw_data *ha = vha->hw;
1418 if (ql26xx_led_config(vha, options, led))
1428 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1429 struct qla_hw_data *ha = vha->hw;
1439 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1440 struct qla_hw_data *ha = vha->hw;
1450 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1451 struct qla_hw_data *ha = vha->hw;
1461 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1462 struct qla_hw_data *ha = vha->hw;
1473 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1474 struct qla_hw_data *ha = vha->hw;
1489 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1492 vha->qla_stats.total_isp_aborts);
1501 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1502 struct qla_hw_data *ha = vha->hw;
1508 rval = qla84xx_verify_chip(vha, status);
1522 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1523 struct qla_hw_data *ha = vha->hw;
1537 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1538 struct qla_hw_data *ha = vha->hw;
1553 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1554 struct qla_hw_data *ha = vha->hw;
1567 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1568 struct qla_hw_data *ha = vha->hw;
1577 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1579 if (!IS_CNA_CAPABLE(vha->hw))
1582 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id);
1589 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1591 if (!IS_CNA_CAPABLE(vha->hw))
1594 return scnprintf(buf, PAGE_SIZE, "%pMR\n", vha->fcoe_vn_port_mac);
1601 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1603 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->hw->switch_cap);
1610 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1614 mutex_lock(&vha->hw->optrom_mutex);
1615 if (qla2x00_chip_is_down(vha)) {
1616 mutex_unlock(&vha->hw->optrom_mutex);
1617 ql_log(ql_log_warn, vha, 0x70dc, "ISP reset active.\n");
1621 if (vha->hw->flags.eeh_busy) {
1622 mutex_unlock(&vha->hw->optrom_mutex);
1623 ql_log(ql_log_warn, vha, 0x70dd, "PCI EEH busy.\n");
1627 rc = qla2x00_get_thermal_temp(vha, &temp);
1628 mutex_unlock(&vha->hw->optrom_mutex);
1640 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1645 if (IS_QLAFX00(vha->hw)) {
1650 mutex_lock(&vha->hw->optrom_mutex);
1651 if (qla2x00_chip_is_down(vha)) {
1652 mutex_unlock(&vha->hw->optrom_mutex);
1653 ql_log(ql_log_warn, vha, 0x707c,
1656 } else if (vha->hw->flags.eeh_busy) {
1657 mutex_unlock(&vha->hw->optrom_mutex);
1661 rval = qla2x00_get_firmware_state(vha, state);
1662 mutex_unlock(&vha->hw->optrom_mutex);
1666 rval = qla2x00_get_firmware_state(vha, state);
1677 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1679 if (!IS_BIDI_CAPABLE(vha->hw))
1682 return scnprintf(buf, PAGE_SIZE, "%llu\n", vha->bidi_stats.io_count);
1689 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1691 if (!IS_BIDI_CAPABLE(vha->hw))
1695 vha->bidi_stats.transfer_bytes >> 20);
1702 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1703 struct qla_hw_data *ha = vha->hw;
1720 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1722 if (!IS_P3P_TYPE(vha->hw))
1726 vha->hw->allow_cna_fw_dump ? "true" : "false");
1733 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1736 if (!IS_P3P_TYPE(vha->hw))
1742 vha->hw->allow_cna_fw_dump = val != 0;
1751 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1752 struct qla_hw_data *ha = vha->hw;
1765 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1766 struct qla_hw_data *ha = vha->hw;
1784 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1785 struct qla_hw_data *ha = vha->hw;
1800 struct scsi_qla_host *vha = shost_priv(dev_to_shost(dev));
1804 struct qla_hw_data *ha = vha->hw;
1807 ql_log(ql_log_warn, vha, 0x70d8,
1818 ql_dbg(ql_dbg_user, vha, 0x70d9,
1843 ql_log(ql_log_warn, vha, 0x1199,
1849 if (qla2x00_chip_is_down(vha) || (oldspeed == ha->set_data_rate))
1852 ql_log(ql_log_info, vha, 0x70da,
1855 rval = qla2x00_set_data_rate(vha, mode);
1878 struct scsi_qla_host *vha = shost_priv(dev_to_shost(dev));
1879 struct qla_hw_data *ha = vha->hw;
1884 rval = qla2x00_get_data_rate(vha);
1886 ql_log(ql_log_warn, vha, 0x70db,
1906 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1915 switch (vha->qlini_mode) {
1946 static void qla_set_ini_mode(scsi_qla_host_t *vha, int op)
1958 switch (vha->qlini_mode) {
1962 if (qla_tgt_mode_enabled(vha)) {
1963 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
1964 vha->hw->flags.exchoffld_enabled)
1966 if (((vha->ql2xexchoffld !=
1967 vha->u_ql2xexchoffld) &&
1968 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
1984 if (qla_tgt_mode_enabled(vha)) {
1985 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
1986 vha->hw->flags.exchoffld_enabled)
1988 if (((vha->ql2xexchoffld !=
1989 vha->u_ql2xexchoffld) &&
1990 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
2008 if (qla_tgt_mode_enabled(vha)) {
2017 if (qla_tgt_mode_enabled(vha))
2030 if (qla_tgt_mode_enabled(vha)) {
2031 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
2032 vha->hw->flags.exchoffld_enabled)
2034 if (((vha->ql2xexchoffld !=
2035 vha->u_ql2xexchoffld) &&
2036 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
2052 if (qla_tgt_mode_enabled(vha)) {
2053 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
2054 vha->hw->flags.exchoffld_enabled)
2056 if (((vha->ql2xexchoffld !=
2057 vha->u_ql2xexchoffld) &&
2058 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
2068 if (qla_tgt_mode_enabled(vha)) {
2076 if (qla_tgt_mode_enabled(vha))
2079 if (vha->hw->flags.fw_started)
2091 if (NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg) !=
2092 vha->hw->flags.exchoffld_enabled)
2094 if (((vha->ql2xiniexchg != vha->u_ql2xiniexchg) &&
2095 NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg)) ||
2114 if (qla_tgt_mode_enabled(vha) ||
2115 qla_dual_mode_enabled(vha)) {
2116 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld +
2117 vha->u_ql2xiniexchg) !=
2118 vha->hw->flags.exchoffld_enabled)
2121 if ((((vha->ql2xexchoffld +
2122 vha->ql2xiniexchg) !=
2123 (vha->u_ql2xiniexchg +
2124 vha->u_ql2xexchoffld)) &&
2125 NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg +
2126 vha->u_ql2xexchoffld)) || eo_toggle)
2131 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld +
2132 vha->u_ql2xiniexchg) !=
2133 vha->hw->flags.exchoffld_enabled)
2136 if ((((vha->ql2xexchoffld + vha->ql2xiniexchg)
2137 != (vha->u_ql2xiniexchg +
2138 vha->u_ql2xexchoffld)) &&
2139 NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg +
2140 vha->u_ql2xexchoffld)) || eo_toggle)
2148 if (qla_tgt_mode_enabled(vha) ||
2149 qla_dual_mode_enabled(vha)) {
2159 if (qla_tgt_mode_enabled(vha) ||
2160 qla_dual_mode_enabled(vha)) {
2169 if (qla_tgt_mode_enabled(vha) ||
2170 qla_dual_mode_enabled(vha)) {
2181 ql_log(ql_log_warn, vha, 0xffff,
2183 mode_to_str[vha->qlini_mode], mode_to_str[op],
2184 vha->ql2xexchoffld, vha->u_ql2xexchoffld,
2185 vha->ql2xiniexchg, vha->u_ql2xiniexchg);
2187 vha->qlini_mode = op;
2188 vha->ql2xexchoffld = vha->u_ql2xexchoffld;
2189 vha->ql2xiniexchg = vha->u_ql2xiniexchg;
2191 qlt_set_mode(vha);
2192 vha->flags.online = 1;
2193 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
2197 ql_log(ql_log_warn, vha, 0xffff,
2199 mode_to_str[vha->qlini_mode], mode_to_str[op],
2200 vha->ql2xexchoffld, vha->u_ql2xexchoffld,
2201 vha->ql2xiniexchg, vha->u_ql2xiniexchg);
2202 vha->qlini_mode = op;
2203 vha->ql2xexchoffld = vha->u_ql2xexchoffld;
2204 vha->ql2xiniexchg = vha->u_ql2xiniexchg;
2208 ql_log(ql_log_warn, vha, 0xffff,
2214 ql_log(ql_log_warn, vha, 0xffff,
2216 vha->qlini_mode, op,
2217 vha->ql2xexchoffld, vha->u_ql2xexchoffld);
2226 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2247 qla_set_ini_mode(vha, ini);
2255 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2260 vha->u_ql2xexchoffld, vha->ql2xexchoffld);
2264 vha->host_no);
2273 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2284 vha->u_ql2xexchoffld = val;
2292 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2297 vha->u_ql2xiniexchg, vha->ql2xiniexchg);
2301 vha->host_no);
2310 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2321 vha->u_ql2xiniexchg = val;
2329 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2330 struct qla_hw_data *ha = vha->hw;
2343 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2344 struct qla_hw_data *ha = vha->hw;
2360 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2362 return scnprintf(buf, PAGE_SIZE, "%u\n", vha->hw->port_no);
2369 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2371 if (!IS_QLA83XX(vha->hw) && !IS_QLA27XX(vha->hw) &&
2372 !IS_QLA28XX(vha->hw))
2375 if (!*vha->dport_data)
2379 vha->dport_data[0], vha->dport_data[1],
2380 vha->dport_data[2], vha->dport_data[3]);
2520 scsi_qla_host_t *vha = shost_priv(shost);
2522 fc_host_port_id(shost) = vha->d_id.b.domain << 16 |
2523 vha->d_id.b.area << 8 | vha->d_id.b.al_pa;
2529 scsi_qla_host_t *vha = shost_priv(shost);
2532 if (IS_QLAFX00(vha->hw)) {
2537 switch (vha->hw->link_data_rate) {
2573 scsi_qla_host_t *vha = shost_priv(shost);
2576 if (vha->vp_idx) {
2580 switch (vha->hw->current_topology) {
2605 scsi_qla_host_t *vha = shost_priv(host);
2609 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2624 scsi_qla_host_t *vha = shost_priv(host);
2628 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2643 scsi_qla_host_t *vha = shost_priv(host);
2647 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2688 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags))
2691 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) {
2692 qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16);
2701 scsi_qla_host_t *vha;
2706 if (test_bit(UNLOADING, &fcport->vha->dpc_flags))
2709 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags))
2711 vha = fcport->vha;
2713 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) {
2714 qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16);
2715 qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24,
2724 if (IS_FWI2_CAPABLE(fcport->vha->hw))
2725 fcport->vha->hw->isp_ops->fabric_logout(fcport->vha,
2729 qla2x00_port_logout(fcport->vha, fcport);
2733 if (qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24, 0, WAIT_TARGET)) {
2734 ql_log(ql_log_warn, vha, 0x300b,
2736 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
2737 qla2xxx_wake_dpc(vha);
2738 qla2x00_wait_for_chip_reset(vha);
2745 scsi_qla_host_t *vha = shost_priv(shost);
2747 if (IS_QLAFX00(vha->hw))
2750 qla2x00_loop_reset(vha);
2757 scsi_qla_host_t *vha = shost_priv(shost);
2758 struct qla_hw_data *ha = vha->hw;
2763 struct fc_host_statistics *p = &vha->fc_host_stat;
2770 if (IS_QLAFX00(vha->hw))
2773 if (test_bit(UNLOADING, &vha->dpc_flags))
2779 if (qla2x00_chip_is_down(vha))
2785 ql_log(ql_log_warn, vha, 0x707d,
2804 for (i = 0; i < vha->hw->max_qpairs; i++) {
2805 qpair = vha->hw->queue_pair_map[i];
2818 ir += vha->qla_stats.input_requests;
2819 or += vha->qla_stats.output_requests;
2820 ib += vha->qla_stats.input_bytes;
2821 ob += vha->qla_stats.output_bytes;
2848 p->fcp_control_requests = vha->qla_stats.control_requests;
2854 get_jiffies_64() - vha->qla_stats.jiffies_at_last_reset;
2867 scsi_qla_host_t *vha = shost_priv(shost);
2868 struct qla_hw_data *ha = vha->hw;
2875 memset(&vha->qla_stats, 0, sizeof(vha->qla_stats));
2876 memset(&vha->fc_host_stat, 0, sizeof(vha->fc_host_stat));
2877 for (i = 0; i < vha->hw->max_qpairs; i++) {
2878 qpair = vha->hw->queue_pair_map[i];
2885 vha->qla_stats.jiffies_at_last_reset = get_jiffies_64();
2893 ql_log(ql_log_warn, vha, 0x70d7,
2901 ql_log(ql_log_warn, vha, 0x70de,
2913 scsi_qla_host_t *vha = shost_priv(shost);
2915 qla2x00_get_sym_node_name(vha, fc_host_symbolic_name(shost),
2922 scsi_qla_host_t *vha = shost_priv(shost);
2924 set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags);
2930 scsi_qla_host_t *vha = shost_priv(shost);
2936 if (vha->device_flags & SWITCH_FOUND)
2937 fabric_name = wwn_to_u64(vha->fabric_node_name);
2945 scsi_qla_host_t *vha = shost_priv(shost);
2946 struct scsi_qla_host *base_vha = pci_get_drvdata(vha->hw->pdev);
2981 scsi_qla_host_t *vha = NULL;
2989 ql_log(ql_log_warn, vha, 0x707e,
2994 vha = qla24xx_create_vhost(fc_vport);
2995 if (vha == NULL) {
2996 ql_log(ql_log_warn, vha, 0x707f, "Vport create host failed.\n");
3000 atomic_set(&vha->vp_state, VP_OFFLINE);
3003 atomic_set(&vha->vp_state, VP_FAILED);
3006 ql_log(ql_log_info, vha, 0x7080,
3007 "VP entry id %d assigned.\n", vha->vp_idx);
3010 atomic_set(&vha->loop_state, LOOP_DOWN);
3011 vha->vp_err_state = VP_ERR_PORTDWN;
3012 vha->vp_prev_err_state = VP_ERR_UNKWN;
3017 ql_dbg(ql_dbg_user, vha, 0x7081,
3019 atomic_set(&vha->loop_state, LOOP_DEAD);
3028 vha->flags.difdix_supported = 1;
3029 ql_dbg(ql_dbg_user, vha, 0x7082,
3031 scsi_host_set_prot(vha->host,
3045 scsi_host_set_guard(vha->host, guard);
3047 vha->flags.difdix_supported = 0;
3050 if (scsi_add_host_with_dma(vha->host, &fc_vport->dev,
3052 ql_dbg(ql_dbg_user, vha, 0x7083,
3053 "scsi_add_host failure for VP[%d].\n", vha->vp_idx);
3058 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count;
3059 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name);
3060 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name);
3061 fc_host_supported_classes(vha->host) =
3063 fc_host_supported_speeds(vha->host) =
3066 qlt_vport_create(vha, ha);
3074 if (memcmp(ha->npiv_info[cnt].port_name, vha->port_name, 8) == 0
3075 && memcmp(ha->npiv_info[cnt].node_name, vha->node_name,
3083 qpair = qla2xxx_create_qpair(vha, qos, vha->vp_idx, true);
3085 ql_log(ql_log_warn, vha, 0x7084,
3087 vha->vp_idx);
3089 ql_dbg(ql_dbg_multiq, vha, 0xc001,
3091 qpair->id, qos, vha->vp_idx);
3092 ql_dbg(ql_dbg_user, vha, 0x7085,
3094 qpair->id, qos, vha->vp_idx);
3096 vha->qpair = qpair;
3101 vha->req = req;
3105 qla24xx_disable_vp(vha);
3106 qla24xx_deallocate_vp_id(vha);
3107 scsi_host_put(vha->host);
3114 scsi_qla_host_t *vha = fc_vport->dd_data;
3115 struct qla_hw_data *ha = vha->hw;
3116 uint16_t id = vha->vp_idx;
3118 set_bit(VPORT_DELETE, &vha->dpc_flags);
3120 while (test_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags) ||
3121 test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags))
3125 qla24xx_disable_vp(vha);
3126 qla2x00_wait_for_sess_deletion(vha);
3128 qla_nvme_delete(vha);
3129 vha->flags.delete_progress = 1;
3131 qlt_remove_target(ha, vha);
3133 fc_remove_host(vha->host);
3135 scsi_remove_host(vha->host);
3138 qla24xx_deallocate_vp_id(vha);
3140 if (vha->timer_active) {
3141 qla2x00_vp_stop_timer(vha);
3142 ql_dbg(ql_dbg_user, vha, 0x7086,
3143 "Timer for the VP[%d] has stopped\n", vha->vp_idx);
3146 qla2x00_free_fcports(vha);
3150 clear_bit(vha->vp_idx, ha->vp_idx_map);
3153 dma_free_coherent(&ha->pdev->dev, vha->gnl.size, vha->gnl.l,
3154 vha->gnl.ldma);
3156 vha->gnl.l = NULL;
3158 vfree(vha->scan.l);
3160 if (vha->qpair && vha->qpair->vp_idx == vha->vp_idx) {
3161 if (qla2xxx_delete_qpair(vha, vha->qpair) != QLA_SUCCESS)
3162 ql_log(ql_log_warn, vha, 0x7087,
3166 ql_log(ql_log_info, vha, 0x7088, "VP[%d] deleted.\n", id);
3167 scsi_host_put(vha->host);
3174 scsi_qla_host_t *vha = fc_vport->dd_data;
3177 qla24xx_disable_vp(vha);
3179 qla24xx_enable_vp(vha);
3277 qla2x00_get_host_supported_speeds(scsi_qla_host_t *vha, uint speeds)
3300 qla2x00_init_host_attr(scsi_qla_host_t *vha)
3302 struct qla_hw_data *ha = vha->hw;
3305 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count;
3306 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name);
3307 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name);
3308 fc_host_supported_classes(vha->host) = ha->base_qpair->enable_class_2 ?
3310 fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports;
3311 fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count;
3314 speeds = qla2x00_get_host_supported_speeds(vha, fdmi_speed);
3316 fc_host_supported_speeds(vha->host) = speeds;