• Home
  • Raw
  • Download

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_fw_dump_template() local
156 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_fw_dump_template()
161 ql_dbg(ql_dbg_user, vha, 0x70e2, in qla2x00_sysfs_read_fw_dump_template()
172 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_fw_dump_template() local
174 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_fw_dump_template()
189 ql_dbg(ql_dbg_user, vha, 0x70d1, in qla2x00_sysfs_write_fw_dump_template()
193 ql_log(ql_log_warn, vha, 0x70d2, in qla2x00_sysfs_write_fw_dump_template()
202 ql_dbg(ql_dbg_user, vha, 0x70d3, in qla2x00_sysfs_write_fw_dump_template()
206 ql_dbg(ql_dbg_user, vha, 0x70d4, in qla2x00_sysfs_write_fw_dump_template()
211 size = qla27xx_fwdt_calculate_dump_size(vha); in qla2x00_sysfs_write_fw_dump_template()
212 ql_dbg(ql_dbg_user, vha, 0x70d5, in qla2x00_sysfs_write_fw_dump_template()
216 ql_log(ql_log_warn, vha, 0x70d6, in qla2x00_sysfs_write_fw_dump_template()
240 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_nvram() local
242 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_nvram()
248 ha->isp_ops->read_optrom(vha, ha->nvram, ha->flt_region_nvram << 2, in qla2x00_sysfs_read_nvram()
259 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_nvram() local
261 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_nvram()
291 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2x00_sysfs_write_nvram()
292 ql_log(ql_log_warn, vha, 0x705f, in qla2x00_sysfs_write_nvram()
298 ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->nvram_base, count); in qla2x00_sysfs_write_nvram()
299 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->nvram, ha->nvram_base, in qla2x00_sysfs_write_nvram()
302 ql_dbg(ql_dbg_user, vha, 0x7060, in qla2x00_sysfs_write_nvram()
305 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_sysfs_write_nvram()
306 qla2xxx_wake_dpc(vha); in qla2x00_sysfs_write_nvram()
307 qla2x00_wait_for_chip_reset(vha); in qla2x00_sysfs_write_nvram()
327 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_optrom() local
329 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_optrom()
351 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_optrom() local
353 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom()
389 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_optrom_ctl() local
391 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom_ctl()
420 ql_dbg(ql_dbg_user, vha, 0x7061, in qla2x00_sysfs_write_optrom_ctl()
439 ql_log(ql_log_warn, vha, 0x7062, in qla2x00_sysfs_write_optrom_ctl()
448 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2x00_sysfs_write_optrom_ctl()
449 ql_log(ql_log_warn, vha, 0x7063, in qla2x00_sysfs_write_optrom_ctl()
455 ql_dbg(ql_dbg_user, vha, 0x7064, in qla2x00_sysfs_write_optrom_ctl()
460 ha->isp_ops->read_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
500 ql_log(ql_log_warn, vha, 0x7065, in qla2x00_sysfs_write_optrom_ctl()
512 ql_log(ql_log_warn, vha, 0x7066, in qla2x00_sysfs_write_optrom_ctl()
521 ql_dbg(ql_dbg_user, vha, 0x7067, in qla2x00_sysfs_write_optrom_ctl()
533 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2x00_sysfs_write_optrom_ctl()
534 ql_log(ql_log_warn, vha, 0x7068, in qla2x00_sysfs_write_optrom_ctl()
540 ql_dbg(ql_dbg_user, vha, 0x7069, in qla2x00_sysfs_write_optrom_ctl()
544 ha->isp_ops->write_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
570 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_vpd() local
572 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_vpd()
581 ha->isp_ops->read_optrom(vha, ha->vpd, ha->flt_region_vpd << 2, in qla2x00_sysfs_read_vpd()
591 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_vpd() local
593 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_vpd()
603 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2x00_sysfs_write_vpd()
604 ql_log(ql_log_warn, vha, 0x706a, in qla2x00_sysfs_write_vpd()
610 ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->vpd_base, count); in qla2x00_sysfs_write_vpd()
611 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->vpd, ha->vpd_base, count); in qla2x00_sysfs_write_vpd()
619 ql_log(ql_log_warn, vha, 0x706b, in qla2x00_sysfs_write_vpd()
623 ha->isp_ops->get_flash_version(vha, tmp_data); in qla2x00_sysfs_write_vpd()
644 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_sfp() local
646 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_sfp()
659 ql_log(ql_log_warn, vha, 0x706c, in qla2x00_sysfs_read_sfp()
675 rval = qla2x00_read_sfp(vha, ha->sfp_data_dma, ha->sfp_data, in qla2x00_sysfs_read_sfp()
678 ql_log(ql_log_warn, vha, 0x706d, in qla2x00_sysfs_read_sfp()
705 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_reset() local
707 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_reset()
718 ql_log(ql_log_info, vha, 0x706e, in qla2x00_sysfs_write_reset()
721 scsi_block_requests(vha->host); in qla2x00_sysfs_write_reset()
725 qla82xx_set_reset_owner(vha); in qla2x00_sysfs_write_reset()
733 qla82xx_set_reset_owner(vha); in qla2x00_sysfs_write_reset()
736 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_sysfs_write_reset()
737 qla2xxx_wake_dpc(vha); in qla2x00_sysfs_write_reset()
739 qla2x00_wait_for_chip_reset(vha); in qla2x00_sysfs_write_reset()
740 scsi_unblock_requests(vha->host); in qla2x00_sysfs_write_reset()
746 ql_log(ql_log_info, vha, 0x706f, in qla2x00_sysfs_write_reset()
752 qla83xx_idc_lock(vha, 0); in qla2x00_sysfs_write_reset()
753 __qla83xx_get_idc_control(vha, &idc_control); in qla2x00_sysfs_write_reset()
755 __qla83xx_set_idc_control(vha, idc_control); in qla2x00_sysfs_write_reset()
756 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, in qla2x00_sysfs_write_reset()
758 qla83xx_idc_audit(vha, IDC_AUDIT_TIMESTAMP); in qla2x00_sysfs_write_reset()
759 qla83xx_idc_unlock(vha, 0); in qla2x00_sysfs_write_reset()
763 qla2x00_wait_for_hba_online(vha); in qla2x00_sysfs_write_reset()
766 scsi_block_requests(vha->host); in qla2x00_sysfs_write_reset()
767 if (qla81xx_restart_mpi_firmware(vha) != QLA_SUCCESS) in qla2x00_sysfs_write_reset()
768 ql_log(ql_log_warn, vha, 0x7070, in qla2x00_sysfs_write_reset()
770 scsi_unblock_requests(vha->host); in qla2x00_sysfs_write_reset()
774 if (!IS_P3P_TYPE(ha) || vha != base_vha) { in qla2x00_sysfs_write_reset()
775 ql_log(ql_log_info, vha, 0x7071, in qla2x00_sysfs_write_reset()
780 ql_log(ql_log_info, vha, 0x7072, in qla2x00_sysfs_write_reset()
782 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags); in qla2x00_sysfs_write_reset()
783 qla2xxx_wake_dpc(vha); in qla2x00_sysfs_write_reset()
784 qla2x00_wait_for_fcoe_ctx_reset(vha); in qla2x00_sysfs_write_reset()
789 ql_log(ql_log_info, vha, 0x70bc, in qla2x00_sysfs_write_reset()
791 qla83xx_idc_lock(vha, 0); in qla2x00_sysfs_write_reset()
792 __qla83xx_get_idc_control(vha, &idc_control); in qla2x00_sysfs_write_reset()
794 __qla83xx_set_idc_control(vha, idc_control); in qla2x00_sysfs_write_reset()
795 qla83xx_idc_unlock(vha, 0); in qla2x00_sysfs_write_reset()
800 ql_log(ql_log_info, vha, 0x70bd, in qla2x00_sysfs_write_reset()
802 qla83xx_idc_lock(vha, 0); in qla2x00_sysfs_write_reset()
803 __qla83xx_get_idc_control(vha, &idc_control); in qla2x00_sysfs_write_reset()
805 __qla83xx_set_idc_control(vha, idc_control); in qla2x00_sysfs_write_reset()
806 qla83xx_idc_unlock(vha, 0); in qla2x00_sysfs_write_reset()
809 ql_dbg(ql_dbg_user, vha, 0x70e0, in qla2x00_sysfs_write_reset()
814 ql_log(ql_log_warn, vha, 0x70e1, in qla2x00_sysfs_write_reset()
818 ha->isp_ops->get_flash_version(vha, tmp_data); in qla2x00_sysfs_write_reset()
839 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_xgmac_stats() local
841 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_xgmac_stats()
854 ql_log(ql_log_warn, vha, 0x7076, in qla2x00_sysfs_read_xgmac_stats()
863 rval = qla2x00_get_xgmac_stats(vha, ha->xgmac_data_dma, in qla2x00_sysfs_read_xgmac_stats()
866 ql_log(ql_log_warn, vha, 0x7077, in qla2x00_sysfs_read_xgmac_stats()
891 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_dcbx_tlv() local
893 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_dcbx_tlv()
906 ql_log(ql_log_warn, vha, 0x7078, in qla2x00_sysfs_read_dcbx_tlv()
915 rval = qla2x00_get_dcbx_params(vha, ha->dcbx_tlv_dma, in qla2x00_sysfs_read_dcbx_tlv()
918 ql_log(ql_log_warn, vha, 0x7079, in qla2x00_sysfs_read_dcbx_tlv()
956 qla2x00_alloc_sysfs_attr(scsi_qla_host_t *vha) in qla2x00_alloc_sysfs_attr() argument
958 struct Scsi_Host *host = vha->host; in qla2x00_alloc_sysfs_attr()
963 if (iter->is4GBp_only && !IS_FWI2_CAPABLE(vha->hw)) in qla2x00_alloc_sysfs_attr()
965 if (iter->is4GBp_only == 2 && !IS_QLA25XX(vha->hw)) in qla2x00_alloc_sysfs_attr()
967 if (iter->is4GBp_only == 3 && !(IS_CNA_CAPABLE(vha->hw))) in qla2x00_alloc_sysfs_attr()
969 if (iter->is4GBp_only == 0x27 && !IS_QLA27XX(vha->hw)) in qla2x00_alloc_sysfs_attr()
975 ql_log(ql_log_warn, vha, 0x00f3, in qla2x00_alloc_sysfs_attr()
979 ql_dbg(ql_dbg_init, vha, 0x00f4, in qla2x00_alloc_sysfs_attr()
986 qla2x00_free_sysfs_attr(scsi_qla_host_t *vha, bool stop_beacon) in qla2x00_free_sysfs_attr() argument
988 struct Scsi_Host *host = vha->host; in qla2x00_free_sysfs_attr()
990 struct qla_hw_data *ha = vha->hw; in qla2x00_free_sysfs_attr()
997 if (iter->is4GBp_only == 3 && !(IS_CNA_CAPABLE(vha->hw))) in qla2x00_free_sysfs_attr()
999 if (iter->is4GBp_only == 0x27 && !IS_QLA27XX(vha->hw)) in qla2x00_free_sysfs_attr()
1007 ha->isp_ops->beacon_off(vha); in qla2x00_free_sysfs_attr()
1023 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fw_version_show() local
1024 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_version_show()
1028 ha->isp_ops->fw_version_str(vha, fw_str, sizeof(fw_str))); in qla2x00_fw_version_show()
1035 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_serial_num_show() local
1036 struct qla_hw_data *ha = vha->hw; in qla2x00_serial_num_show()
1039 if (IS_QLAFX00(vha->hw)) { in qla2x00_serial_num_show()
1041 vha->hw->mr.serial_num); in qla2x00_serial_num_show()
1043 qla2xxx_get_vpd_field(vha, "SN", buf, PAGE_SIZE - 1); in qla2x00_serial_num_show()
1056 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_isp_name_show() local
1057 return scnprintf(buf, PAGE_SIZE, "ISP%04X\n", vha->hw->pdev->device); in qla2x00_isp_name_show()
1064 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_isp_id_show() local
1065 struct qla_hw_data *ha = vha->hw; in qla2x00_isp_id_show()
1067 if (IS_QLAFX00(vha->hw)) in qla2x00_isp_id_show()
1069 vha->hw->mr.hw_version); in qla2x00_isp_id_show()
1080 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_model_name_show() local
1082 return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_number); in qla2x00_model_name_show()
1089 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_model_desc_show() local
1091 vha->hw->model_desc ? vha->hw->model_desc : ""); in qla2x00_model_desc_show()
1098 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_pci_info_show() local
1102 vha->hw->isp_ops->pci_info_str(vha, pci_info)); in qla2x00_pci_info_show()
1109 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_link_state_show() local
1110 struct qla_hw_data *ha = vha->hw; in qla2x00_link_state_show()
1113 if (atomic_read(&vha->loop_state) == LOOP_DOWN || in qla2x00_link_state_show()
1114 atomic_read(&vha->loop_state) == LOOP_DEAD || in qla2x00_link_state_show()
1115 vha->device_flags & DFLG_NO_CABLE) in qla2x00_link_state_show()
1117 else if (atomic_read(&vha->loop_state) != LOOP_READY || in qla2x00_link_state_show()
1118 qla2x00_reset_active(vha)) in qla2x00_link_state_show()
1149 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_show() local
1152 switch (vha->hw->zio_mode) { in qla2x00_zio_show()
1167 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_store() local
1168 struct qla_hw_data *ha = vha->hw; in qla2x00_zio_store()
1186 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_zio_store()
1195 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_timer_show() local
1197 return scnprintf(buf, PAGE_SIZE, "%d us\n", vha->hw->zio_timer * 100); in qla2x00_zio_timer_show()
1204 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_timer_store() local
1214 vha->hw->zio_timer = zio_timer; in qla2x00_zio_timer_store()
1223 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_beacon_show() local
1226 if (vha->hw->beacon_blink_led) in qla2x00_beacon_show()
1237 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_beacon_store() local
1238 struct qla_hw_data *ha = vha->hw; in qla2x00_beacon_store()
1245 if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) { in qla2x00_beacon_store()
1246 ql_log(ql_log_warn, vha, 0x707a, in qla2x00_beacon_store()
1255 rval = ha->isp_ops->beacon_on(vha); in qla2x00_beacon_store()
1257 rval = ha->isp_ops->beacon_off(vha); in qla2x00_beacon_store()
1269 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_bios_version_show() local
1270 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_bios_version_show()
1279 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_efi_version_show() local
1280 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_efi_version_show()
1289 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_fcode_version_show() local
1290 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fcode_version_show()
1299 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_fw_version_show() local
1300 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fw_version_show()
1310 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_gold_fw_version_show() local
1311 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_gold_fw_version_show()
1325 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_total_isp_aborts_show() local
1327 vha->qla_stats.total_isp_aborts); in qla2x00_total_isp_aborts_show()
1336 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla24xx_84xx_fw_version_show() local
1337 struct qla_hw_data *ha = vha->hw; in qla24xx_84xx_fw_version_show()
1343 rval = qla84xx_verify_chip(vha, status); in qla24xx_84xx_fw_version_show()
1356 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_mpi_version_show() local
1357 struct qla_hw_data *ha = vha->hw; in qla2x00_mpi_version_show()
1371 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_phy_version_show() local
1372 struct qla_hw_data *ha = vha->hw; in qla2x00_phy_version_show()
1385 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_flash_block_size_show() local
1386 struct qla_hw_data *ha = vha->hw; in qla2x00_flash_block_size_show()
1395 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_vlan_id_show() local
1397 if (!IS_CNA_CAPABLE(vha->hw)) in qla2x00_vlan_id_show()
1400 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id); in qla2x00_vlan_id_show()
1407 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_vn_port_mac_address_show() local
1409 if (!IS_CNA_CAPABLE(vha->hw)) in qla2x00_vn_port_mac_address_show()
1412 return scnprintf(buf, PAGE_SIZE, "%pMR\n", vha->fcoe_vn_port_mac); in qla2x00_vn_port_mac_address_show()
1419 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fabric_param_show() local
1421 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->hw->switch_cap); in qla2x00_fabric_param_show()
1428 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_thermal_temp_show() local
1431 if (qla2x00_reset_active(vha)) { in qla2x00_thermal_temp_show()
1432 ql_log(ql_log_warn, vha, 0x70dc, "ISP reset active.\n"); in qla2x00_thermal_temp_show()
1436 if (vha->hw->flags.eeh_busy) { in qla2x00_thermal_temp_show()
1437 ql_log(ql_log_warn, vha, 0x70dd, "PCI EEH busy.\n"); in qla2x00_thermal_temp_show()
1441 if (qla2x00_get_thermal_temp(vha, &temp) == QLA_SUCCESS) in qla2x00_thermal_temp_show()
1452 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fw_state_show() local
1457 if (IS_QLAFX00(vha->hw)) { in qla2x00_fw_state_show()
1462 if (qla2x00_reset_active(vha)) in qla2x00_fw_state_show()
1463 ql_log(ql_log_warn, vha, 0x707c, in qla2x00_fw_state_show()
1465 else if (!vha->hw->flags.eeh_busy) in qla2x00_fw_state_show()
1466 rval = qla2x00_get_firmware_state(vha, state); in qla2x00_fw_state_show()
1478 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_diag_requests_show() local
1480 if (!IS_BIDI_CAPABLE(vha->hw)) in qla2x00_diag_requests_show()
1483 return scnprintf(buf, PAGE_SIZE, "%llu\n", vha->bidi_stats.io_count); in qla2x00_diag_requests_show()
1490 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_diag_megabytes_show() local
1492 if (!IS_BIDI_CAPABLE(vha->hw)) in qla2x00_diag_megabytes_show()
1496 vha->bidi_stats.transfer_bytes >> 20); in qla2x00_diag_megabytes_show()
1503 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fw_dump_size_show() local
1504 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_dump_size_show()
1521 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_allow_cna_fw_dump_show() local
1523 if (!IS_P3P_TYPE(vha->hw)) in qla2x00_allow_cna_fw_dump_show()
1527 vha->hw->allow_cna_fw_dump ? "true" : "false"); in qla2x00_allow_cna_fw_dump_show()
1534 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_allow_cna_fw_dump_store() local
1537 if (!IS_P3P_TYPE(vha->hw)) in qla2x00_allow_cna_fw_dump_store()
1543 vha->hw->allow_cna_fw_dump = val != 0; in qla2x00_allow_cna_fw_dump_store()
1633 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_port_id() local
1635 fc_host_port_id(shost) = vha->d_id.b.domain << 16 | in qla2x00_get_host_port_id()
1636 vha->d_id.b.area << 8 | vha->d_id.b.al_pa; in qla2x00_get_host_port_id()
1680 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_port_type() local
1683 if (vha->vp_idx) { in qla2x00_get_host_port_type()
1687 switch (vha->hw->current_topology) { in qla2x00_get_host_port_type()
1708 scsi_qla_host_t *vha = shost_priv(host); in qla2x00_get_starget_node_name() local
1712 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_get_starget_node_name()
1727 scsi_qla_host_t *vha = shost_priv(host); in qla2x00_get_starget_port_name() local
1731 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_get_starget_port_name()
1746 scsi_qla_host_t *vha = shost_priv(host); in qla2x00_get_starget_port_id() local
1750 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_get_starget_port_id()
1794 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) in qla2x00_dev_loss_tmo_callbk()
1797 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { in qla2x00_dev_loss_tmo_callbk()
1798 qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); in qla2x00_dev_loss_tmo_callbk()
1811 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) in qla2x00_terminate_rport_io()
1814 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { in qla2x00_terminate_rport_io()
1815 qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); in qla2x00_terminate_rport_io()
1823 if (IS_FWI2_CAPABLE(fcport->vha->hw)) in qla2x00_terminate_rport_io()
1824 fcport->vha->hw->isp_ops->fabric_logout(fcport->vha, in qla2x00_terminate_rport_io()
1828 qla2x00_port_logout(fcport->vha, fcport); in qla2x00_terminate_rport_io()
1835 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_issue_lip() local
1837 if (IS_QLAFX00(vha->hw)) in qla2x00_issue_lip()
1840 qla2x00_loop_reset(vha); in qla2x00_issue_lip()
1847 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_fc_host_stats() local
1848 struct qla_hw_data *ha = vha->hw; in qla2x00_get_fc_host_stats()
1855 pfc_host_stat = &vha->fc_host_stat; in qla2x00_get_fc_host_stats()
1858 if (IS_QLAFX00(vha->hw)) in qla2x00_get_fc_host_stats()
1861 if (test_bit(UNLOADING, &vha->dpc_flags)) in qla2x00_get_fc_host_stats()
1867 if (qla2x00_reset_active(vha)) in qla2x00_get_fc_host_stats()
1872 ql_log(ql_log_warn, vha, 0x707d, in qla2x00_get_fc_host_stats()
1905 pfc_host_stat->rx_words = vha->qla_stats.input_bytes; in qla2x00_get_fc_host_stats()
1906 pfc_host_stat->tx_words = vha->qla_stats.output_bytes; in qla2x00_get_fc_host_stats()
1908 pfc_host_stat->fcp_control_requests = vha->qla_stats.control_requests; in qla2x00_get_fc_host_stats()
1909 pfc_host_stat->fcp_input_requests = vha->qla_stats.input_requests; in qla2x00_get_fc_host_stats()
1910 pfc_host_stat->fcp_output_requests = vha->qla_stats.output_requests; in qla2x00_get_fc_host_stats()
1911 pfc_host_stat->fcp_input_megabytes = vha->qla_stats.input_bytes >> 20; in qla2x00_get_fc_host_stats()
1912 pfc_host_stat->fcp_output_megabytes = vha->qla_stats.output_bytes >> 20; in qla2x00_get_fc_host_stats()
1914 get_jiffies_64() - vha->qla_stats.jiffies_at_last_reset; in qla2x00_get_fc_host_stats()
1926 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_reset_host_stats() local
1928 memset(&vha->fc_host_stat, 0, sizeof(vha->fc_host_stat)); in qla2x00_reset_host_stats()
1930 vha->qla_stats.jiffies_at_last_reset = get_jiffies_64(); in qla2x00_reset_host_stats()
1936 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_symbolic_name() local
1938 qla2x00_get_sym_node_name(vha, fc_host_symbolic_name(shost), in qla2x00_get_host_symbolic_name()
1945 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_set_host_system_hostname() local
1947 set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags); in qla2x00_set_host_system_hostname()
1953 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_fabric_name() local
1958 if (vha->device_flags & SWITCH_FOUND) in qla2x00_get_host_fabric_name()
1959 fabric_name = wwn_to_u64(vha->fabric_node_name); in qla2x00_get_host_fabric_name()
1967 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_port_state() local
1968 struct scsi_qla_host *base_vha = pci_get_drvdata(vha->hw->pdev); in qla2x00_get_host_port_state()
2003 scsi_qla_host_t *vha = NULL; in qla24xx_vport_create() local
2011 ql_log(ql_log_warn, vha, 0x707e, in qla24xx_vport_create()
2016 vha = qla24xx_create_vhost(fc_vport); in qla24xx_vport_create()
2017 if (vha == NULL) { in qla24xx_vport_create()
2018 ql_log(ql_log_warn, vha, 0x707f, "Vport create host failed.\n"); in qla24xx_vport_create()
2022 atomic_set(&vha->vp_state, VP_OFFLINE); in qla24xx_vport_create()
2025 atomic_set(&vha->vp_state, VP_FAILED); in qla24xx_vport_create()
2028 ql_log(ql_log_info, vha, 0x7080, in qla24xx_vport_create()
2029 "VP entry id %d assigned.\n", vha->vp_idx); in qla24xx_vport_create()
2032 atomic_set(&vha->loop_state, LOOP_DOWN); in qla24xx_vport_create()
2033 vha->vp_err_state= VP_ERR_PORTDWN; in qla24xx_vport_create()
2034 vha->vp_prev_err_state= VP_ERR_UNKWN; in qla24xx_vport_create()
2039 ql_dbg(ql_dbg_user, vha, 0x7081, in qla24xx_vport_create()
2041 atomic_set(&vha->loop_state, LOOP_DEAD); in qla24xx_vport_create()
2049 vha->flags.difdix_supported = 1; in qla24xx_vport_create()
2050 ql_dbg(ql_dbg_user, vha, 0x7082, in qla24xx_vport_create()
2054 scsi_host_set_prot(vha->host, in qla24xx_vport_create()
2068 scsi_host_set_guard(vha->host, guard); in qla24xx_vport_create()
2070 vha->flags.difdix_supported = 0; in qla24xx_vport_create()
2073 if (scsi_add_host_with_dma(vha->host, &fc_vport->dev, in qla24xx_vport_create()
2075 ql_dbg(ql_dbg_user, vha, 0x7083, in qla24xx_vport_create()
2076 "scsi_add_host failure for VP[%d].\n", vha->vp_idx); in qla24xx_vport_create()
2081 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; in qla24xx_vport_create()
2082 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name); in qla24xx_vport_create()
2083 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name); in qla24xx_vport_create()
2084 fc_host_supported_classes(vha->host) = in qla24xx_vport_create()
2086 fc_host_supported_speeds(vha->host) = in qla24xx_vport_create()
2089 qlt_vport_create(vha, ha); in qla24xx_vport_create()
2094 ql_dbg(ql_dbg_multiq, vha, 0xc000, in qla24xx_vport_create()
2097 req, vha->vp_idx, ha->flags.cpu_affinity_enabled); in qla24xx_vport_create()
2103 if (memcmp(ha->npiv_info[cnt].port_name, vha->port_name, 8) == 0 in qla24xx_vport_create()
2104 && memcmp(ha->npiv_info[cnt].node_name, vha->node_name, in qla24xx_vport_create()
2112 ret = qla25xx_create_req_que(ha, options, vha->vp_idx, 0, 0, in qla24xx_vport_create()
2115 ql_log(ql_log_warn, vha, 0x7084, in qla24xx_vport_create()
2117 vha->vp_idx); in qla24xx_vport_create()
2119 ql_dbg(ql_dbg_multiq, vha, 0xc001, in qla24xx_vport_create()
2121 ret, qos, vha->vp_idx); in qla24xx_vport_create()
2122 ql_dbg(ql_dbg_user, vha, 0x7085, in qla24xx_vport_create()
2124 ret, qos, vha->vp_idx); in qla24xx_vport_create()
2130 vha->req = req; in qla24xx_vport_create()
2134 qla24xx_disable_vp(vha); in qla24xx_vport_create()
2135 qla24xx_deallocate_vp_id(vha); in qla24xx_vport_create()
2136 scsi_host_put(vha->host); in qla24xx_vport_create()
2143 scsi_qla_host_t *vha = fc_vport->dd_data; in qla24xx_vport_delete() local
2144 struct qla_hw_data *ha = vha->hw; in qla24xx_vport_delete()
2145 uint16_t id = vha->vp_idx; in qla24xx_vport_delete()
2147 while (test_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags) || in qla24xx_vport_delete()
2148 test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags)) in qla24xx_vport_delete()
2151 qla24xx_disable_vp(vha); in qla24xx_vport_delete()
2153 vha->flags.delete_progress = 1; in qla24xx_vport_delete()
2155 qlt_remove_target(ha, vha); in qla24xx_vport_delete()
2157 fc_remove_host(vha->host); in qla24xx_vport_delete()
2159 scsi_remove_host(vha->host); in qla24xx_vport_delete()
2162 qla24xx_deallocate_vp_id(vha); in qla24xx_vport_delete()
2164 if (vha->timer_active) { in qla24xx_vport_delete()
2165 qla2x00_vp_stop_timer(vha); in qla24xx_vport_delete()
2166 ql_dbg(ql_dbg_user, vha, 0x7086, in qla24xx_vport_delete()
2167 "Timer for the VP[%d] has stopped\n", vha->vp_idx); in qla24xx_vport_delete()
2170 BUG_ON(atomic_read(&vha->vref_count)); in qla24xx_vport_delete()
2172 qla2x00_free_fcports(vha); in qla24xx_vport_delete()
2176 clear_bit(vha->vp_idx, ha->vp_idx_map); in qla24xx_vport_delete()
2179 if (vha->req->id && !ha->flags.cpu_affinity_enabled) { in qla24xx_vport_delete()
2180 if (qla25xx_delete_req_que(vha, vha->req) != QLA_SUCCESS) in qla24xx_vport_delete()
2181 ql_log(ql_log_warn, vha, 0x7087, in qla24xx_vport_delete()
2185 ql_log(ql_log_info, vha, 0x7088, "VP[%d] deleted.\n", id); in qla24xx_vport_delete()
2186 scsi_host_put(vha->host); in qla24xx_vport_delete()
2193 scsi_qla_host_t *vha = fc_vport->dd_data; in qla24xx_vport_disable() local
2196 qla24xx_disable_vp(vha); in qla24xx_vport_disable()
2198 qla24xx_enable_vp(vha); in qla24xx_vport_disable()
2296 qla2x00_init_host_attr(scsi_qla_host_t *vha) in qla2x00_init_host_attr() argument
2298 struct qla_hw_data *ha = vha->hw; in qla2x00_init_host_attr()
2301 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; in qla2x00_init_host_attr()
2302 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name); in qla2x00_init_host_attr()
2303 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name); in qla2x00_init_host_attr()
2304 fc_host_supported_classes(vha->host) = ha->tgt.enable_class_2 ? in qla2x00_init_host_attr()
2306 fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; in qla2x00_init_host_attr()
2307 fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; in qla2x00_init_host_attr()
2330 fc_host_supported_speeds(vha->host) = speed; in qla2x00_init_host_attr()