Lines Matching refs:ha

25 	struct qla_hw_data *ha = vha->hw;  in qla2x00_sysfs_read_fw_dump()  local
28 if (!(ha->fw_dump_reading || ha->mctp_dump_reading || in qla2x00_sysfs_read_fw_dump()
29 ha->mpi_fw_dump_reading)) in qla2x00_sysfs_read_fw_dump()
32 mutex_lock(&ha->optrom_mutex); in qla2x00_sysfs_read_fw_dump()
33 if (IS_P3P_TYPE(ha)) { in qla2x00_sysfs_read_fw_dump()
34 if (off < ha->md_template_size) { in qla2x00_sysfs_read_fw_dump()
36 &off, ha->md_tmplt_hdr, ha->md_template_size); in qla2x00_sysfs_read_fw_dump()
38 off -= ha->md_template_size; in qla2x00_sysfs_read_fw_dump()
40 &off, ha->md_dump, ha->md_dump_size); in qla2x00_sysfs_read_fw_dump()
42 } else if (ha->mctp_dumped && ha->mctp_dump_reading) { in qla2x00_sysfs_read_fw_dump()
43 rval = memory_read_from_buffer(buf, count, &off, ha->mctp_dump, in qla2x00_sysfs_read_fw_dump()
45 } else if (ha->mpi_fw_dumped && ha->mpi_fw_dump_reading) { in qla2x00_sysfs_read_fw_dump()
47 ha->mpi_fw_dump, in qla2x00_sysfs_read_fw_dump()
48 ha->mpi_fw_dump_len); in qla2x00_sysfs_read_fw_dump()
49 } else if (ha->fw_dump_reading) { in qla2x00_sysfs_read_fw_dump()
50 rval = memory_read_from_buffer(buf, count, &off, ha->fw_dump, in qla2x00_sysfs_read_fw_dump()
51 ha->fw_dump_len); in qla2x00_sysfs_read_fw_dump()
55 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_read_fw_dump()
66 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_fw_dump() local
75 if (!ha->fw_dump_reading) in qla2x00_sysfs_write_fw_dump()
81 if (IS_P3P_TYPE(ha)) { in qla2x00_sysfs_write_fw_dump()
85 ha->fw_dump_reading = 0; in qla2x00_sysfs_write_fw_dump()
86 ha->fw_dumped = false; in qla2x00_sysfs_write_fw_dump()
89 if (ha->fw_dumped && !ha->fw_dump_reading) { in qla2x00_sysfs_write_fw_dump()
90 ha->fw_dump_reading = 1; in qla2x00_sysfs_write_fw_dump()
101 if (IS_QLA82XX(ha)) { in qla2x00_sysfs_write_fw_dump()
102 qla82xx_idc_lock(ha); in qla2x00_sysfs_write_fw_dump()
104 qla82xx_idc_unlock(ha); in qla2x00_sysfs_write_fw_dump()
105 } else if (IS_QLA8044(ha)) { in qla2x00_sysfs_write_fw_dump()
106 qla8044_idc_lock(ha); in qla2x00_sysfs_write_fw_dump()
108 qla8044_idc_unlock(ha); in qla2x00_sysfs_write_fw_dump()
114 if (IS_P3P_TYPE(ha)) { in qla2x00_sysfs_write_fw_dump()
115 if (ha->md_tmplt_hdr) in qla2x00_sysfs_write_fw_dump()
124 if (IS_P3P_TYPE(ha)) in qla2x00_sysfs_write_fw_dump()
128 if (!ha->mctp_dump_reading) in qla2x00_sysfs_write_fw_dump()
132 ha->mctp_dump_reading = 0; in qla2x00_sysfs_write_fw_dump()
133 ha->mctp_dumped = 0; in qla2x00_sysfs_write_fw_dump()
136 if (ha->mctp_dumped && !ha->mctp_dump_reading) { in qla2x00_sysfs_write_fw_dump()
137 ha->mctp_dump_reading = 1; in qla2x00_sysfs_write_fw_dump()
144 if (!ha->mpi_fw_dump_reading) in qla2x00_sysfs_write_fw_dump()
148 ha->mpi_fw_dump_reading = 0; in qla2x00_sysfs_write_fw_dump()
149 ha->mpi_fw_dumped = 0; in qla2x00_sysfs_write_fw_dump()
152 if (ha->mpi_fw_dumped && !ha->mpi_fw_dump_reading) { in qla2x00_sysfs_write_fw_dump()
153 ha->mpi_fw_dump_reading = 1; in qla2x00_sysfs_write_fw_dump()
160 if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) { in qla2x00_sysfs_write_fw_dump()
164 ha->isp_ops->mpi_fw_dump(vha, 0); in qla2x00_sysfs_write_fw_dump()
188 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_nvram() local
195 mutex_lock(&ha->optrom_mutex); in qla2x00_sysfs_read_nvram()
197 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_read_nvram()
201 if (!IS_NOCACHE_VPD_TYPE(ha)) { in qla2x00_sysfs_read_nvram()
202 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_read_nvram()
206 faddr = ha->flt_region_nvram; in qla2x00_sysfs_read_nvram()
207 if (IS_QLA28XX(ha)) { in qla2x00_sysfs_read_nvram()
210 faddr = ha->flt_region_nvram_sec; in qla2x00_sysfs_read_nvram()
212 ha->isp_ops->read_optrom(vha, ha->nvram, faddr << 2, ha->nvram_size); in qla2x00_sysfs_read_nvram()
214 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_read_nvram()
217 return memory_read_from_buffer(buf, count, &off, ha->nvram, in qla2x00_sysfs_read_nvram()
218 ha->nvram_size); in qla2x00_sysfs_read_nvram()
228 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_nvram() local
231 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->nvram_size || in qla2x00_sysfs_write_nvram()
232 !ha->isp_ops->write_nvram) in qla2x00_sysfs_write_nvram()
236 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_sysfs_write_nvram()
263 mutex_lock(&ha->optrom_mutex); in qla2x00_sysfs_write_nvram()
265 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_nvram()
270 ha->isp_ops->write_nvram(vha, buf, ha->nvram_base, count); in qla2x00_sysfs_write_nvram()
271 ha->isp_ops->read_nvram(vha, ha->nvram, ha->nvram_base, in qla2x00_sysfs_write_nvram()
273 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_nvram()
302 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_optrom() local
305 mutex_lock(&ha->optrom_mutex); in qla2x00_sysfs_read_optrom()
307 if (ha->optrom_state != QLA_SREADING) in qla2x00_sysfs_read_optrom()
310 rval = memory_read_from_buffer(buf, count, &off, ha->optrom_buffer, in qla2x00_sysfs_read_optrom()
311 ha->optrom_region_size); in qla2x00_sysfs_read_optrom()
314 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_read_optrom()
326 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom() local
328 mutex_lock(&ha->optrom_mutex); in qla2x00_sysfs_write_optrom()
330 if (ha->optrom_state != QLA_SWRITING) { in qla2x00_sysfs_write_optrom()
331 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_optrom()
334 if (off > ha->optrom_region_size) { in qla2x00_sysfs_write_optrom()
335 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_optrom()
338 if (off + count > ha->optrom_region_size) in qla2x00_sysfs_write_optrom()
339 count = ha->optrom_region_size - off; in qla2x00_sysfs_write_optrom()
341 memcpy(&ha->optrom_buffer[off], buf, count); in qla2x00_sysfs_write_optrom()
342 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_optrom()
364 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom_ctl() local
366 uint32_t size = ha->optrom_size; in qla2x00_sysfs_write_optrom_ctl()
373 if (unlikely(pci_channel_offline(ha->pdev))) in qla2x00_sysfs_write_optrom_ctl()
378 if (start > ha->optrom_size) in qla2x00_sysfs_write_optrom_ctl()
380 if (size > ha->optrom_size - start) in qla2x00_sysfs_write_optrom_ctl()
381 size = ha->optrom_size - start; in qla2x00_sysfs_write_optrom_ctl()
383 mutex_lock(&ha->optrom_mutex); in qla2x00_sysfs_write_optrom_ctl()
385 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_optrom_ctl()
390 if (ha->optrom_state != QLA_SREADING && in qla2x00_sysfs_write_optrom_ctl()
391 ha->optrom_state != QLA_SWRITING) { in qla2x00_sysfs_write_optrom_ctl()
395 ha->optrom_state = QLA_SWAITING; in qla2x00_sysfs_write_optrom_ctl()
399 ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
401 vfree(ha->optrom_buffer); in qla2x00_sysfs_write_optrom_ctl()
402 ha->optrom_buffer = NULL; in qla2x00_sysfs_write_optrom_ctl()
405 if (ha->optrom_state != QLA_SWAITING) { in qla2x00_sysfs_write_optrom_ctl()
410 ha->optrom_region_start = start; in qla2x00_sysfs_write_optrom_ctl()
411 ha->optrom_region_size = size; in qla2x00_sysfs_write_optrom_ctl()
413 ha->optrom_state = QLA_SREADING; in qla2x00_sysfs_write_optrom_ctl()
414 ha->optrom_buffer = vzalloc(ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
415 if (ha->optrom_buffer == NULL) { in qla2x00_sysfs_write_optrom_ctl()
418 "(%x).\n", ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
420 ha->optrom_state = QLA_SWAITING; in qla2x00_sysfs_write_optrom_ctl()
434 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
436 ha->isp_ops->read_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
437 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
440 if (ha->optrom_state != QLA_SWAITING) { in qla2x00_sysfs_write_optrom_ctl()
470 if (ha->optrom_size == OPTROM_SIZE_2300 && start == 0) in qla2x00_sysfs_write_optrom_ctl()
472 else if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)) in qla2x00_sysfs_write_optrom_ctl()
481 ha->optrom_region_start = start; in qla2x00_sysfs_write_optrom_ctl()
482 ha->optrom_region_size = size; in qla2x00_sysfs_write_optrom_ctl()
484 ha->optrom_state = QLA_SWRITING; in qla2x00_sysfs_write_optrom_ctl()
485 ha->optrom_buffer = vzalloc(ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
486 if (ha->optrom_buffer == NULL) { in qla2x00_sysfs_write_optrom_ctl()
489 "(%x)\n", ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
491 ha->optrom_state = QLA_SWAITING; in qla2x00_sysfs_write_optrom_ctl()
498 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
502 if (ha->optrom_state != QLA_SWRITING) { in qla2x00_sysfs_write_optrom_ctl()
516 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
518 rval = ha->isp_ops->write_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
519 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
528 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_optrom_ctl()
548 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_vpd() local
552 if (unlikely(pci_channel_offline(ha->pdev))) in qla2x00_sysfs_read_vpd()
558 if (!IS_NOCACHE_VPD_TYPE(ha)) in qla2x00_sysfs_read_vpd()
561 faddr = ha->flt_region_vpd << 2; in qla2x00_sysfs_read_vpd()
563 if (IS_QLA28XX(ha)) { in qla2x00_sysfs_read_vpd()
566 faddr = ha->flt_region_vpd_sec << 2; in qla2x00_sysfs_read_vpd()
574 mutex_lock(&ha->optrom_mutex); in qla2x00_sysfs_read_vpd()
576 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_read_vpd()
580 ha->isp_ops->read_optrom(vha, ha->vpd, faddr, ha->vpd_size); in qla2x00_sysfs_read_vpd()
581 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_read_vpd()
583 ha->isp_ops->read_optrom(vha, ha->vpd, faddr, ha->vpd_size); in qla2x00_sysfs_read_vpd()
585 return memory_read_from_buffer(buf, count, &off, ha->vpd, ha->vpd_size); in qla2x00_sysfs_read_vpd()
595 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_vpd() local
598 if (unlikely(pci_channel_offline(ha->pdev))) in qla2x00_sysfs_write_vpd()
604 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size || in qla2x00_sysfs_write_vpd()
605 !ha->isp_ops->write_nvram) in qla2x00_sysfs_write_vpd()
614 mutex_lock(&ha->optrom_mutex); in qla2x00_sysfs_write_vpd()
616 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_vpd()
621 ha->isp_ops->write_nvram(vha, buf, ha->vpd_base, count); in qla2x00_sysfs_write_vpd()
622 ha->isp_ops->read_nvram(vha, ha->vpd, ha->vpd_base, count); in qla2x00_sysfs_write_vpd()
625 if (!IS_FWI2_CAPABLE(ha)) { in qla2x00_sysfs_write_vpd()
626 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_vpd()
632 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_vpd()
637 ha->isp_ops->get_flash_version(vha, tmp_data); in qla2x00_sysfs_write_vpd()
640 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_vpd()
698 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_reset() local
699 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); in qla2x00_sysfs_write_reset()
720 if (IS_QLA82XX(ha)) { in qla2x00_sysfs_write_reset()
721 ha->flags.isp82xx_no_md_cap = 1; in qla2x00_sysfs_write_reset()
722 qla82xx_idc_lock(ha); in qla2x00_sysfs_write_reset()
724 qla82xx_idc_unlock(ha); in qla2x00_sysfs_write_reset()
725 } else if (IS_QLA8044(ha)) { in qla2x00_sysfs_write_reset()
726 qla8044_idc_lock(ha); in qla2x00_sysfs_write_reset()
727 idc_control = qla8044_rd_reg(ha, in qla2x00_sysfs_write_reset()
729 qla8044_wr_reg(ha, QLA8044_IDC_DRV_CTRL, in qla2x00_sysfs_write_reset()
732 qla8044_idc_unlock(ha); in qla2x00_sysfs_write_reset()
741 if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha) && in qla2x00_sysfs_write_reset()
742 !IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_sysfs_write_reset()
748 if (IS_QLA83XX(ha)) { in qla2x00_sysfs_write_reset()
775 if (!IS_P3P_TYPE(ha) || vha != base_vha) { in qla2x00_sysfs_write_reset()
788 if (!IS_QLA8031(ha)) in qla2x00_sysfs_write_reset()
799 if (!IS_QLA8031(ha)) in qla2x00_sysfs_write_reset()
819 ha->isp_ops->get_flash_version(vha, tmp_data); in qla2x00_sysfs_write_reset()
885 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_xgmac_stats() local
892 if (unlikely(pci_channel_offline(ha->pdev))) in qla2x00_sysfs_read_xgmac_stats()
900 if (ha->xgmac_data) in qla2x00_sysfs_read_xgmac_stats()
903 ha->xgmac_data = dma_alloc_coherent(&ha->pdev->dev, XGMAC_DATA_SIZE, in qla2x00_sysfs_read_xgmac_stats()
904 &ha->xgmac_data_dma, GFP_KERNEL); in qla2x00_sysfs_read_xgmac_stats()
905 if (!ha->xgmac_data) { in qla2x00_sysfs_read_xgmac_stats()
914 memset(ha->xgmac_data, 0, XGMAC_DATA_SIZE); in qla2x00_sysfs_read_xgmac_stats()
916 rval = qla2x00_get_xgmac_stats(vha, ha->xgmac_data_dma, in qla2x00_sysfs_read_xgmac_stats()
927 memcpy(buf, ha->xgmac_data, count); in qla2x00_sysfs_read_xgmac_stats()
948 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_dcbx_tlv() local
955 if (ha->dcbx_tlv) in qla2x00_sysfs_read_dcbx_tlv()
962 ha->dcbx_tlv = dma_alloc_coherent(&ha->pdev->dev, DCBX_TLV_DATA_SIZE, in qla2x00_sysfs_read_dcbx_tlv()
963 &ha->dcbx_tlv_dma, GFP_KERNEL); in qla2x00_sysfs_read_dcbx_tlv()
964 if (!ha->dcbx_tlv) { in qla2x00_sysfs_read_dcbx_tlv()
972 memset(ha->dcbx_tlv, 0, DCBX_TLV_DATA_SIZE); in qla2x00_sysfs_read_dcbx_tlv()
974 rval = qla2x00_get_dcbx_params(vha, ha->dcbx_tlv_dma, in qla2x00_sysfs_read_dcbx_tlv()
985 memcpy(buf, ha->dcbx_tlv, count); in qla2x00_sysfs_read_dcbx_tlv()
1050 struct qla_hw_data *ha = vha->hw; in qla2x00_free_sysfs_attr() local
1053 if (iter->type && !IS_FWI2_CAPABLE(ha)) in qla2x00_free_sysfs_attr()
1055 if (iter->type == 2 && !IS_QLA25XX(ha)) in qla2x00_free_sysfs_attr()
1057 if (iter->type == 3 && !(IS_CNA_CAPABLE(ha))) in qla2x00_free_sysfs_attr()
1064 if (stop_beacon && ha->beacon_blink_led == 1) in qla2x00_free_sysfs_attr()
1065 ha->isp_ops->beacon_off(vha); in qla2x00_free_sysfs_attr()
1082 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_version_show() local
1086 ha->isp_ops->fw_version_str(vha, fw_str, sizeof(fw_str))); in qla2x00_fw_version_show()
1094 struct qla_hw_data *ha = vha->hw; in qla2x00_serial_num_show() local
1100 } else if (IS_FWI2_CAPABLE(ha)) { in qla2x00_serial_num_show()
1105 sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1; in qla2x00_serial_num_show()
1124 struct qla_hw_data *ha = vha->hw; in qla2x00_isp_id_show() local
1131 ha->product_id[0], ha->product_id[1], ha->product_id[2], in qla2x00_isp_id_show()
1132 ha->product_id[3]); in qla2x00_isp_id_show()
1170 struct qla_hw_data *ha = vha->hw; in qla2x00_link_state_show() local
1183 switch (ha->current_topology) { in qla2x00_link_state_show()
1228 struct qla_hw_data *ha = vha->hw; in qla2x00_zio_store() local
1232 if (!IS_ZIO_SUPPORTED(ha)) in qla2x00_zio_store()
1244 if (zio_mode != QLA_ZIO_DISABLED || ha->zio_mode != QLA_ZIO_DISABLED) { in qla2x00_zio_store()
1245 ha->zio_mode = zio_mode; in qla2x00_zio_store()
1326 struct qla_hw_data *ha = vha->hw; in qla2x00_beacon_store() local
1330 if (IS_QLA2100(ha) || IS_QLA2200(ha)) in qla2x00_beacon_store()
1345 rval = ha->isp_ops->beacon_on(vha); in qla2x00_beacon_store()
1347 rval = ha->isp_ops->beacon_off(vha); in qla2x00_beacon_store()
1362 struct qla_hw_data *ha = vha->hw; in qla2x00_beacon_config_show() local
1365 if (!IS_QLA2031(ha) && !IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_beacon_config_show()
1380 struct qla_hw_data *ha = vha->hw; in qla2x00_beacon_config_store() local
1386 if (!IS_QLA2031(ha) && !IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_beacon_config_store()
1435 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_bios_version_show() local
1437 return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->bios_revision[1], in qla2x00_optrom_bios_version_show()
1438 ha->bios_revision[0]); in qla2x00_optrom_bios_version_show()
1446 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_efi_version_show() local
1448 return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->efi_revision[1], in qla2x00_optrom_efi_version_show()
1449 ha->efi_revision[0]); in qla2x00_optrom_efi_version_show()
1457 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fcode_version_show() local
1459 return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fcode_revision[1], in qla2x00_optrom_fcode_version_show()
1460 ha->fcode_revision[0]); in qla2x00_optrom_fcode_version_show()
1468 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fw_version_show() local
1471 ha->fw_revision[0], ha->fw_revision[1], ha->fw_revision[2], in qla2x00_optrom_fw_version_show()
1472 ha->fw_revision[3]); in qla2x00_optrom_fw_version_show()
1480 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_gold_fw_version_show() local
1482 if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha) && in qla2x00_optrom_gold_fw_version_show()
1483 !IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_optrom_gold_fw_version_show()
1487 ha->gold_fw_version[0], ha->gold_fw_version[1], in qla2x00_optrom_gold_fw_version_show()
1488 ha->gold_fw_version[2], ha->gold_fw_version[3]); in qla2x00_optrom_gold_fw_version_show()
1508 struct qla_hw_data *ha = vha->hw; in qla24xx_84xx_fw_version_show() local
1510 if (!IS_QLA84XX(ha)) in qla24xx_84xx_fw_version_show()
1513 if (!ha->cs84xx->op_fw_version) { in qla24xx_84xx_fw_version_show()
1518 (uint32_t)ha->cs84xx->op_fw_version); in qla24xx_84xx_fw_version_show()
1529 struct qla_hw_data *ha = vha->hw; in qla2x00_serdes_version_show() local
1531 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_serdes_version_show()
1535 ha->serdes_version[0], ha->serdes_version[1], in qla2x00_serdes_version_show()
1536 ha->serdes_version[2]); in qla2x00_serdes_version_show()
1544 struct qla_hw_data *ha = vha->hw; in qla2x00_mpi_version_show() local
1546 if (!IS_QLA81XX(ha) && !IS_QLA8031(ha) && !IS_QLA8044(ha) && in qla2x00_mpi_version_show()
1547 !IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_mpi_version_show()
1551 ha->mpi_version[0], ha->mpi_version[1], ha->mpi_version[2], in qla2x00_mpi_version_show()
1552 ha->mpi_capabilities); in qla2x00_mpi_version_show()
1560 struct qla_hw_data *ha = vha->hw; in qla2x00_phy_version_show() local
1562 if (!IS_QLA81XX(ha) && !IS_QLA8031(ha)) in qla2x00_phy_version_show()
1566 ha->phy_version[0], ha->phy_version[1], ha->phy_version[2]); in qla2x00_phy_version_show()
1574 struct qla_hw_data *ha = vha->hw; in qla2x00_flash_block_size_show() local
1576 return scnprintf(buf, PAGE_SIZE, "0x%x\n", ha->fdt_block_size); in qla2x00_flash_block_size_show()
1709 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_dump_size_show() local
1712 if (!ha->fw_dumped) in qla2x00_fw_dump_size_show()
1714 else if (IS_P3P_TYPE(ha)) in qla2x00_fw_dump_size_show()
1715 size = ha->md_template_size + ha->md_dump_size; in qla2x00_fw_dump_size_show()
1717 size = ha->fw_dump_len; in qla2x00_fw_dump_size_show()
1758 struct qla_hw_data *ha = vha->hw; in qla2x00_pep_version_show() local
1760 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_pep_version_show()
1764 ha->pep_version[0], ha->pep_version[1], ha->pep_version[2]); in qla2x00_pep_version_show()
1772 struct qla_hw_data *ha = vha->hw; in qla2x00_min_supported_speed_show() local
1774 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_min_supported_speed_show()
1778 ha->min_supported_speed == 6 ? "64Gps" : in qla2x00_min_supported_speed_show()
1779 ha->min_supported_speed == 5 ? "32Gps" : in qla2x00_min_supported_speed_show()
1780 ha->min_supported_speed == 4 ? "16Gps" : in qla2x00_min_supported_speed_show()
1781 ha->min_supported_speed == 3 ? "8Gps" : in qla2x00_min_supported_speed_show()
1782 ha->min_supported_speed == 2 ? "4Gps" : in qla2x00_min_supported_speed_show()
1783 ha->min_supported_speed != 0 ? "unknown" : ""); in qla2x00_min_supported_speed_show()
1791 struct qla_hw_data *ha = vha->hw; in qla2x00_max_supported_speed_show() local
1793 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_max_supported_speed_show()
1797 ha->max_supported_speed == 2 ? "64Gps" : in qla2x00_max_supported_speed_show()
1798 ha->max_supported_speed == 1 ? "32Gps" : in qla2x00_max_supported_speed_show()
1799 ha->max_supported_speed == 0 ? "16Gps" : "unknown"); in qla2x00_max_supported_speed_show()
1810 struct qla_hw_data *ha = vha->hw; in qla2x00_port_speed_store() local
1812 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) { in qla2x00_port_speed_store()
1830 oldspeed = ha->set_data_rate; in qla2x00_port_speed_store()
1834 ha->set_data_rate = PORT_SPEED_AUTO; in qla2x00_port_speed_store()
1837 ha->set_data_rate = PORT_SPEED_4GB; in qla2x00_port_speed_store()
1840 ha->set_data_rate = PORT_SPEED_8GB; in qla2x00_port_speed_store()
1843 ha->set_data_rate = PORT_SPEED_16GB; in qla2x00_port_speed_store()
1846 ha->set_data_rate = PORT_SPEED_32GB; in qla2x00_port_speed_store()
1852 ha->set_data_rate = PORT_SPEED_AUTO; in qla2x00_port_speed_store()
1855 if (qla2x00_chip_is_down(vha) || (oldspeed == ha->set_data_rate)) in qla2x00_port_speed_store()
1885 struct qla_hw_data *ha = vha->hw; in qla2x00_port_speed_show() local
1898 if (port_speed_str[i].rate != ha->link_data_rate) in qla2x00_port_speed_show()
2360 struct qla_hw_data *ha = vha->hw; in qla2x00_dif_bundle_statistics_show() local
2364 ha->dif_bundle_crossed_pages, ha->dif_bundle_reads, in qla2x00_dif_bundle_statistics_show()
2365 ha->dif_bundle_writes, ha->dif_bundle_kallocs, in qla2x00_dif_bundle_statistics_show()
2366 ha->dif_bundle_dma_allocs, ha->pool.unusable.count); in qla2x00_dif_bundle_statistics_show()
2374 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_attr_show() local
2376 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_fw_attr_show()
2380 (uint64_t)ha->fw_attributes_ext[1] << 48 | in qla2x00_fw_attr_show()
2381 (uint64_t)ha->fw_attributes_ext[0] << 32 | in qla2x00_fw_attr_show()
2382 (uint64_t)ha->fw_attributes_h << 16 | in qla2x00_fw_attr_show()
2383 (uint64_t)ha->fw_attributes); in qla2x00_fw_attr_show()
2823 struct qla_hw_data *ha = vha->hw; in qla2x00_get_fc_host_stats() local
2824 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); in qla2x00_get_fc_host_stats()
2841 if (unlikely(pci_channel_offline(ha->pdev))) in qla2x00_get_fc_host_stats()
2847 stats = dma_alloc_coherent(&ha->pdev->dev, sizeof(*stats), &stats_dma, in qla2x00_get_fc_host_stats()
2856 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_get_fc_host_stats()
2859 !ha->dpc_active) { in qla2x00_get_fc_host_stats()
2878 ir += ha->base_qpair->counters.input_requests; in qla2x00_get_fc_host_stats()
2879 or += ha->base_qpair->counters.output_requests; in qla2x00_get_fc_host_stats()
2880 ib += ha->base_qpair->counters.input_bytes; in qla2x00_get_fc_host_stats()
2881 ob += ha->base_qpair->counters.output_bytes; in qla2x00_get_fc_host_stats()
2895 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_get_fc_host_stats()
2904 if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) { in qla2x00_get_fc_host_stats()
2923 dma_free_coherent(&ha->pdev->dev, sizeof(struct link_statistics), in qla2x00_get_fc_host_stats()
2933 struct qla_hw_data *ha = vha->hw; in qla2x00_reset_host_stats() local
2934 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); in qla2x00_reset_host_stats()
2948 memset(&ha->base_qpair->counters, 0, sizeof(qpair->counters)); in qla2x00_reset_host_stats()
2952 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_reset_host_stats()
2955 stats = dma_alloc_coherent(&ha->pdev->dev, in qla2x00_reset_host_stats()
2970 dma_free_coherent(&ha->pdev->dev, sizeof(*stats), in qla2x00_reset_host_stats()
3047 struct qla_hw_data *ha = base_vha->hw; in qla24xx_vport_create() local
3049 struct req_que *req = ha->req_q_map[0]; in qla24xx_vport_create()
3089 if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) { in qla24xx_vport_create()
3090 if (ha->fw_attributes & BIT_4) { in qla24xx_vport_create()
3106 if (IS_PI_IPGUARD_CAPABLE(ha) && in qla24xx_vport_create()
3107 (ql2xenabledif > 1 || IS_PI_DIFB_DIX0_CAPABLE(ha))) in qla24xx_vport_create()
3116 &ha->pdev->dev)) { in qla24xx_vport_create()
3123 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; in qla24xx_vport_create()
3131 qlt_vport_create(vha, ha); in qla24xx_vport_create()
3134 if (!ql2xmqsupport || !ha->npiv_info) in qla24xx_vport_create()
3138 for (cnt = 0; cnt < ha->nvram_npiv_size; cnt++) { in qla24xx_vport_create()
3139 if (memcmp(ha->npiv_info[cnt].port_name, vha->port_name, 8) == 0 in qla24xx_vport_create()
3140 && memcmp(ha->npiv_info[cnt].node_name, vha->node_name, in qla24xx_vport_create()
3142 qos = ha->npiv_info[cnt].q_qos; in qla24xx_vport_create()
3180 struct qla_hw_data *ha = vha->hw; in qla24xx_vport_delete() local
3198 qlt_remove_target(ha, vha); in qla24xx_vport_delete()
3215 mutex_lock(&ha->vport_lock); in qla24xx_vport_delete()
3216 ha->cur_vport_count--; in qla24xx_vport_delete()
3217 clear_bit(vha->vp_idx, ha->vp_idx_map); in qla24xx_vport_delete()
3218 mutex_unlock(&ha->vport_lock); in qla24xx_vport_delete()
3220 dma_free_coherent(&ha->pdev->dev, vha->gnl.size, vha->gnl.l, in qla24xx_vport_delete()
3369 struct qla_hw_data *ha = vha->hw; in qla2x00_init_host_attr() local
3372 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; in qla2x00_init_host_attr()
3375 fc_host_supported_classes(vha->host) = ha->base_qpair->enable_class_2 ? in qla2x00_init_host_attr()
3377 fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; in qla2x00_init_host_attr()
3378 fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; in qla2x00_init_host_attr()
3380 fdmi_speed = qla25xx_fdmi_port_speed_capability(ha); in qla2x00_init_host_attr()