Lines Matching refs:vha
24 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_fw_dump() local
26 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_fw_dump()
57 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_fw_dump() local
59 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_fw_dump()
71 ql_log(ql_log_info, vha, 0x705d, in qla2x00_sysfs_write_fw_dump()
72 "Firmware dump cleared on (%ld).\n", vha->host_no); in qla2x00_sysfs_write_fw_dump()
75 qla82xx_md_free(vha); in qla2x00_sysfs_write_fw_dump()
76 qla82xx_md_prep(vha); in qla2x00_sysfs_write_fw_dump()
85 ql_log(ql_log_info, vha, 0x705e, in qla2x00_sysfs_write_fw_dump()
87 vha->host_no); in qla2x00_sysfs_write_fw_dump()
91 qla2x00_alloc_fw_dump(vha); in qla2x00_sysfs_write_fw_dump()
96 qla82xx_set_reset_owner(vha); in qla2x00_sysfs_write_fw_dump()
100 qla82xx_set_reset_owner(vha); in qla2x00_sysfs_write_fw_dump()
103 qla2x00_system_error(vha); in qla2x00_sysfs_write_fw_dump()
108 ql_dbg(ql_dbg_user, vha, 0x705b, in qla2x00_sysfs_write_fw_dump()
111 ql_dbg(ql_dbg_user, vha, 0x709d, in qla2x00_sysfs_write_fw_dump()
117 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_sysfs_write_fw_dump()
122 ql_log(ql_log_info, vha, 0x70c1, in qla2x00_sysfs_write_fw_dump()
123 "MCTP dump cleared on (%ld).\n", vha->host_no); in qla2x00_sysfs_write_fw_dump()
130 ql_log(ql_log_info, vha, 0x70c2, in qla2x00_sysfs_write_fw_dump()
132 vha->host_no); in qla2x00_sysfs_write_fw_dump()
154 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_nvram() local
156 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_nvram()
162 ha->isp_ops->read_optrom(vha, ha->nvram, ha->flt_region_nvram << 2, in qla2x00_sysfs_read_nvram()
173 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_nvram() local
175 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_nvram()
205 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2x00_sysfs_write_nvram()
206 ql_log(ql_log_warn, vha, 0x705f, in qla2x00_sysfs_write_nvram()
212 ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->nvram_base, count); in qla2x00_sysfs_write_nvram()
213 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->nvram, ha->nvram_base, in qla2x00_sysfs_write_nvram()
216 ql_dbg(ql_dbg_user, vha, 0x7060, in qla2x00_sysfs_write_nvram()
219 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_sysfs_write_nvram()
220 qla2xxx_wake_dpc(vha); in qla2x00_sysfs_write_nvram()
221 qla2x00_wait_for_chip_reset(vha); in qla2x00_sysfs_write_nvram()
241 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_optrom() local
243 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_optrom()
265 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_optrom() local
267 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom()
303 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_optrom_ctl() local
305 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom_ctl()
334 ql_dbg(ql_dbg_user, vha, 0x7061, in qla2x00_sysfs_write_optrom_ctl()
353 ql_log(ql_log_warn, vha, 0x7062, in qla2x00_sysfs_write_optrom_ctl()
362 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2x00_sysfs_write_optrom_ctl()
363 ql_log(ql_log_warn, vha, 0x7063, in qla2x00_sysfs_write_optrom_ctl()
369 ql_dbg(ql_dbg_user, vha, 0x7064, in qla2x00_sysfs_write_optrom_ctl()
374 ha->isp_ops->read_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
414 ql_log(ql_log_warn, vha, 0x7065, in qla2x00_sysfs_write_optrom_ctl()
426 ql_log(ql_log_warn, vha, 0x7066, in qla2x00_sysfs_write_optrom_ctl()
435 ql_dbg(ql_dbg_user, vha, 0x7067, in qla2x00_sysfs_write_optrom_ctl()
447 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2x00_sysfs_write_optrom_ctl()
448 ql_log(ql_log_warn, vha, 0x7068, in qla2x00_sysfs_write_optrom_ctl()
454 ql_dbg(ql_dbg_user, vha, 0x7069, in qla2x00_sysfs_write_optrom_ctl()
458 ha->isp_ops->write_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
484 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_vpd() local
486 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_vpd()
499 qla27xx_find_valid_image(vha) == QLA27XX_SECONDARY_IMAGE) in qla2x00_sysfs_read_vpd()
502 ha->isp_ops->read_optrom(vha, ha->vpd, faddr, in qla2x00_sysfs_read_vpd()
513 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_vpd() local
515 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_vpd()
521 if (qla2x00_chip_is_down(vha)) in qla2x00_sysfs_write_vpd()
528 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2x00_sysfs_write_vpd()
529 ql_log(ql_log_warn, vha, 0x706a, in qla2x00_sysfs_write_vpd()
535 ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->vpd_base, count); in qla2x00_sysfs_write_vpd()
536 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->vpd, ha->vpd_base, count); in qla2x00_sysfs_write_vpd()
544 ql_log(ql_log_warn, vha, 0x706b, in qla2x00_sysfs_write_vpd()
548 ha->isp_ops->get_flash_version(vha, tmp_data); in qla2x00_sysfs_write_vpd()
569 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_sfp() local
576 if (qla2x00_chip_is_down(vha)) in qla2x00_sysfs_read_sfp()
579 rval = qla2x00_read_sfp_dev(vha, buf, count); in qla2x00_sysfs_read_sfp()
600 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_reset() local
602 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_reset()
613 ql_log(ql_log_info, vha, 0x706e, in qla2x00_sysfs_write_reset()
616 scsi_block_requests(vha->host); in qla2x00_sysfs_write_reset()
620 qla82xx_set_reset_owner(vha); in qla2x00_sysfs_write_reset()
628 qla82xx_set_reset_owner(vha); in qla2x00_sysfs_write_reset()
631 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_sysfs_write_reset()
632 qla2xxx_wake_dpc(vha); in qla2x00_sysfs_write_reset()
634 qla2x00_wait_for_chip_reset(vha); in qla2x00_sysfs_write_reset()
635 scsi_unblock_requests(vha->host); in qla2x00_sysfs_write_reset()
641 ql_log(ql_log_info, vha, 0x706f, in qla2x00_sysfs_write_reset()
647 qla83xx_idc_lock(vha, 0); in qla2x00_sysfs_write_reset()
648 __qla83xx_get_idc_control(vha, &idc_control); in qla2x00_sysfs_write_reset()
650 __qla83xx_set_idc_control(vha, idc_control); in qla2x00_sysfs_write_reset()
651 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, in qla2x00_sysfs_write_reset()
653 qla83xx_idc_audit(vha, IDC_AUDIT_TIMESTAMP); in qla2x00_sysfs_write_reset()
654 qla83xx_idc_unlock(vha, 0); in qla2x00_sysfs_write_reset()
658 qla2x00_wait_for_hba_online(vha); in qla2x00_sysfs_write_reset()
661 scsi_block_requests(vha->host); in qla2x00_sysfs_write_reset()
662 if (qla81xx_restart_mpi_firmware(vha) != QLA_SUCCESS) in qla2x00_sysfs_write_reset()
663 ql_log(ql_log_warn, vha, 0x7070, in qla2x00_sysfs_write_reset()
665 scsi_unblock_requests(vha->host); in qla2x00_sysfs_write_reset()
669 if (!IS_P3P_TYPE(ha) || vha != base_vha) { in qla2x00_sysfs_write_reset()
670 ql_log(ql_log_info, vha, 0x7071, in qla2x00_sysfs_write_reset()
675 ql_log(ql_log_info, vha, 0x7072, in qla2x00_sysfs_write_reset()
677 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags); in qla2x00_sysfs_write_reset()
678 qla2xxx_wake_dpc(vha); in qla2x00_sysfs_write_reset()
679 qla2x00_wait_for_fcoe_ctx_reset(vha); in qla2x00_sysfs_write_reset()
684 ql_log(ql_log_info, vha, 0x70bc, in qla2x00_sysfs_write_reset()
686 qla83xx_idc_lock(vha, 0); in qla2x00_sysfs_write_reset()
687 __qla83xx_get_idc_control(vha, &idc_control); in qla2x00_sysfs_write_reset()
689 __qla83xx_set_idc_control(vha, idc_control); in qla2x00_sysfs_write_reset()
690 qla83xx_idc_unlock(vha, 0); in qla2x00_sysfs_write_reset()
695 ql_log(ql_log_info, vha, 0x70bd, in qla2x00_sysfs_write_reset()
697 qla83xx_idc_lock(vha, 0); in qla2x00_sysfs_write_reset()
698 __qla83xx_get_idc_control(vha, &idc_control); in qla2x00_sysfs_write_reset()
700 __qla83xx_set_idc_control(vha, idc_control); in qla2x00_sysfs_write_reset()
701 qla83xx_idc_unlock(vha, 0); in qla2x00_sysfs_write_reset()
704 ql_dbg(ql_dbg_user, vha, 0x70e0, in qla2x00_sysfs_write_reset()
709 ql_log(ql_log_warn, vha, 0x70e1, in qla2x00_sysfs_write_reset()
713 ha->isp_ops->get_flash_version(vha, tmp_data); in qla2x00_sysfs_write_reset()
734 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_issue_logo() local
742 if (unlikely(pci_channel_offline(vha->hw->pdev))) in qla2x00_issue_logo()
745 if (qla2x00_chip_is_down(vha)) in qla2x00_issue_logo()
754 ql_log(ql_log_info, vha, 0xd04d, "portid=%02x%02x%02x done\n", in qla2x00_issue_logo()
757 ql_log(ql_log_info, vha, 0x70e4, "%s: %d\n", __func__, type); in qla2x00_issue_logo()
759 qla24xx_els_dcmd_iocb(vha, ELS_DCMD_LOGO, did); in qla2x00_issue_logo()
777 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_xgmac_stats() local
779 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_xgmac_stats()
789 if (qla2x00_chip_is_down(vha)) in qla2x00_sysfs_read_xgmac_stats()
798 ql_log(ql_log_warn, vha, 0x7076, in qla2x00_sysfs_read_xgmac_stats()
807 rval = qla2x00_get_xgmac_stats(vha, ha->xgmac_data_dma, in qla2x00_sysfs_read_xgmac_stats()
810 ql_log(ql_log_warn, vha, 0x7077, in qla2x00_sysfs_read_xgmac_stats()
835 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_dcbx_tlv() local
837 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_dcbx_tlv()
846 if (qla2x00_chip_is_down(vha)) in qla2x00_sysfs_read_dcbx_tlv()
852 ql_log(ql_log_warn, vha, 0x7078, in qla2x00_sysfs_read_dcbx_tlv()
860 rval = qla2x00_get_dcbx_params(vha, ha->dcbx_tlv_dma, in qla2x00_sysfs_read_dcbx_tlv()
863 ql_log(ql_log_warn, vha, 0x7079, in qla2x00_sysfs_read_dcbx_tlv()
901 qla2x00_alloc_sysfs_attr(scsi_qla_host_t *vha) in qla2x00_alloc_sysfs_attr() argument
903 struct Scsi_Host *host = vha->host; in qla2x00_alloc_sysfs_attr()
908 if (iter->is4GBp_only && !IS_FWI2_CAPABLE(vha->hw)) in qla2x00_alloc_sysfs_attr()
910 if (iter->is4GBp_only == 2 && !IS_QLA25XX(vha->hw)) in qla2x00_alloc_sysfs_attr()
912 if (iter->is4GBp_only == 3 && !(IS_CNA_CAPABLE(vha->hw))) in qla2x00_alloc_sysfs_attr()
918 ql_log(ql_log_warn, vha, 0x00f3, in qla2x00_alloc_sysfs_attr()
922 ql_dbg(ql_dbg_init, vha, 0x00f4, in qla2x00_alloc_sysfs_attr()
929 qla2x00_free_sysfs_attr(scsi_qla_host_t *vha, bool stop_beacon) in qla2x00_free_sysfs_attr() argument
931 struct Scsi_Host *host = vha->host; in qla2x00_free_sysfs_attr()
933 struct qla_hw_data *ha = vha->hw; in qla2x00_free_sysfs_attr()
940 if (iter->is4GBp_only == 3 && !(IS_CNA_CAPABLE(vha->hw))) in qla2x00_free_sysfs_attr()
942 if (iter->is4GBp_only == 0x27 && !IS_QLA27XX(vha->hw)) in qla2x00_free_sysfs_attr()
950 ha->isp_ops->beacon_off(vha); in qla2x00_free_sysfs_attr()
966 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fw_version_show() local
967 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_version_show()
971 ha->isp_ops->fw_version_str(vha, fw_str, sizeof(fw_str))); in qla2x00_fw_version_show()
978 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_serial_num_show() local
979 struct qla_hw_data *ha = vha->hw; in qla2x00_serial_num_show()
982 if (IS_QLAFX00(vha->hw)) { in qla2x00_serial_num_show()
984 vha->hw->mr.serial_num); in qla2x00_serial_num_show()
986 qla2xxx_get_vpd_field(vha, "SN", buf, PAGE_SIZE - 1); in qla2x00_serial_num_show()
999 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_isp_name_show() local
1000 return scnprintf(buf, PAGE_SIZE, "ISP%04X\n", vha->hw->pdev->device); in qla2x00_isp_name_show()
1007 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_isp_id_show() local
1008 struct qla_hw_data *ha = vha->hw; in qla2x00_isp_id_show()
1010 if (IS_QLAFX00(vha->hw)) in qla2x00_isp_id_show()
1012 vha->hw->mr.hw_version); in qla2x00_isp_id_show()
1023 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_model_name_show() local
1025 return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_number); in qla2x00_model_name_show()
1032 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_model_desc_show() local
1033 return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_desc); in qla2x00_model_desc_show()
1040 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_pci_info_show() local
1044 vha->hw->isp_ops->pci_info_str(vha, pci_info)); in qla2x00_pci_info_show()
1051 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_link_state_show() local
1052 struct qla_hw_data *ha = vha->hw; in qla2x00_link_state_show()
1055 if (atomic_read(&vha->loop_state) == LOOP_DOWN || in qla2x00_link_state_show()
1056 atomic_read(&vha->loop_state) == LOOP_DEAD || in qla2x00_link_state_show()
1057 vha->device_flags & DFLG_NO_CABLE) in qla2x00_link_state_show()
1059 else if (atomic_read(&vha->loop_state) != LOOP_READY || in qla2x00_link_state_show()
1060 qla2x00_chip_is_down(vha)) in qla2x00_link_state_show()
1091 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_show() local
1094 switch (vha->hw->zio_mode) { in qla2x00_zio_show()
1109 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_store() local
1110 struct qla_hw_data *ha = vha->hw; in qla2x00_zio_store()
1128 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_zio_store()
1137 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_timer_show() local
1139 return scnprintf(buf, PAGE_SIZE, "%d us\n", vha->hw->zio_timer * 100); in qla2x00_zio_timer_show()
1146 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_timer_store() local
1156 vha->hw->zio_timer = zio_timer; in qla2x00_zio_timer_store()
1165 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_beacon_show() local
1168 if (vha->hw->beacon_blink_led) in qla2x00_beacon_show()
1179 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_beacon_store() local
1180 struct qla_hw_data *ha = vha->hw; in qla2x00_beacon_store()
1187 if (qla2x00_chip_is_down(vha)) { in qla2x00_beacon_store()
1188 ql_log(ql_log_warn, vha, 0x707a, in qla2x00_beacon_store()
1197 rval = ha->isp_ops->beacon_on(vha); in qla2x00_beacon_store()
1199 rval = ha->isp_ops->beacon_off(vha); in qla2x00_beacon_store()
1211 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_bios_version_show() local
1212 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_bios_version_show()
1221 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_efi_version_show() local
1222 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_efi_version_show()
1231 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_fcode_version_show() local
1232 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fcode_version_show()
1241 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_fw_version_show() local
1242 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fw_version_show()
1252 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_gold_fw_version_show() local
1253 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_gold_fw_version_show()
1267 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_total_isp_aborts_show() local
1269 vha->qla_stats.total_isp_aborts); in qla2x00_total_isp_aborts_show()
1278 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla24xx_84xx_fw_version_show() local
1279 struct qla_hw_data *ha = vha->hw; in qla24xx_84xx_fw_version_show()
1285 rval = qla84xx_verify_chip(vha, status); in qla24xx_84xx_fw_version_show()
1298 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_mpi_version_show() local
1299 struct qla_hw_data *ha = vha->hw; in qla2x00_mpi_version_show()
1314 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_phy_version_show() local
1315 struct qla_hw_data *ha = vha->hw; in qla2x00_phy_version_show()
1328 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_flash_block_size_show() local
1329 struct qla_hw_data *ha = vha->hw; in qla2x00_flash_block_size_show()
1338 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_vlan_id_show() local
1340 if (!IS_CNA_CAPABLE(vha->hw)) in qla2x00_vlan_id_show()
1343 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id); in qla2x00_vlan_id_show()
1350 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_vn_port_mac_address_show() local
1352 if (!IS_CNA_CAPABLE(vha->hw)) in qla2x00_vn_port_mac_address_show()
1355 return scnprintf(buf, PAGE_SIZE, "%pMR\n", vha->fcoe_vn_port_mac); in qla2x00_vn_port_mac_address_show()
1362 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fabric_param_show() local
1364 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->hw->switch_cap); in qla2x00_fabric_param_show()
1371 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_thermal_temp_show() local
1374 if (qla2x00_chip_is_down(vha)) { in qla2x00_thermal_temp_show()
1375 ql_log(ql_log_warn, vha, 0x70dc, "ISP reset active.\n"); in qla2x00_thermal_temp_show()
1379 if (vha->hw->flags.eeh_busy) { in qla2x00_thermal_temp_show()
1380 ql_log(ql_log_warn, vha, 0x70dd, "PCI EEH busy.\n"); in qla2x00_thermal_temp_show()
1384 if (qla2x00_get_thermal_temp(vha, &temp) == QLA_SUCCESS) in qla2x00_thermal_temp_show()
1395 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fw_state_show() local
1400 if (IS_QLAFX00(vha->hw)) { in qla2x00_fw_state_show()
1405 if (qla2x00_chip_is_down(vha)) in qla2x00_fw_state_show()
1406 ql_log(ql_log_warn, vha, 0x707c, in qla2x00_fw_state_show()
1408 else if (!vha->hw->flags.eeh_busy) in qla2x00_fw_state_show()
1409 rval = qla2x00_get_firmware_state(vha, state); in qla2x00_fw_state_show()
1421 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_diag_requests_show() local
1423 if (!IS_BIDI_CAPABLE(vha->hw)) in qla2x00_diag_requests_show()
1426 return scnprintf(buf, PAGE_SIZE, "%llu\n", vha->bidi_stats.io_count); in qla2x00_diag_requests_show()
1433 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_diag_megabytes_show() local
1435 if (!IS_BIDI_CAPABLE(vha->hw)) in qla2x00_diag_megabytes_show()
1439 vha->bidi_stats.transfer_bytes >> 20); in qla2x00_diag_megabytes_show()
1446 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fw_dump_size_show() local
1447 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_dump_size_show()
1464 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_allow_cna_fw_dump_show() local
1466 if (!IS_P3P_TYPE(vha->hw)) in qla2x00_allow_cna_fw_dump_show()
1470 vha->hw->allow_cna_fw_dump ? "true" : "false"); in qla2x00_allow_cna_fw_dump_show()
1477 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_allow_cna_fw_dump_store() local
1480 if (!IS_P3P_TYPE(vha->hw)) in qla2x00_allow_cna_fw_dump_store()
1486 vha->hw->allow_cna_fw_dump = val != 0; in qla2x00_allow_cna_fw_dump_store()
1495 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_pep_version_show() local
1496 struct qla_hw_data *ha = vha->hw; in qla2x00_pep_version_show()
1509 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_min_link_speed_show() local
1510 struct qla_hw_data *ha = vha->hw; in qla2x00_min_link_speed_show()
1527 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_max_speed_sup_show() local
1528 struct qla_hw_data *ha = vha->hw; in qla2x00_max_speed_sup_show()
1628 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_port_id() local
1630 fc_host_port_id(shost) = vha->d_id.b.domain << 16 | in qla2x00_get_host_port_id()
1631 vha->d_id.b.area << 8 | vha->d_id.b.al_pa; in qla2x00_get_host_port_id()
1675 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_port_type() local
1678 if (vha->vp_idx) { in qla2x00_get_host_port_type()
1682 switch (vha->hw->current_topology) { in qla2x00_get_host_port_type()
1703 scsi_qla_host_t *vha = shost_priv(host); in qla2x00_get_starget_node_name() local
1707 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_get_starget_node_name()
1722 scsi_qla_host_t *vha = shost_priv(host); in qla2x00_get_starget_port_name() local
1726 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_get_starget_port_name()
1741 scsi_qla_host_t *vha = shost_priv(host); in qla2x00_get_starget_port_id() local
1745 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_get_starget_port_id()
1789 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) in qla2x00_dev_loss_tmo_callbk()
1792 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { in qla2x00_dev_loss_tmo_callbk()
1793 qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); in qla2x00_dev_loss_tmo_callbk()
1806 if (test_bit(UNLOADING, &fcport->vha->dpc_flags)) in qla2x00_terminate_rport_io()
1809 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) in qla2x00_terminate_rport_io()
1812 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { in qla2x00_terminate_rport_io()
1813 qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); in qla2x00_terminate_rport_io()
1821 if (IS_FWI2_CAPABLE(fcport->vha->hw)) in qla2x00_terminate_rport_io()
1822 fcport->vha->hw->isp_ops->fabric_logout(fcport->vha, in qla2x00_terminate_rport_io()
1826 qla2x00_port_logout(fcport->vha, fcport); in qla2x00_terminate_rport_io()
1833 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_issue_lip() local
1835 if (IS_QLAFX00(vha->hw)) in qla2x00_issue_lip()
1838 qla2x00_loop_reset(vha); in qla2x00_issue_lip()
1845 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_fc_host_stats() local
1846 struct qla_hw_data *ha = vha->hw; in qla2x00_get_fc_host_stats()
1851 struct fc_host_statistics *p = &vha->fc_host_stat; in qla2x00_get_fc_host_stats()
1855 if (IS_QLAFX00(vha->hw)) in qla2x00_get_fc_host_stats()
1858 if (test_bit(UNLOADING, &vha->dpc_flags)) in qla2x00_get_fc_host_stats()
1864 if (qla2x00_chip_is_down(vha)) in qla2x00_get_fc_host_stats()
1870 ql_log(ql_log_warn, vha, 0x707d, in qla2x00_get_fc_host_stats()
1902 p->rx_words = vha->qla_stats.input_bytes; in qla2x00_get_fc_host_stats()
1903 p->tx_words = vha->qla_stats.output_bytes; in qla2x00_get_fc_host_stats()
1905 p->fcp_control_requests = vha->qla_stats.control_requests; in qla2x00_get_fc_host_stats()
1906 p->fcp_input_requests = vha->qla_stats.input_requests; in qla2x00_get_fc_host_stats()
1907 p->fcp_output_requests = vha->qla_stats.output_requests; in qla2x00_get_fc_host_stats()
1908 p->fcp_input_megabytes = vha->qla_stats.input_bytes >> 20; in qla2x00_get_fc_host_stats()
1909 p->fcp_output_megabytes = vha->qla_stats.output_bytes >> 20; in qla2x00_get_fc_host_stats()
1911 get_jiffies_64() - vha->qla_stats.jiffies_at_last_reset; in qla2x00_get_fc_host_stats()
1924 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_reset_host_stats() local
1925 struct qla_hw_data *ha = vha->hw; in qla2x00_reset_host_stats()
1930 memset(&vha->qla_stats, 0, sizeof(vha->qla_stats)); in qla2x00_reset_host_stats()
1931 memset(&vha->fc_host_stat, 0, sizeof(vha->fc_host_stat)); in qla2x00_reset_host_stats()
1933 vha->qla_stats.jiffies_at_last_reset = get_jiffies_64(); in qla2x00_reset_host_stats()
1939 ql_log(ql_log_warn, vha, 0x70d7, in qla2x00_reset_host_stats()
1955 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_symbolic_name() local
1957 qla2x00_get_sym_node_name(vha, fc_host_symbolic_name(shost), in qla2x00_get_host_symbolic_name()
1964 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_set_host_system_hostname() local
1966 set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags); in qla2x00_set_host_system_hostname()
1972 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_fabric_name() local
1977 if (vha->device_flags & SWITCH_FOUND) in qla2x00_get_host_fabric_name()
1978 fabric_name = wwn_to_u64(vha->fabric_node_name); in qla2x00_get_host_fabric_name()
1986 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_port_state() local
1987 struct scsi_qla_host *base_vha = pci_get_drvdata(vha->hw->pdev); in qla2x00_get_host_port_state()
2022 scsi_qla_host_t *vha = NULL; in qla24xx_vport_create() local
2030 ql_log(ql_log_warn, vha, 0x707e, in qla24xx_vport_create()
2035 vha = qla24xx_create_vhost(fc_vport); in qla24xx_vport_create()
2036 if (vha == NULL) { in qla24xx_vport_create()
2037 ql_log(ql_log_warn, vha, 0x707f, "Vport create host failed.\n"); in qla24xx_vport_create()
2041 atomic_set(&vha->vp_state, VP_OFFLINE); in qla24xx_vport_create()
2044 atomic_set(&vha->vp_state, VP_FAILED); in qla24xx_vport_create()
2047 ql_log(ql_log_info, vha, 0x7080, in qla24xx_vport_create()
2048 "VP entry id %d assigned.\n", vha->vp_idx); in qla24xx_vport_create()
2051 atomic_set(&vha->loop_state, LOOP_DOWN); in qla24xx_vport_create()
2052 vha->vp_err_state= VP_ERR_PORTDWN; in qla24xx_vport_create()
2053 vha->vp_prev_err_state= VP_ERR_UNKWN; in qla24xx_vport_create()
2058 ql_dbg(ql_dbg_user, vha, 0x7081, in qla24xx_vport_create()
2060 atomic_set(&vha->loop_state, LOOP_DEAD); in qla24xx_vport_create()
2068 vha->flags.difdix_supported = 1; in qla24xx_vport_create()
2069 ql_dbg(ql_dbg_user, vha, 0x7082, in qla24xx_vport_create()
2073 scsi_host_set_prot(vha->host, in qla24xx_vport_create()
2087 scsi_host_set_guard(vha->host, guard); in qla24xx_vport_create()
2089 vha->flags.difdix_supported = 0; in qla24xx_vport_create()
2092 if (scsi_add_host_with_dma(vha->host, &fc_vport->dev, in qla24xx_vport_create()
2094 ql_dbg(ql_dbg_user, vha, 0x7083, in qla24xx_vport_create()
2095 "scsi_add_host failure for VP[%d].\n", vha->vp_idx); in qla24xx_vport_create()
2100 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; in qla24xx_vport_create()
2101 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name); in qla24xx_vport_create()
2102 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name); in qla24xx_vport_create()
2103 fc_host_supported_classes(vha->host) = in qla24xx_vport_create()
2105 fc_host_supported_speeds(vha->host) = in qla24xx_vport_create()
2108 qlt_vport_create(vha, ha); in qla24xx_vport_create()
2116 if (memcmp(ha->npiv_info[cnt].port_name, vha->port_name, 8) == 0 in qla24xx_vport_create()
2117 && memcmp(ha->npiv_info[cnt].node_name, vha->node_name, in qla24xx_vport_create()
2125 qpair = qla2xxx_create_qpair(vha, qos, vha->vp_idx, true); in qla24xx_vport_create()
2127 ql_log(ql_log_warn, vha, 0x7084, in qla24xx_vport_create()
2129 vha->vp_idx); in qla24xx_vport_create()
2131 ql_dbg(ql_dbg_multiq, vha, 0xc001, in qla24xx_vport_create()
2133 qpair->id, qos, vha->vp_idx); in qla24xx_vport_create()
2134 ql_dbg(ql_dbg_user, vha, 0x7085, in qla24xx_vport_create()
2136 qpair->id, qos, vha->vp_idx); in qla24xx_vport_create()
2138 vha->qpair = qpair; in qla24xx_vport_create()
2143 vha->req = req; in qla24xx_vport_create()
2147 qla24xx_disable_vp(vha); in qla24xx_vport_create()
2148 qla24xx_deallocate_vp_id(vha); in qla24xx_vport_create()
2149 scsi_host_put(vha->host); in qla24xx_vport_create()
2156 scsi_qla_host_t *vha = fc_vport->dd_data; in qla24xx_vport_delete() local
2157 struct qla_hw_data *ha = vha->hw; in qla24xx_vport_delete()
2158 uint16_t id = vha->vp_idx; in qla24xx_vport_delete()
2160 while (test_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags) || in qla24xx_vport_delete()
2161 test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags)) in qla24xx_vport_delete()
2164 qla24xx_disable_vp(vha); in qla24xx_vport_delete()
2165 qla2x00_wait_for_sess_deletion(vha); in qla24xx_vport_delete()
2167 vha->flags.delete_progress = 1; in qla24xx_vport_delete()
2169 qlt_remove_target(ha, vha); in qla24xx_vport_delete()
2171 fc_remove_host(vha->host); in qla24xx_vport_delete()
2173 scsi_remove_host(vha->host); in qla24xx_vport_delete()
2176 qla24xx_deallocate_vp_id(vha); in qla24xx_vport_delete()
2178 if (vha->timer_active) { in qla24xx_vport_delete()
2179 qla2x00_vp_stop_timer(vha); in qla24xx_vport_delete()
2180 ql_dbg(ql_dbg_user, vha, 0x7086, in qla24xx_vport_delete()
2181 "Timer for the VP[%d] has stopped\n", vha->vp_idx); in qla24xx_vport_delete()
2184 qla2x00_free_fcports(vha); in qla24xx_vport_delete()
2188 clear_bit(vha->vp_idx, ha->vp_idx_map); in qla24xx_vport_delete()
2191 dma_free_coherent(&ha->pdev->dev, vha->gnl.size, vha->gnl.l, in qla24xx_vport_delete()
2192 vha->gnl.ldma); in qla24xx_vport_delete()
2194 vfree(vha->scan.l); in qla24xx_vport_delete()
2196 if (vha->qpair && vha->qpair->vp_idx == vha->vp_idx) { in qla24xx_vport_delete()
2197 if (qla2xxx_delete_qpair(vha, vha->qpair) != QLA_SUCCESS) in qla24xx_vport_delete()
2198 ql_log(ql_log_warn, vha, 0x7087, in qla24xx_vport_delete()
2202 ql_log(ql_log_info, vha, 0x7088, "VP[%d] deleted.\n", id); in qla24xx_vport_delete()
2203 scsi_host_put(vha->host); in qla24xx_vport_delete()
2210 scsi_qla_host_t *vha = fc_vport->dd_data; in qla24xx_vport_disable() local
2213 qla24xx_disable_vp(vha); in qla24xx_vport_disable()
2215 qla24xx_enable_vp(vha); in qla24xx_vport_disable()
2313 qla2x00_init_host_attr(scsi_qla_host_t *vha) in qla2x00_init_host_attr() argument
2315 struct qla_hw_data *ha = vha->hw; in qla2x00_init_host_attr()
2318 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; in qla2x00_init_host_attr()
2319 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name); in qla2x00_init_host_attr()
2320 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name); in qla2x00_init_host_attr()
2321 fc_host_supported_classes(vha->host) = ha->base_qpair->enable_class_2 ? in qla2x00_init_host_attr()
2323 fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; in qla2x00_init_host_attr()
2324 fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; in qla2x00_init_host_attr()
2347 fc_host_supported_speeds(vha->host) = speed; in qla2x00_init_host_attr()