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 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);
1081 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1082 struct qla_hw_data *ha = vha->hw;
1086 ha->isp_ops->fw_version_str(vha, fw_str, sizeof(fw_str)));
1093 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1094 struct qla_hw_data *ha = vha->hw;
1097 if (IS_QLAFX00(vha->hw)) {
1099 vha->hw->mr.serial_num);
1101 qla2xxx_get_vpd_field(vha, "SN", buf, PAGE_SIZE - 1);
1114 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1116 return scnprintf(buf, PAGE_SIZE, "ISP%04X\n", vha->hw->pdev->device);
1123 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1124 struct qla_hw_data *ha = vha->hw;
1126 if (IS_QLAFX00(vha->hw))
1128 vha->hw->mr.hw_version);
1139 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1141 return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_number);
1148 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1150 return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_desc);
1157 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1161 vha->hw->isp_ops->pci_info_str(vha, pci_info,
1169 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1170 struct qla_hw_data *ha = vha->hw;
1173 if (atomic_read(&vha->loop_state) == LOOP_DOWN ||
1174 atomic_read(&vha->loop_state) == LOOP_DEAD ||
1175 vha->device_flags & DFLG_NO_CABLE)
1177 else if (atomic_read(&vha->loop_state) != LOOP_READY ||
1178 qla2x00_chip_is_down(vha))
1209 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1212 switch (vha->hw->zio_mode) {
1227 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1228 struct qla_hw_data *ha = vha->hw;
1246 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
1255 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1257 return scnprintf(buf, PAGE_SIZE, "%d us\n", vha->hw->zio_timer * 100);
1264 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1274 vha->hw->zio_timer = zio_timer;
1283 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1286 vha->hw->last_zio_threshold);
1293 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1296 if (vha->hw->zio_mode != QLA_ZIO_MODE_6)
1303 atomic_set(&vha->hw->zio_threshold, val);
1311 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1314 if (vha->hw->beacon_blink_led)
1325 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1326 struct qla_hw_data *ha = vha->hw;
1336 mutex_lock(&vha->hw->optrom_mutex);
1337 if (qla2x00_chip_is_down(vha)) {
1338 mutex_unlock(&vha->hw->optrom_mutex);
1339 ql_log(ql_log_warn, vha, 0x707a,
1345 rval = ha->isp_ops->beacon_on(vha);
1347 rval = ha->isp_ops->beacon_off(vha);
1352 mutex_unlock(&vha->hw->optrom_mutex);
1361 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1362 struct qla_hw_data *ha = vha->hw;
1368 if (ql26xx_led_config(vha, 0, led))
1379 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1380 struct qla_hw_data *ha = vha->hw;
1424 if (ql26xx_led_config(vha, options, led))
1434 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1435 struct qla_hw_data *ha = vha->hw;
1445 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1446 struct qla_hw_data *ha = vha->hw;
1456 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1457 struct qla_hw_data *ha = vha->hw;
1467 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1468 struct qla_hw_data *ha = vha->hw;
1479 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1480 struct qla_hw_data *ha = vha->hw;
1495 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1498 vha->qla_stats.total_isp_aborts);
1507 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1508 struct qla_hw_data *ha = vha->hw;
1514 rval = qla84xx_verify_chip(vha, status);
1528 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1529 struct qla_hw_data *ha = vha->hw;
1543 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1544 struct qla_hw_data *ha = vha->hw;
1559 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1560 struct qla_hw_data *ha = vha->hw;
1573 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1574 struct qla_hw_data *ha = vha->hw;
1583 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1585 if (!IS_CNA_CAPABLE(vha->hw))
1588 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id);
1595 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1597 if (!IS_CNA_CAPABLE(vha->hw))
1600 return scnprintf(buf, PAGE_SIZE, "%pMR\n", vha->fcoe_vn_port_mac);
1607 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1609 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->hw->switch_cap);
1616 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1620 mutex_lock(&vha->hw->optrom_mutex);
1621 if (qla2x00_chip_is_down(vha)) {
1622 mutex_unlock(&vha->hw->optrom_mutex);
1623 ql_log(ql_log_warn, vha, 0x70dc, "ISP reset active.\n");
1627 if (vha->hw->flags.eeh_busy) {
1628 mutex_unlock(&vha->hw->optrom_mutex);
1629 ql_log(ql_log_warn, vha, 0x70dd, "PCI EEH busy.\n");
1633 rc = qla2x00_get_thermal_temp(vha, &temp);
1634 mutex_unlock(&vha->hw->optrom_mutex);
1646 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1651 if (IS_QLAFX00(vha->hw)) {
1656 mutex_lock(&vha->hw->optrom_mutex);
1657 if (qla2x00_chip_is_down(vha)) {
1658 mutex_unlock(&vha->hw->optrom_mutex);
1659 ql_log(ql_log_warn, vha, 0x707c,
1662 } else if (vha->hw->flags.eeh_busy) {
1663 mutex_unlock(&vha->hw->optrom_mutex);
1667 rval = qla2x00_get_firmware_state(vha, state);
1668 mutex_unlock(&vha->hw->optrom_mutex);
1672 rval = qla2x00_get_firmware_state(vha, state);
1683 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1685 if (!IS_BIDI_CAPABLE(vha->hw))
1688 return scnprintf(buf, PAGE_SIZE, "%llu\n", vha->bidi_stats.io_count);
1695 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1697 if (!IS_BIDI_CAPABLE(vha->hw))
1701 vha->bidi_stats.transfer_bytes >> 20);
1708 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1709 struct qla_hw_data *ha = vha->hw;
1726 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1728 if (!IS_P3P_TYPE(vha->hw))
1732 vha->hw->allow_cna_fw_dump ? "true" : "false");
1739 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1742 if (!IS_P3P_TYPE(vha->hw))
1748 vha->hw->allow_cna_fw_dump = val != 0;
1757 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1758 struct qla_hw_data *ha = vha->hw;
1771 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1772 struct qla_hw_data *ha = vha->hw;
1790 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1791 struct qla_hw_data *ha = vha->hw;
1806 struct scsi_qla_host *vha = shost_priv(dev_to_shost(dev));
1810 struct qla_hw_data *ha = vha->hw;
1813 ql_log(ql_log_warn, vha, 0x70d8,
1824 ql_dbg(ql_dbg_user, vha, 0x70d9,
1849 ql_log(ql_log_warn, vha, 0x1199,
1855 if (qla2x00_chip_is_down(vha) || (oldspeed == ha->set_data_rate))
1858 ql_log(ql_log_info, vha, 0x70da,
1861 rval = qla2x00_set_data_rate(vha, mode);
1884 struct scsi_qla_host *vha = shost_priv(dev_to_shost(dev));
1885 struct qla_hw_data *ha = vha->hw;
1890 rval = qla2x00_get_data_rate(vha);
1892 ql_log(ql_log_warn, vha, 0x70db,
1911 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1917 ql_log(ql_log_warn, vha, 0x7089, "Pausing MPI...\n");
1919 rval = qla83xx_wr_reg(vha, 0x002012d4, 0x30000001);
1922 ql_log(ql_log_warn, vha, 0x708a, "Unable to pause MPI.\n");
1936 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1945 switch (vha->qlini_mode) {
1976 static void qla_set_ini_mode(scsi_qla_host_t *vha, int op)
1988 switch (vha->qlini_mode) {
1992 if (qla_tgt_mode_enabled(vha)) {
1993 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
1994 vha->hw->flags.exchoffld_enabled)
1996 if (((vha->ql2xexchoffld !=
1997 vha->u_ql2xexchoffld) &&
1998 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
2014 if (qla_tgt_mode_enabled(vha)) {
2015 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
2016 vha->hw->flags.exchoffld_enabled)
2018 if (((vha->ql2xexchoffld !=
2019 vha->u_ql2xexchoffld) &&
2020 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
2038 if (qla_tgt_mode_enabled(vha)) {
2047 if (qla_tgt_mode_enabled(vha))
2060 if (qla_tgt_mode_enabled(vha)) {
2061 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
2062 vha->hw->flags.exchoffld_enabled)
2064 if (((vha->ql2xexchoffld !=
2065 vha->u_ql2xexchoffld) &&
2066 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
2082 if (qla_tgt_mode_enabled(vha)) {
2083 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld) !=
2084 vha->hw->flags.exchoffld_enabled)
2086 if (((vha->ql2xexchoffld !=
2087 vha->u_ql2xexchoffld) &&
2088 NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld)) ||
2098 if (qla_tgt_mode_enabled(vha)) {
2106 if (qla_tgt_mode_enabled(vha))
2109 if (vha->hw->flags.fw_started)
2121 if (NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg) !=
2122 vha->hw->flags.exchoffld_enabled)
2124 if (((vha->ql2xiniexchg != vha->u_ql2xiniexchg) &&
2125 NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg)) ||
2144 if (qla_tgt_mode_enabled(vha) ||
2145 qla_dual_mode_enabled(vha)) {
2146 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld +
2147 vha->u_ql2xiniexchg) !=
2148 vha->hw->flags.exchoffld_enabled)
2151 if ((((vha->ql2xexchoffld +
2152 vha->ql2xiniexchg) !=
2153 (vha->u_ql2xiniexchg +
2154 vha->u_ql2xexchoffld)) &&
2155 NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg +
2156 vha->u_ql2xexchoffld)) || eo_toggle)
2161 if (NEED_EXCH_OFFLOAD(vha->u_ql2xexchoffld +
2162 vha->u_ql2xiniexchg) !=
2163 vha->hw->flags.exchoffld_enabled)
2166 if ((((vha->ql2xexchoffld + vha->ql2xiniexchg)
2167 != (vha->u_ql2xiniexchg +
2168 vha->u_ql2xexchoffld)) &&
2169 NEED_EXCH_OFFLOAD(vha->u_ql2xiniexchg +
2170 vha->u_ql2xexchoffld)) || eo_toggle)
2178 if (qla_tgt_mode_enabled(vha) ||
2179 qla_dual_mode_enabled(vha)) {
2189 if (qla_tgt_mode_enabled(vha) ||
2190 qla_dual_mode_enabled(vha)) {
2199 if (qla_tgt_mode_enabled(vha) ||
2200 qla_dual_mode_enabled(vha)) {
2211 ql_log(ql_log_warn, vha, 0xffff,
2213 mode_to_str[vha->qlini_mode], mode_to_str[op],
2214 vha->ql2xexchoffld, vha->u_ql2xexchoffld,
2215 vha->ql2xiniexchg, vha->u_ql2xiniexchg);
2217 vha->qlini_mode = op;
2218 vha->ql2xexchoffld = vha->u_ql2xexchoffld;
2219 vha->ql2xiniexchg = vha->u_ql2xiniexchg;
2221 qlt_set_mode(vha);
2222 vha->flags.online = 1;
2223 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
2227 ql_log(ql_log_warn, vha, 0xffff,
2229 mode_to_str[vha->qlini_mode], mode_to_str[op],
2230 vha->ql2xexchoffld, vha->u_ql2xexchoffld,
2231 vha->ql2xiniexchg, vha->u_ql2xiniexchg);
2232 vha->qlini_mode = op;
2233 vha->ql2xexchoffld = vha->u_ql2xexchoffld;
2234 vha->ql2xiniexchg = vha->u_ql2xiniexchg;
2238 ql_log(ql_log_warn, vha, 0xffff,
2244 ql_log(ql_log_warn, vha, 0xffff,
2246 vha->qlini_mode, op,
2247 vha->ql2xexchoffld, vha->u_ql2xexchoffld);
2256 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2277 qla_set_ini_mode(vha, ini);
2285 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2290 vha->u_ql2xexchoffld, vha->ql2xexchoffld);
2294 vha->host_no);
2303 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2314 vha->u_ql2xexchoffld = val;
2322 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2327 vha->u_ql2xiniexchg, vha->ql2xiniexchg);
2331 vha->host_no);
2340 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2351 vha->u_ql2xiniexchg = val;
2359 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2360 struct qla_hw_data *ha = vha->hw;
2373 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2374 struct qla_hw_data *ha = vha->hw;
2390 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2392 return scnprintf(buf, PAGE_SIZE, "%u\n", vha->hw->port_no);
2399 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
2401 if (!IS_QLA83XX(vha->hw) && !IS_QLA27XX(vha->hw) &&
2402 !IS_QLA28XX(vha->hw))
2405 if (!*vha->dport_data)
2409 vha->dport_data[0], vha->dport_data[1],
2410 vha->dport_data[2], vha->dport_data[3]);
2556 scsi_qla_host_t *vha = shost_priv(shost);
2558 fc_host_port_id(shost) = vha->d_id.b.domain << 16 |
2559 vha->d_id.b.area << 8 | vha->d_id.b.al_pa;
2565 scsi_qla_host_t *vha = shost_priv(shost);
2568 if (IS_QLAFX00(vha->hw)) {
2573 switch (vha->hw->link_data_rate) {
2609 scsi_qla_host_t *vha = shost_priv(shost);
2612 if (vha->vp_idx) {
2616 switch (vha->hw->current_topology) {
2641 scsi_qla_host_t *vha = shost_priv(host);
2645 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2660 scsi_qla_host_t *vha = shost_priv(host);
2664 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2679 scsi_qla_host_t *vha = shost_priv(host);
2683 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2717 ql_dbg(ql_dbg_async, fcport->vha, 0x5101,
2740 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags))
2743 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) {
2744 qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16);
2753 scsi_qla_host_t *vha;
2758 if (test_bit(UNLOADING, &fcport->vha->dpc_flags))
2761 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags))
2763 vha = fcport->vha;
2765 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) {
2766 qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16);
2767 qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24,
2778 if (IS_FWI2_CAPABLE(fcport->vha->hw) &&
2784 ql_dbg(ql_dbg_disc, fcport->vha, 0x911e,
2789 } else if (!IS_FWI2_CAPABLE(fcport->vha->hw)) {
2790 qla2x00_port_logout(fcport->vha, fcport);
2795 if (qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24, 0, WAIT_TARGET)) {
2796 ql_log(ql_log_warn, vha, 0x300b,
2798 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
2799 qla2xxx_wake_dpc(vha);
2800 qla2x00_wait_for_chip_reset(vha);
2807 scsi_qla_host_t *vha = shost_priv(shost);
2809 if (IS_QLAFX00(vha->hw))
2812 if (vha->hw->flags.port_isolated)
2815 qla2x00_loop_reset(vha);
2822 scsi_qla_host_t *vha = shost_priv(shost);
2823 struct qla_hw_data *ha = vha->hw;
2828 struct fc_host_statistics *p = &vha->fc_host_stat;
2835 if (IS_QLAFX00(vha->hw))
2838 if (test_bit(UNLOADING, &vha->dpc_flags))
2844 if (qla2x00_chip_is_down(vha))
2850 ql_log(ql_log_warn, vha, 0x707d,
2869 for (i = 0; i < vha->hw->max_qpairs; i++) {
2870 qpair = vha->hw->queue_pair_map[i];
2883 ir += vha->qla_stats.input_requests;
2884 or += vha->qla_stats.output_requests;
2885 ib += vha->qla_stats.input_bytes;
2886 ob += vha->qla_stats.output_bytes;
2913 p->fcp_control_requests = vha->qla_stats.control_requests;
2919 get_jiffies_64() - vha->qla_stats.jiffies_at_last_reset;
2932 scsi_qla_host_t *vha = shost_priv(shost);
2933 struct qla_hw_data *ha = vha->hw;
2940 memset(&vha->qla_stats, 0, sizeof(vha->qla_stats));
2941 memset(&vha->fc_host_stat, 0, sizeof(vha->fc_host_stat));
2942 for (i = 0; i < vha->hw->max_qpairs; i++) {
2943 qpair = vha->hw->queue_pair_map[i];
2950 vha->qla_stats.jiffies_at_last_reset = get_jiffies_64();
2958 ql_log(ql_log_warn, vha, 0x70d7,
2966 ql_log(ql_log_warn, vha, 0x70de,
2978 scsi_qla_host_t *vha = shost_priv(shost);
2980 qla2x00_get_sym_node_name(vha, fc_host_symbolic_name(shost),
2987 scsi_qla_host_t *vha = shost_priv(shost);
2989 set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags);
2995 scsi_qla_host_t *vha = shost_priv(shost);
3001 if (vha->device_flags & SWITCH_FOUND)
3002 fabric_name = wwn_to_u64(vha->fabric_node_name);
3010 scsi_qla_host_t *vha = shost_priv(shost);
3011 struct scsi_qla_host *base_vha = pci_get_drvdata(vha->hw->pdev);
3046 scsi_qla_host_t *vha = NULL;
3054 ql_log(ql_log_warn, vha, 0x707e,
3059 vha = qla24xx_create_vhost(fc_vport);
3060 if (vha == NULL) {
3061 ql_log(ql_log_warn, vha, 0x707f, "Vport create host failed.\n");
3065 atomic_set(&vha->vp_state, VP_OFFLINE);
3068 atomic_set(&vha->vp_state, VP_FAILED);
3071 ql_log(ql_log_info, vha, 0x7080,
3072 "VP entry id %d assigned.\n", vha->vp_idx);
3075 atomic_set(&vha->loop_state, LOOP_DOWN);
3076 vha->vp_err_state = VP_ERR_PORTDWN;
3077 vha->vp_prev_err_state = VP_ERR_UNKWN;
3082 ql_dbg(ql_dbg_user, vha, 0x7081,
3084 atomic_set(&vha->loop_state, LOOP_DEAD);
3093 vha->flags.difdix_supported = 1;
3094 ql_dbg(ql_dbg_user, vha, 0x7082,
3096 scsi_host_set_prot(vha->host,
3110 scsi_host_set_guard(vha->host, guard);
3112 vha->flags.difdix_supported = 0;
3115 if (scsi_add_host_with_dma(vha->host, &fc_vport->dev,
3117 ql_dbg(ql_dbg_user, vha, 0x7083,
3118 "scsi_add_host failure for VP[%d].\n", vha->vp_idx);
3123 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count;
3124 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name);
3125 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name);
3126 fc_host_supported_classes(vha->host) =
3128 fc_host_supported_speeds(vha->host) =
3131 qlt_vport_create(vha, ha);
3139 if (memcmp(ha->npiv_info[cnt].port_name, vha->port_name, 8) == 0
3140 && memcmp(ha->npiv_info[cnt].node_name, vha->node_name,
3148 qpair = qla2xxx_create_qpair(vha, qos, vha->vp_idx, true);
3150 ql_log(ql_log_warn, vha, 0x7084,
3152 vha->vp_idx);
3154 ql_dbg(ql_dbg_multiq, vha, 0xc001,
3156 qpair->id, qos, vha->vp_idx);
3157 ql_dbg(ql_dbg_user, vha, 0x7085,
3159 qpair->id, qos, vha->vp_idx);
3161 vha->qpair = qpair;
3166 vha->req = req;
3170 qla24xx_disable_vp(vha);
3171 qla24xx_deallocate_vp_id(vha);
3172 scsi_host_put(vha->host);
3179 scsi_qla_host_t *vha = fc_vport->dd_data;
3180 struct qla_hw_data *ha = vha->hw;
3181 uint16_t id = vha->vp_idx;
3183 set_bit(VPORT_DELETE, &vha->dpc_flags);
3185 while (test_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags))
3189 qla24xx_disable_vp(vha);
3190 qla2x00_wait_for_sess_deletion(vha);
3192 qla_nvme_delete(vha);
3193 qla_enode_stop(vha);
3194 qla_edb_stop(vha);
3196 vha->flags.delete_progress = 1;
3198 qlt_remove_target(ha, vha);
3200 fc_remove_host(vha->host);
3202 scsi_remove_host(vha->host);
3205 qla24xx_deallocate_vp_id(vha);
3207 if (vha->timer_active) {
3208 qla2x00_vp_stop_timer(vha);
3209 ql_dbg(ql_dbg_user, vha, 0x7086,
3210 "Timer for the VP[%d] has stopped\n", vha->vp_idx);
3213 qla2x00_free_fcports(vha);
3217 clear_bit(vha->vp_idx, ha->vp_idx_map);
3220 dma_free_coherent(&ha->pdev->dev, vha->gnl.size, vha->gnl.l,
3221 vha->gnl.ldma);
3223 vha->gnl.l = NULL;
3225 vfree(vha->scan.l);
3227 if (vha->qpair && vha->qpair->vp_idx == vha->vp_idx) {
3228 if (qla2xxx_delete_qpair(vha, vha->qpair) != QLA_SUCCESS)
3229 ql_log(ql_log_warn, vha, 0x7087,
3233 ql_log(ql_log_info, vha, 0x7088, "VP[%d] deleted.\n", id);
3234 scsi_host_put(vha->host);
3241 scsi_qla_host_t *vha = fc_vport->dd_data;
3244 qla24xx_disable_vp(vha);
3246 qla24xx_enable_vp(vha);
3344 qla2x00_get_host_supported_speeds(scsi_qla_host_t *vha, uint speeds)
3367 qla2x00_init_host_attr(scsi_qla_host_t *vha)
3369 struct qla_hw_data *ha = vha->hw;
3372 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count;
3373 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name);
3374 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name);
3375 fc_host_supported_classes(vha->host) = ha->base_qpair->enable_class_2 ?
3377 fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports;
3378 fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count;
3381 speeds = qla2x00_get_host_supported_speeds(vha, fdmi_speed);
3383 fc_host_supported_speeds(vha->host) = speeds;