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()
348 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_optrom() local
350 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom()
381 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_optrom_ctl() local
383 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom_ctl()
410 ql_dbg(ql_dbg_user, vha, 0x7061, in qla2x00_sysfs_write_optrom_ctl()
430 ql_log(ql_log_warn, vha, 0x7062, in qla2x00_sysfs_write_optrom_ctl()
439 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2x00_sysfs_write_optrom_ctl()
440 ql_log(ql_log_warn, vha, 0x7063, in qla2x00_sysfs_write_optrom_ctl()
446 ql_dbg(ql_dbg_user, vha, 0x7064, in qla2x00_sysfs_write_optrom_ctl()
451 ha->isp_ops->read_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
491 ql_log(ql_log_warn, vha, 0x7065, in qla2x00_sysfs_write_optrom_ctl()
504 ql_log(ql_log_warn, vha, 0x7066, in qla2x00_sysfs_write_optrom_ctl()
513 ql_dbg(ql_dbg_user, vha, 0x7067, in qla2x00_sysfs_write_optrom_ctl()
525 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2x00_sysfs_write_optrom_ctl()
526 ql_log(ql_log_warn, vha, 0x7068, in qla2x00_sysfs_write_optrom_ctl()
532 ql_dbg(ql_dbg_user, vha, 0x7069, in qla2x00_sysfs_write_optrom_ctl()
536 ha->isp_ops->write_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
562 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_vpd() local
564 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_vpd()
573 ha->isp_ops->read_optrom(vha, ha->vpd, ha->flt_region_vpd << 2, in qla2x00_sysfs_read_vpd()
583 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_vpd() local
585 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_vpd()
595 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { in qla2x00_sysfs_write_vpd()
596 ql_log(ql_log_warn, vha, 0x706a, in qla2x00_sysfs_write_vpd()
602 ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->vpd_base, count); in qla2x00_sysfs_write_vpd()
603 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->vpd, ha->vpd_base, count); in qla2x00_sysfs_write_vpd()
611 ql_log(ql_log_warn, vha, 0x706b, in qla2x00_sysfs_write_vpd()
615 ha->isp_ops->get_flash_version(vha, tmp_data); in qla2x00_sysfs_write_vpd()
636 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_sfp() local
638 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_sfp()
651 ql_log(ql_log_warn, vha, 0x706c, in qla2x00_sysfs_read_sfp()
667 rval = qla2x00_read_sfp(vha, ha->sfp_data_dma, ha->sfp_data, in qla2x00_sysfs_read_sfp()
670 ql_log(ql_log_warn, vha, 0x706d, in qla2x00_sysfs_read_sfp()
697 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_write_reset() local
699 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_reset()
710 ql_log(ql_log_info, vha, 0x706e, in qla2x00_sysfs_write_reset()
713 scsi_block_requests(vha->host); in qla2x00_sysfs_write_reset()
717 qla82xx_set_reset_owner(vha); in qla2x00_sysfs_write_reset()
725 qla82xx_set_reset_owner(vha); in qla2x00_sysfs_write_reset()
728 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_sysfs_write_reset()
729 qla2xxx_wake_dpc(vha); in qla2x00_sysfs_write_reset()
731 qla2x00_wait_for_chip_reset(vha); in qla2x00_sysfs_write_reset()
732 scsi_unblock_requests(vha->host); in qla2x00_sysfs_write_reset()
738 ql_log(ql_log_info, vha, 0x706f, in qla2x00_sysfs_write_reset()
744 qla83xx_idc_lock(vha, 0); in qla2x00_sysfs_write_reset()
745 __qla83xx_get_idc_control(vha, &idc_control); in qla2x00_sysfs_write_reset()
747 __qla83xx_set_idc_control(vha, idc_control); in qla2x00_sysfs_write_reset()
748 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE, in qla2x00_sysfs_write_reset()
750 qla83xx_idc_audit(vha, IDC_AUDIT_TIMESTAMP); in qla2x00_sysfs_write_reset()
751 qla83xx_idc_unlock(vha, 0); in qla2x00_sysfs_write_reset()
755 qla2x00_wait_for_hba_online(vha); in qla2x00_sysfs_write_reset()
758 scsi_block_requests(vha->host); in qla2x00_sysfs_write_reset()
759 if (qla81xx_restart_mpi_firmware(vha) != QLA_SUCCESS) in qla2x00_sysfs_write_reset()
760 ql_log(ql_log_warn, vha, 0x7070, in qla2x00_sysfs_write_reset()
762 scsi_unblock_requests(vha->host); in qla2x00_sysfs_write_reset()
766 if (!IS_P3P_TYPE(ha) || vha != base_vha) { in qla2x00_sysfs_write_reset()
767 ql_log(ql_log_info, vha, 0x7071, in qla2x00_sysfs_write_reset()
772 ql_log(ql_log_info, vha, 0x7072, in qla2x00_sysfs_write_reset()
774 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags); in qla2x00_sysfs_write_reset()
775 qla2xxx_wake_dpc(vha); in qla2x00_sysfs_write_reset()
776 qla2x00_wait_for_fcoe_ctx_reset(vha); in qla2x00_sysfs_write_reset()
781 ql_log(ql_log_info, vha, 0x70bc, in qla2x00_sysfs_write_reset()
783 qla83xx_idc_lock(vha, 0); in qla2x00_sysfs_write_reset()
784 __qla83xx_get_idc_control(vha, &idc_control); in qla2x00_sysfs_write_reset()
786 __qla83xx_set_idc_control(vha, idc_control); in qla2x00_sysfs_write_reset()
787 qla83xx_idc_unlock(vha, 0); in qla2x00_sysfs_write_reset()
792 ql_log(ql_log_info, vha, 0x70bd, in qla2x00_sysfs_write_reset()
794 qla83xx_idc_lock(vha, 0); in qla2x00_sysfs_write_reset()
795 __qla83xx_get_idc_control(vha, &idc_control); in qla2x00_sysfs_write_reset()
797 __qla83xx_set_idc_control(vha, idc_control); in qla2x00_sysfs_write_reset()
798 qla83xx_idc_unlock(vha, 0); in qla2x00_sysfs_write_reset()
801 ql_dbg(ql_dbg_user, vha, 0x70e0, in qla2x00_sysfs_write_reset()
806 ql_log(ql_log_warn, vha, 0x70e1, in qla2x00_sysfs_write_reset()
810 ha->isp_ops->get_flash_version(vha, tmp_data); in qla2x00_sysfs_write_reset()
831 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_xgmac_stats() local
833 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_xgmac_stats()
846 ql_log(ql_log_warn, vha, 0x7076, in qla2x00_sysfs_read_xgmac_stats()
855 rval = qla2x00_get_xgmac_stats(vha, ha->xgmac_data_dma, in qla2x00_sysfs_read_xgmac_stats()
858 ql_log(ql_log_warn, vha, 0x7077, in qla2x00_sysfs_read_xgmac_stats()
883 struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, in qla2x00_sysfs_read_dcbx_tlv() local
885 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_dcbx_tlv()
897 ql_log(ql_log_warn, vha, 0x7078, in qla2x00_sysfs_read_dcbx_tlv()
905 rval = qla2x00_get_dcbx_params(vha, ha->dcbx_tlv_dma, in qla2x00_sysfs_read_dcbx_tlv()
908 ql_log(ql_log_warn, vha, 0x7079, in qla2x00_sysfs_read_dcbx_tlv()
946 qla2x00_alloc_sysfs_attr(scsi_qla_host_t *vha) in qla2x00_alloc_sysfs_attr() argument
948 struct Scsi_Host *host = vha->host; in qla2x00_alloc_sysfs_attr()
953 if (iter->is4GBp_only && !IS_FWI2_CAPABLE(vha->hw)) in qla2x00_alloc_sysfs_attr()
955 if (iter->is4GBp_only == 2 && !IS_QLA25XX(vha->hw)) in qla2x00_alloc_sysfs_attr()
957 if (iter->is4GBp_only == 3 && !(IS_CNA_CAPABLE(vha->hw))) in qla2x00_alloc_sysfs_attr()
959 if (iter->is4GBp_only == 0x27 && !IS_QLA27XX(vha->hw)) in qla2x00_alloc_sysfs_attr()
965 ql_log(ql_log_warn, vha, 0x00f3, in qla2x00_alloc_sysfs_attr()
969 ql_dbg(ql_dbg_init, vha, 0x00f4, in qla2x00_alloc_sysfs_attr()
976 qla2x00_free_sysfs_attr(scsi_qla_host_t *vha, bool stop_beacon) in qla2x00_free_sysfs_attr() argument
978 struct Scsi_Host *host = vha->host; in qla2x00_free_sysfs_attr()
980 struct qla_hw_data *ha = vha->hw; in qla2x00_free_sysfs_attr()
987 if (iter->is4GBp_only == 3 && !(IS_CNA_CAPABLE(vha->hw))) in qla2x00_free_sysfs_attr()
989 if (iter->is4GBp_only == 0x27 && !IS_QLA27XX(vha->hw)) in qla2x00_free_sysfs_attr()
997 ha->isp_ops->beacon_off(vha); in qla2x00_free_sysfs_attr()
1013 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fw_version_show() local
1014 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_version_show()
1018 ha->isp_ops->fw_version_str(vha, fw_str, sizeof(fw_str))); in qla2x00_fw_version_show()
1025 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_serial_num_show() local
1026 struct qla_hw_data *ha = vha->hw; in qla2x00_serial_num_show()
1029 if (IS_QLAFX00(vha->hw)) { in qla2x00_serial_num_show()
1031 vha->hw->mr.serial_num); in qla2x00_serial_num_show()
1033 qla2xxx_get_vpd_field(vha, "SN", buf, PAGE_SIZE - 1); in qla2x00_serial_num_show()
1046 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_isp_name_show() local
1047 return scnprintf(buf, PAGE_SIZE, "ISP%04X\n", vha->hw->pdev->device); in qla2x00_isp_name_show()
1054 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_isp_id_show() local
1055 struct qla_hw_data *ha = vha->hw; in qla2x00_isp_id_show()
1057 if (IS_QLAFX00(vha->hw)) in qla2x00_isp_id_show()
1059 vha->hw->mr.hw_version); in qla2x00_isp_id_show()
1070 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_model_name_show() local
1072 return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_number); in qla2x00_model_name_show()
1079 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_model_desc_show() local
1080 return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_desc); in qla2x00_model_desc_show()
1087 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_pci_info_show() local
1091 vha->hw->isp_ops->pci_info_str(vha, pci_info)); in qla2x00_pci_info_show()
1098 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_link_state_show() local
1099 struct qla_hw_data *ha = vha->hw; in qla2x00_link_state_show()
1102 if (atomic_read(&vha->loop_state) == LOOP_DOWN || in qla2x00_link_state_show()
1103 atomic_read(&vha->loop_state) == LOOP_DEAD || in qla2x00_link_state_show()
1104 vha->device_flags & DFLG_NO_CABLE) in qla2x00_link_state_show()
1106 else if (atomic_read(&vha->loop_state) != LOOP_READY || in qla2x00_link_state_show()
1107 qla2x00_reset_active(vha)) in qla2x00_link_state_show()
1138 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_show() local
1141 switch (vha->hw->zio_mode) { in qla2x00_zio_show()
1156 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_store() local
1157 struct qla_hw_data *ha = vha->hw; in qla2x00_zio_store()
1175 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); in qla2x00_zio_store()
1184 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_timer_show() local
1186 return scnprintf(buf, PAGE_SIZE, "%d us\n", vha->hw->zio_timer * 100); in qla2x00_zio_timer_show()
1193 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_zio_timer_store() local
1203 vha->hw->zio_timer = zio_timer; in qla2x00_zio_timer_store()
1212 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_beacon_show() local
1215 if (vha->hw->beacon_blink_led) in qla2x00_beacon_show()
1226 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_beacon_store() local
1227 struct qla_hw_data *ha = vha->hw; in qla2x00_beacon_store()
1234 if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) { in qla2x00_beacon_store()
1235 ql_log(ql_log_warn, vha, 0x707a, in qla2x00_beacon_store()
1244 rval = ha->isp_ops->beacon_on(vha); in qla2x00_beacon_store()
1246 rval = ha->isp_ops->beacon_off(vha); in qla2x00_beacon_store()
1258 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_bios_version_show() local
1259 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_bios_version_show()
1268 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_efi_version_show() local
1269 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_efi_version_show()
1278 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_fcode_version_show() local
1279 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fcode_version_show()
1288 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_fw_version_show() local
1289 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fw_version_show()
1299 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_optrom_gold_fw_version_show() local
1300 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_gold_fw_version_show()
1314 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_total_isp_aborts_show() local
1316 vha->qla_stats.total_isp_aborts); in qla2x00_total_isp_aborts_show()
1325 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla24xx_84xx_fw_version_show() local
1326 struct qla_hw_data *ha = vha->hw; in qla24xx_84xx_fw_version_show()
1332 rval = qla84xx_verify_chip(vha, status); in qla24xx_84xx_fw_version_show()
1345 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_mpi_version_show() local
1346 struct qla_hw_data *ha = vha->hw; in qla2x00_mpi_version_show()
1361 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_phy_version_show() local
1362 struct qla_hw_data *ha = vha->hw; in qla2x00_phy_version_show()
1375 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_flash_block_size_show() local
1376 struct qla_hw_data *ha = vha->hw; in qla2x00_flash_block_size_show()
1385 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_vlan_id_show() local
1387 if (!IS_CNA_CAPABLE(vha->hw)) in qla2x00_vlan_id_show()
1390 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id); in qla2x00_vlan_id_show()
1397 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_vn_port_mac_address_show() local
1399 if (!IS_CNA_CAPABLE(vha->hw)) in qla2x00_vn_port_mac_address_show()
1402 return scnprintf(buf, PAGE_SIZE, "%pMR\n", vha->fcoe_vn_port_mac); in qla2x00_vn_port_mac_address_show()
1409 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fabric_param_show() local
1411 return scnprintf(buf, PAGE_SIZE, "%d\n", vha->hw->switch_cap); in qla2x00_fabric_param_show()
1418 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_thermal_temp_show() local
1421 if (qla2x00_reset_active(vha)) { in qla2x00_thermal_temp_show()
1422 ql_log(ql_log_warn, vha, 0x70dc, "ISP reset active.\n"); in qla2x00_thermal_temp_show()
1426 if (vha->hw->flags.eeh_busy) { in qla2x00_thermal_temp_show()
1427 ql_log(ql_log_warn, vha, 0x70dd, "PCI EEH busy.\n"); in qla2x00_thermal_temp_show()
1431 if (qla2x00_get_thermal_temp(vha, &temp) == QLA_SUCCESS) in qla2x00_thermal_temp_show()
1442 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fw_state_show() local
1447 if (IS_QLAFX00(vha->hw)) { in qla2x00_fw_state_show()
1452 if (qla2x00_reset_active(vha)) in qla2x00_fw_state_show()
1453 ql_log(ql_log_warn, vha, 0x707c, in qla2x00_fw_state_show()
1455 else if (!vha->hw->flags.eeh_busy) in qla2x00_fw_state_show()
1456 rval = qla2x00_get_firmware_state(vha, state); in qla2x00_fw_state_show()
1468 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_diag_requests_show() local
1470 if (!IS_BIDI_CAPABLE(vha->hw)) in qla2x00_diag_requests_show()
1473 return scnprintf(buf, PAGE_SIZE, "%llu\n", vha->bidi_stats.io_count); in qla2x00_diag_requests_show()
1480 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_diag_megabytes_show() local
1482 if (!IS_BIDI_CAPABLE(vha->hw)) in qla2x00_diag_megabytes_show()
1486 vha->bidi_stats.transfer_bytes >> 20); in qla2x00_diag_megabytes_show()
1493 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_fw_dump_size_show() local
1494 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_dump_size_show()
1511 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_allow_cna_fw_dump_show() local
1513 if (!IS_P3P_TYPE(vha->hw)) in qla2x00_allow_cna_fw_dump_show()
1517 vha->hw->allow_cna_fw_dump ? "true" : "false"); in qla2x00_allow_cna_fw_dump_show()
1524 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_allow_cna_fw_dump_store() local
1527 if (!IS_P3P_TYPE(vha->hw)) in qla2x00_allow_cna_fw_dump_store()
1533 vha->hw->allow_cna_fw_dump = val != 0; in qla2x00_allow_cna_fw_dump_store()
1542 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); in qla2x00_pep_version_show() local
1543 struct qla_hw_data *ha = vha->hw; in qla2x00_pep_version_show()
1639 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_port_id() local
1641 fc_host_port_id(shost) = vha->d_id.b.domain << 16 | in qla2x00_get_host_port_id()
1642 vha->d_id.b.area << 8 | vha->d_id.b.al_pa; in qla2x00_get_host_port_id()
1686 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_port_type() local
1689 if (vha->vp_idx) { in qla2x00_get_host_port_type()
1693 switch (vha->hw->current_topology) { in qla2x00_get_host_port_type()
1714 scsi_qla_host_t *vha = shost_priv(host); in qla2x00_get_starget_node_name() local
1718 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_get_starget_node_name()
1733 scsi_qla_host_t *vha = shost_priv(host); in qla2x00_get_starget_port_name() local
1737 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_get_starget_port_name()
1752 scsi_qla_host_t *vha = shost_priv(host); in qla2x00_get_starget_port_id() local
1756 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla2x00_get_starget_port_id()
1800 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) in qla2x00_dev_loss_tmo_callbk()
1803 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { in qla2x00_dev_loss_tmo_callbk()
1804 qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); in qla2x00_dev_loss_tmo_callbk()
1817 if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) in qla2x00_terminate_rport_io()
1820 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { in qla2x00_terminate_rport_io()
1821 qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); in qla2x00_terminate_rport_io()
1829 if (IS_FWI2_CAPABLE(fcport->vha->hw)) in qla2x00_terminate_rport_io()
1830 fcport->vha->hw->isp_ops->fabric_logout(fcport->vha, in qla2x00_terminate_rport_io()
1834 qla2x00_port_logout(fcport->vha, fcport); in qla2x00_terminate_rport_io()
1841 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_issue_lip() local
1843 if (IS_QLAFX00(vha->hw)) in qla2x00_issue_lip()
1846 qla2x00_loop_reset(vha); in qla2x00_issue_lip()
1853 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_fc_host_stats() local
1854 struct qla_hw_data *ha = vha->hw; in qla2x00_get_fc_host_stats()
1861 pfc_host_stat = &vha->fc_host_stat; in qla2x00_get_fc_host_stats()
1864 if (IS_QLAFX00(vha->hw)) in qla2x00_get_fc_host_stats()
1867 if (test_bit(UNLOADING, &vha->dpc_flags)) in qla2x00_get_fc_host_stats()
1873 if (qla2x00_reset_active(vha)) in qla2x00_get_fc_host_stats()
1878 ql_log(ql_log_warn, vha, 0x707d, in qla2x00_get_fc_host_stats()
1911 pfc_host_stat->rx_words = vha->qla_stats.input_bytes; in qla2x00_get_fc_host_stats()
1912 pfc_host_stat->tx_words = vha->qla_stats.output_bytes; in qla2x00_get_fc_host_stats()
1914 pfc_host_stat->fcp_control_requests = vha->qla_stats.control_requests; in qla2x00_get_fc_host_stats()
1915 pfc_host_stat->fcp_input_requests = vha->qla_stats.input_requests; in qla2x00_get_fc_host_stats()
1916 pfc_host_stat->fcp_output_requests = vha->qla_stats.output_requests; in qla2x00_get_fc_host_stats()
1917 pfc_host_stat->fcp_input_megabytes = vha->qla_stats.input_bytes >> 20; in qla2x00_get_fc_host_stats()
1918 pfc_host_stat->fcp_output_megabytes = vha->qla_stats.output_bytes >> 20; in qla2x00_get_fc_host_stats()
1920 get_jiffies_64() - vha->qla_stats.jiffies_at_last_reset; in qla2x00_get_fc_host_stats()
1932 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_reset_host_stats() local
1934 memset(&vha->fc_host_stat, 0, sizeof(vha->fc_host_stat)); in qla2x00_reset_host_stats()
1936 vha->qla_stats.jiffies_at_last_reset = get_jiffies_64(); in qla2x00_reset_host_stats()
1942 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_symbolic_name() local
1944 qla2x00_get_sym_node_name(vha, fc_host_symbolic_name(shost), in qla2x00_get_host_symbolic_name()
1951 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_set_host_system_hostname() local
1953 set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags); in qla2x00_set_host_system_hostname()
1959 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_fabric_name() local
1964 if (vha->device_flags & SWITCH_FOUND) in qla2x00_get_host_fabric_name()
1965 fabric_name = wwn_to_u64(vha->fabric_node_name); in qla2x00_get_host_fabric_name()
1973 scsi_qla_host_t *vha = shost_priv(shost); in qla2x00_get_host_port_state() local
1974 struct scsi_qla_host *base_vha = pci_get_drvdata(vha->hw->pdev); in qla2x00_get_host_port_state()
2009 scsi_qla_host_t *vha = NULL; in qla24xx_vport_create() local
2017 ql_log(ql_log_warn, vha, 0x707e, in qla24xx_vport_create()
2022 vha = qla24xx_create_vhost(fc_vport); in qla24xx_vport_create()
2023 if (vha == NULL) { in qla24xx_vport_create()
2024 ql_log(ql_log_warn, vha, 0x707f, "Vport create host failed.\n"); in qla24xx_vport_create()
2028 atomic_set(&vha->vp_state, VP_OFFLINE); in qla24xx_vport_create()
2031 atomic_set(&vha->vp_state, VP_FAILED); in qla24xx_vport_create()
2034 ql_log(ql_log_info, vha, 0x7080, in qla24xx_vport_create()
2035 "VP entry id %d assigned.\n", vha->vp_idx); in qla24xx_vport_create()
2038 atomic_set(&vha->loop_state, LOOP_DOWN); in qla24xx_vport_create()
2039 vha->vp_err_state= VP_ERR_PORTDWN; in qla24xx_vport_create()
2040 vha->vp_prev_err_state= VP_ERR_UNKWN; in qla24xx_vport_create()
2045 ql_dbg(ql_dbg_user, vha, 0x7081, in qla24xx_vport_create()
2047 atomic_set(&vha->loop_state, LOOP_DEAD); in qla24xx_vport_create()
2055 vha->flags.difdix_supported = 1; in qla24xx_vport_create()
2056 ql_dbg(ql_dbg_user, vha, 0x7082, in qla24xx_vport_create()
2060 scsi_host_set_prot(vha->host, in qla24xx_vport_create()
2074 scsi_host_set_guard(vha->host, guard); in qla24xx_vport_create()
2076 vha->flags.difdix_supported = 0; in qla24xx_vport_create()
2079 if (scsi_add_host_with_dma(vha->host, &fc_vport->dev, in qla24xx_vport_create()
2081 ql_dbg(ql_dbg_user, vha, 0x7083, in qla24xx_vport_create()
2082 "scsi_add_host failure for VP[%d].\n", vha->vp_idx); in qla24xx_vport_create()
2087 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; in qla24xx_vport_create()
2088 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name); in qla24xx_vport_create()
2089 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name); in qla24xx_vport_create()
2090 fc_host_supported_classes(vha->host) = in qla24xx_vport_create()
2092 fc_host_supported_speeds(vha->host) = in qla24xx_vport_create()
2095 qlt_vport_create(vha, ha); in qla24xx_vport_create()
2100 ql_dbg(ql_dbg_multiq, vha, 0xc000, in qla24xx_vport_create()
2103 req, vha->vp_idx, ha->flags.cpu_affinity_enabled); in qla24xx_vport_create()
2109 if (memcmp(ha->npiv_info[cnt].port_name, vha->port_name, 8) == 0 in qla24xx_vport_create()
2110 && memcmp(ha->npiv_info[cnt].node_name, vha->node_name, in qla24xx_vport_create()
2118 ret = qla25xx_create_req_que(ha, options, vha->vp_idx, 0, 0, in qla24xx_vport_create()
2121 ql_log(ql_log_warn, vha, 0x7084, in qla24xx_vport_create()
2123 vha->vp_idx); in qla24xx_vport_create()
2125 ql_dbg(ql_dbg_multiq, vha, 0xc001, in qla24xx_vport_create()
2127 ret, qos, vha->vp_idx); in qla24xx_vport_create()
2128 ql_dbg(ql_dbg_user, vha, 0x7085, in qla24xx_vport_create()
2130 ret, qos, vha->vp_idx); in qla24xx_vport_create()
2136 vha->req = req; in qla24xx_vport_create()
2140 qla24xx_disable_vp(vha); in qla24xx_vport_create()
2141 qla24xx_deallocate_vp_id(vha); in qla24xx_vport_create()
2142 scsi_host_put(vha->host); in qla24xx_vport_create()
2149 scsi_qla_host_t *vha = fc_vport->dd_data; in qla24xx_vport_delete() local
2150 struct qla_hw_data *ha = vha->hw; in qla24xx_vport_delete()
2151 uint16_t id = vha->vp_idx; in qla24xx_vport_delete()
2153 while (test_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags) || in qla24xx_vport_delete()
2154 test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags)) in qla24xx_vport_delete()
2157 qla24xx_disable_vp(vha); in qla24xx_vport_delete()
2159 vha->flags.delete_progress = 1; in qla24xx_vport_delete()
2161 qlt_remove_target(ha, vha); in qla24xx_vport_delete()
2163 fc_remove_host(vha->host); in qla24xx_vport_delete()
2165 scsi_remove_host(vha->host); in qla24xx_vport_delete()
2168 qla24xx_deallocate_vp_id(vha); in qla24xx_vport_delete()
2170 if (vha->timer_active) { in qla24xx_vport_delete()
2171 qla2x00_vp_stop_timer(vha); in qla24xx_vport_delete()
2172 ql_dbg(ql_dbg_user, vha, 0x7086, in qla24xx_vport_delete()
2173 "Timer for the VP[%d] has stopped\n", vha->vp_idx); in qla24xx_vport_delete()
2176 BUG_ON(atomic_read(&vha->vref_count)); in qla24xx_vport_delete()
2178 qla2x00_free_fcports(vha); in qla24xx_vport_delete()
2182 clear_bit(vha->vp_idx, ha->vp_idx_map); in qla24xx_vport_delete()
2185 if (vha->req->id && !ha->flags.cpu_affinity_enabled) { in qla24xx_vport_delete()
2186 if (qla25xx_delete_req_que(vha, vha->req) != QLA_SUCCESS) in qla24xx_vport_delete()
2187 ql_log(ql_log_warn, vha, 0x7087, in qla24xx_vport_delete()
2191 ql_log(ql_log_info, vha, 0x7088, "VP[%d] deleted.\n", id); in qla24xx_vport_delete()
2192 scsi_host_put(vha->host); in qla24xx_vport_delete()
2199 scsi_qla_host_t *vha = fc_vport->dd_data; in qla24xx_vport_disable() local
2202 qla24xx_disable_vp(vha); in qla24xx_vport_disable()
2204 qla24xx_enable_vp(vha); in qla24xx_vport_disable()
2302 qla2x00_init_host_attr(scsi_qla_host_t *vha) in qla2x00_init_host_attr() argument
2304 struct qla_hw_data *ha = vha->hw; in qla2x00_init_host_attr()
2307 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; in qla2x00_init_host_attr()
2308 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name); in qla2x00_init_host_attr()
2309 fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name); in qla2x00_init_host_attr()
2310 fc_host_supported_classes(vha->host) = ha->tgt.enable_class_2 ? in qla2x00_init_host_attr()
2312 fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; in qla2x00_init_host_attr()
2313 fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; in qla2x00_init_host_attr()
2336 fc_host_supported_speeds(vha->host) = speed; in qla2x00_init_host_attr()