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) || IS_QLA27XX(ha) || IS_QLA28XX(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
954 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()
1060 (!IS_QLA27XX(ha) || !IS_QLA28XX(ha))) in qla2x00_free_sysfs_attr()
1067 if (stop_beacon && ha->beacon_blink_led == 1) in qla2x00_free_sysfs_attr()
1068 ha->isp_ops->beacon_off(vha); in qla2x00_free_sysfs_attr()
1085 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_version_show() local
1089 ha->isp_ops->fw_version_str(vha, fw_str, sizeof(fw_str))); in qla2x00_fw_version_show()
1097 struct qla_hw_data *ha = vha->hw; in qla2x00_serial_num_show() local
1103 } else if (IS_FWI2_CAPABLE(ha)) { in qla2x00_serial_num_show()
1108 sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1; in qla2x00_serial_num_show()
1127 struct qla_hw_data *ha = vha->hw; in qla2x00_isp_id_show() local
1134 ha->product_id[0], ha->product_id[1], ha->product_id[2], in qla2x00_isp_id_show()
1135 ha->product_id[3]); in qla2x00_isp_id_show()
1173 struct qla_hw_data *ha = vha->hw; in qla2x00_link_state_show() local
1186 switch (ha->current_topology) { in qla2x00_link_state_show()
1231 struct qla_hw_data *ha = vha->hw; in qla2x00_zio_store() local
1235 if (!IS_ZIO_SUPPORTED(ha)) in qla2x00_zio_store()
1247 if (zio_mode != QLA_ZIO_DISABLED || ha->zio_mode != QLA_ZIO_DISABLED) { in qla2x00_zio_store()
1248 ha->zio_mode = zio_mode; in qla2x00_zio_store()
1329 struct qla_hw_data *ha = vha->hw; in qla2x00_beacon_store() local
1333 if (IS_QLA2100(ha) || IS_QLA2200(ha)) in qla2x00_beacon_store()
1348 rval = ha->isp_ops->beacon_on(vha); in qla2x00_beacon_store()
1350 rval = ha->isp_ops->beacon_off(vha); in qla2x00_beacon_store()
1365 struct qla_hw_data *ha = vha->hw; in qla2x00_beacon_config_show() local
1368 if (!IS_QLA2031(ha) && !IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_beacon_config_show()
1383 struct qla_hw_data *ha = vha->hw; in qla2x00_beacon_config_store() local
1389 if (!IS_QLA2031(ha) && !IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_beacon_config_store()
1438 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_bios_version_show() local
1440 return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->bios_revision[1], in qla2x00_optrom_bios_version_show()
1441 ha->bios_revision[0]); in qla2x00_optrom_bios_version_show()
1449 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_efi_version_show() local
1451 return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->efi_revision[1], in qla2x00_optrom_efi_version_show()
1452 ha->efi_revision[0]); in qla2x00_optrom_efi_version_show()
1460 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fcode_version_show() local
1462 return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fcode_revision[1], in qla2x00_optrom_fcode_version_show()
1463 ha->fcode_revision[0]); in qla2x00_optrom_fcode_version_show()
1471 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fw_version_show() local
1474 ha->fw_revision[0], ha->fw_revision[1], ha->fw_revision[2], in qla2x00_optrom_fw_version_show()
1475 ha->fw_revision[3]); in qla2x00_optrom_fw_version_show()
1483 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_gold_fw_version_show() local
1485 if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha) && in qla2x00_optrom_gold_fw_version_show()
1486 !IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_optrom_gold_fw_version_show()
1490 ha->gold_fw_version[0], ha->gold_fw_version[1], in qla2x00_optrom_gold_fw_version_show()
1491 ha->gold_fw_version[2], ha->gold_fw_version[3]); in qla2x00_optrom_gold_fw_version_show()
1511 struct qla_hw_data *ha = vha->hw; in qla24xx_84xx_fw_version_show() local
1513 if (!IS_QLA84XX(ha)) in qla24xx_84xx_fw_version_show()
1516 if (!ha->cs84xx->op_fw_version) { in qla24xx_84xx_fw_version_show()
1521 (uint32_t)ha->cs84xx->op_fw_version); in qla24xx_84xx_fw_version_show()
1532 struct qla_hw_data *ha = vha->hw; in qla2x00_serdes_version_show() local
1534 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_serdes_version_show()
1538 ha->serdes_version[0], ha->serdes_version[1], in qla2x00_serdes_version_show()
1539 ha->serdes_version[2]); in qla2x00_serdes_version_show()
1547 struct qla_hw_data *ha = vha->hw; in qla2x00_mpi_version_show() local
1549 if (!IS_QLA81XX(ha) && !IS_QLA8031(ha) && !IS_QLA8044(ha) && in qla2x00_mpi_version_show()
1550 !IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_mpi_version_show()
1554 ha->mpi_version[0], ha->mpi_version[1], ha->mpi_version[2], in qla2x00_mpi_version_show()
1555 ha->mpi_capabilities); in qla2x00_mpi_version_show()
1563 struct qla_hw_data *ha = vha->hw; in qla2x00_phy_version_show() local
1565 if (!IS_QLA81XX(ha) && !IS_QLA8031(ha)) in qla2x00_phy_version_show()
1569 ha->phy_version[0], ha->phy_version[1], ha->phy_version[2]); in qla2x00_phy_version_show()
1577 struct qla_hw_data *ha = vha->hw; in qla2x00_flash_block_size_show() local
1579 return scnprintf(buf, PAGE_SIZE, "0x%x\n", ha->fdt_block_size); in qla2x00_flash_block_size_show()
1712 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_dump_size_show() local
1715 if (!ha->fw_dumped) in qla2x00_fw_dump_size_show()
1717 else if (IS_P3P_TYPE(ha)) in qla2x00_fw_dump_size_show()
1718 size = ha->md_template_size + ha->md_dump_size; in qla2x00_fw_dump_size_show()
1720 size = ha->fw_dump_len; in qla2x00_fw_dump_size_show()
1761 struct qla_hw_data *ha = vha->hw; in qla2x00_pep_version_show() local
1763 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_pep_version_show()
1767 ha->pep_version[0], ha->pep_version[1], ha->pep_version[2]); in qla2x00_pep_version_show()
1775 struct qla_hw_data *ha = vha->hw; in qla2x00_min_supported_speed_show() local
1777 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_min_supported_speed_show()
1781 ha->min_supported_speed == 6 ? "64Gps" : in qla2x00_min_supported_speed_show()
1782 ha->min_supported_speed == 5 ? "32Gps" : in qla2x00_min_supported_speed_show()
1783 ha->min_supported_speed == 4 ? "16Gps" : in qla2x00_min_supported_speed_show()
1784 ha->min_supported_speed == 3 ? "8Gps" : in qla2x00_min_supported_speed_show()
1785 ha->min_supported_speed == 2 ? "4Gps" : in qla2x00_min_supported_speed_show()
1786 ha->min_supported_speed != 0 ? "unknown" : ""); in qla2x00_min_supported_speed_show()
1794 struct qla_hw_data *ha = vha->hw; in qla2x00_max_supported_speed_show() local
1796 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_max_supported_speed_show()
1800 ha->max_supported_speed == 2 ? "64Gps" : in qla2x00_max_supported_speed_show()
1801 ha->max_supported_speed == 1 ? "32Gps" : in qla2x00_max_supported_speed_show()
1802 ha->max_supported_speed == 0 ? "16Gps" : "unknown"); in qla2x00_max_supported_speed_show()
1813 struct qla_hw_data *ha = vha->hw; in qla2x00_port_speed_store() local
1815 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) { in qla2x00_port_speed_store()
1833 oldspeed = ha->set_data_rate; in qla2x00_port_speed_store()
1837 ha->set_data_rate = PORT_SPEED_AUTO; in qla2x00_port_speed_store()
1840 ha->set_data_rate = PORT_SPEED_4GB; in qla2x00_port_speed_store()
1843 ha->set_data_rate = PORT_SPEED_8GB; in qla2x00_port_speed_store()
1846 ha->set_data_rate = PORT_SPEED_16GB; in qla2x00_port_speed_store()
1849 ha->set_data_rate = PORT_SPEED_32GB; in qla2x00_port_speed_store()
1855 ha->set_data_rate = PORT_SPEED_AUTO; in qla2x00_port_speed_store()
1858 if (qla2x00_chip_is_down(vha) || (oldspeed == ha->set_data_rate)) in qla2x00_port_speed_store()
1888 struct qla_hw_data *ha = vha->hw; in qla2x00_port_speed_show() local
1901 if (port_speed_str[i].rate != ha->link_data_rate) in qla2x00_port_speed_show()
2363 struct qla_hw_data *ha = vha->hw; in qla2x00_dif_bundle_statistics_show() local
2367 ha->dif_bundle_crossed_pages, ha->dif_bundle_reads, in qla2x00_dif_bundle_statistics_show()
2368 ha->dif_bundle_writes, ha->dif_bundle_kallocs, in qla2x00_dif_bundle_statistics_show()
2369 ha->dif_bundle_dma_allocs, ha->pool.unusable.count); in qla2x00_dif_bundle_statistics_show()
2377 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_attr_show() local
2379 if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) in qla2x00_fw_attr_show()
2383 (uint64_t)ha->fw_attributes_ext[1] << 48 | in qla2x00_fw_attr_show()
2384 (uint64_t)ha->fw_attributes_ext[0] << 32 | in qla2x00_fw_attr_show()
2385 (uint64_t)ha->fw_attributes_h << 16 | in qla2x00_fw_attr_show()
2386 (uint64_t)ha->fw_attributes); in qla2x00_fw_attr_show()
2796 struct qla_hw_data *ha = vha->hw; in qla2x00_get_fc_host_stats() local
2797 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); in qla2x00_get_fc_host_stats()
2814 if (unlikely(pci_channel_offline(ha->pdev))) in qla2x00_get_fc_host_stats()
2820 stats = dma_alloc_coherent(&ha->pdev->dev, sizeof(*stats), &stats_dma, in qla2x00_get_fc_host_stats()
2829 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_get_fc_host_stats()
2832 !ha->dpc_active) { in qla2x00_get_fc_host_stats()
2851 ir += ha->base_qpair->counters.input_requests; in qla2x00_get_fc_host_stats()
2852 or += ha->base_qpair->counters.output_requests; in qla2x00_get_fc_host_stats()
2853 ib += ha->base_qpair->counters.input_bytes; in qla2x00_get_fc_host_stats()
2854 ob += ha->base_qpair->counters.output_bytes; in qla2x00_get_fc_host_stats()
2868 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_get_fc_host_stats()
2877 if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) { in qla2x00_get_fc_host_stats()
2896 dma_free_coherent(&ha->pdev->dev, sizeof(struct link_statistics), in qla2x00_get_fc_host_stats()
2906 struct qla_hw_data *ha = vha->hw; in qla2x00_reset_host_stats() local
2907 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); in qla2x00_reset_host_stats()
2921 memset(&ha->base_qpair->counters, 0, sizeof(qpair->counters)); in qla2x00_reset_host_stats()
2925 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_reset_host_stats()
2928 stats = dma_alloc_coherent(&ha->pdev->dev, in qla2x00_reset_host_stats()
2943 dma_free_coherent(&ha->pdev->dev, sizeof(*stats), in qla2x00_reset_host_stats()
3020 struct qla_hw_data *ha = base_vha->hw; in qla24xx_vport_create() local
3022 struct req_que *req = ha->req_q_map[0]; in qla24xx_vport_create()
3062 if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) { in qla24xx_vport_create()
3063 if (ha->fw_attributes & BIT_4) { in qla24xx_vport_create()
3081 if (IS_PI_IPGUARD_CAPABLE(ha) && in qla24xx_vport_create()
3082 (ql2xenabledif > 1 || IS_PI_DIFB_DIX0_CAPABLE(ha))) in qla24xx_vport_create()
3091 &ha->pdev->dev)) { in qla24xx_vport_create()
3098 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; in qla24xx_vport_create()
3106 qlt_vport_create(vha, ha); in qla24xx_vport_create()
3109 if (!ql2xmqsupport || !ha->npiv_info) in qla24xx_vport_create()
3113 for (cnt = 0; cnt < ha->nvram_npiv_size; cnt++) { in qla24xx_vport_create()
3114 if (memcmp(ha->npiv_info[cnt].port_name, vha->port_name, 8) == 0 in qla24xx_vport_create()
3115 && memcmp(ha->npiv_info[cnt].node_name, vha->node_name, in qla24xx_vport_create()
3117 qos = ha->npiv_info[cnt].q_qos; in qla24xx_vport_create()
3155 struct qla_hw_data *ha = vha->hw; in qla24xx_vport_delete() local
3174 qlt_remove_target(ha, vha); in qla24xx_vport_delete()
3191 mutex_lock(&ha->vport_lock); in qla24xx_vport_delete()
3192 ha->cur_vport_count--; in qla24xx_vport_delete()
3193 clear_bit(vha->vp_idx, ha->vp_idx_map); in qla24xx_vport_delete()
3194 mutex_unlock(&ha->vport_lock); in qla24xx_vport_delete()
3196 dma_free_coherent(&ha->pdev->dev, vha->gnl.size, vha->gnl.l, in qla24xx_vport_delete()
3322 struct qla_hw_data *ha = vha->hw; in qla2x00_init_host_attr() local
3325 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; in qla2x00_init_host_attr()
3328 fc_host_supported_classes(vha->host) = ha->base_qpair->enable_class_2 ? in qla2x00_init_host_attr()
3330 fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; in qla2x00_init_host_attr()
3331 fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; in qla2x00_init_host_attr()
3333 speeds = qla25xx_fdmi_port_speed_capability(ha); in qla2x00_init_host_attr()