Lines Matching refs:ha

26 	struct qla_hw_data *ha = vha->hw;  in qla2x00_sysfs_read_fw_dump()  local
29 if (!(ha->fw_dump_reading || ha->mctp_dump_reading)) in qla2x00_sysfs_read_fw_dump()
32 if (IS_P3P_TYPE(ha)) { in qla2x00_sysfs_read_fw_dump()
33 if (off < ha->md_template_size) { in qla2x00_sysfs_read_fw_dump()
35 &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 return memory_read_from_buffer(buf, count, &off, ha->mctp_dump, in qla2x00_sysfs_read_fw_dump()
45 else if (ha->fw_dump_reading) in qla2x00_sysfs_read_fw_dump()
46 return memory_read_from_buffer(buf, count, &off, ha->fw_dump, in qla2x00_sysfs_read_fw_dump()
47 ha->fw_dump_len); in qla2x00_sysfs_read_fw_dump()
59 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_fw_dump() local
68 if (!ha->fw_dump_reading) in qla2x00_sysfs_write_fw_dump()
74 if (IS_P3P_TYPE(ha)) { in qla2x00_sysfs_write_fw_dump()
78 ha->fw_dump_reading = 0; in qla2x00_sysfs_write_fw_dump()
79 ha->fw_dumped = 0; in qla2x00_sysfs_write_fw_dump()
82 if (ha->fw_dumped && !ha->fw_dump_reading) { in qla2x00_sysfs_write_fw_dump()
83 ha->fw_dump_reading = 1; in qla2x00_sysfs_write_fw_dump()
94 if (IS_QLA82XX(ha)) { in qla2x00_sysfs_write_fw_dump()
95 qla82xx_idc_lock(ha); in qla2x00_sysfs_write_fw_dump()
97 qla82xx_idc_unlock(ha); in qla2x00_sysfs_write_fw_dump()
98 } else if (IS_QLA8044(ha)) { in qla2x00_sysfs_write_fw_dump()
99 qla8044_idc_lock(ha); in qla2x00_sysfs_write_fw_dump()
101 qla8044_idc_unlock(ha); in qla2x00_sysfs_write_fw_dump()
106 if (IS_P3P_TYPE(ha)) { in qla2x00_sysfs_write_fw_dump()
107 if (ha->md_tmplt_hdr) in qla2x00_sysfs_write_fw_dump()
116 if (IS_P3P_TYPE(ha)) in qla2x00_sysfs_write_fw_dump()
120 if (!ha->mctp_dump_reading) in qla2x00_sysfs_write_fw_dump()
124 ha->mctp_dump_reading = 0; in qla2x00_sysfs_write_fw_dump()
125 ha->mctp_dumped = 0; in qla2x00_sysfs_write_fw_dump()
128 if (ha->mctp_dumped && !ha->mctp_dump_reading) { in qla2x00_sysfs_write_fw_dump()
129 ha->mctp_dump_reading = 1; in qla2x00_sysfs_write_fw_dump()
156 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_fw_dump_template() local
158 if (!ha->fw_dump_template || !ha->fw_dump_template_len) in qla2x00_sysfs_read_fw_dump_template()
164 ha->fw_dump_template, ha->fw_dump_template_len); in qla2x00_sysfs_read_fw_dump_template()
174 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_fw_dump_template() local
178 if (ha->fw_dump) in qla2x00_sysfs_write_fw_dump_template()
179 vfree(ha->fw_dump); in qla2x00_sysfs_write_fw_dump_template()
180 if (ha->fw_dump_template) in qla2x00_sysfs_write_fw_dump_template()
181 vfree(ha->fw_dump_template); in qla2x00_sysfs_write_fw_dump_template()
183 ha->fw_dump = NULL; in qla2x00_sysfs_write_fw_dump_template()
184 ha->fw_dump_len = 0; in qla2x00_sysfs_write_fw_dump_template()
185 ha->fw_dump_template = NULL; in qla2x00_sysfs_write_fw_dump_template()
186 ha->fw_dump_template_len = 0; in qla2x00_sysfs_write_fw_dump_template()
191 ha->fw_dump_template = vmalloc(size); in qla2x00_sysfs_write_fw_dump_template()
192 if (!ha->fw_dump_template) { in qla2x00_sysfs_write_fw_dump_template()
197 ha->fw_dump_template_len = size; in qla2x00_sysfs_write_fw_dump_template()
200 if (off + count > ha->fw_dump_template_len) { in qla2x00_sysfs_write_fw_dump_template()
201 count = ha->fw_dump_template_len - off; in qla2x00_sysfs_write_fw_dump_template()
208 memcpy(ha->fw_dump_template + off, buf, count); in qla2x00_sysfs_write_fw_dump_template()
210 if (off + count == ha->fw_dump_template_len) { in qla2x00_sysfs_write_fw_dump_template()
214 ha->fw_dump = vmalloc(size); in qla2x00_sysfs_write_fw_dump_template()
215 if (!ha->fw_dump) { in qla2x00_sysfs_write_fw_dump_template()
220 ha->fw_dump_len = size; in qla2x00_sysfs_write_fw_dump_template()
242 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_nvram() local
247 if (IS_NOCACHE_VPD_TYPE(ha)) in qla2x00_sysfs_read_nvram()
248 ha->isp_ops->read_optrom(vha, ha->nvram, ha->flt_region_nvram << 2, in qla2x00_sysfs_read_nvram()
249 ha->nvram_size); in qla2x00_sysfs_read_nvram()
250 return memory_read_from_buffer(buf, count, &off, ha->nvram, in qla2x00_sysfs_read_nvram()
251 ha->nvram_size); in qla2x00_sysfs_read_nvram()
261 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_nvram() local
264 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->nvram_size || in qla2x00_sysfs_write_nvram()
265 !ha->isp_ops->write_nvram) in qla2x00_sysfs_write_nvram()
269 if (IS_FWI2_CAPABLE(ha)) { 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()
329 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_optrom() local
332 if (ha->optrom_state != QLA_SREADING) in qla2x00_sysfs_read_optrom()
335 mutex_lock(&ha->optrom_mutex); in qla2x00_sysfs_read_optrom()
336 rval = memory_read_from_buffer(buf, count, &off, ha->optrom_buffer, in qla2x00_sysfs_read_optrom()
337 ha->optrom_region_size); in qla2x00_sysfs_read_optrom()
338 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_read_optrom()
350 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom() local
352 if (ha->optrom_state != QLA_SWRITING) in qla2x00_sysfs_write_optrom()
354 if (off > ha->optrom_region_size) in qla2x00_sysfs_write_optrom()
356 if (off + count > ha->optrom_region_size) in qla2x00_sysfs_write_optrom()
357 count = ha->optrom_region_size - off; in qla2x00_sysfs_write_optrom()
359 mutex_lock(&ha->optrom_mutex); in qla2x00_sysfs_write_optrom()
360 memcpy(&ha->optrom_buffer[off], buf, count); in qla2x00_sysfs_write_optrom()
361 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_optrom()
383 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom_ctl() local
385 uint32_t size = ha->optrom_size; in qla2x00_sysfs_write_optrom_ctl()
392 if (unlikely(pci_channel_offline(ha->pdev))) in qla2x00_sysfs_write_optrom_ctl()
397 if (start > ha->optrom_size) in qla2x00_sysfs_write_optrom_ctl()
400 mutex_lock(&ha->optrom_mutex); in qla2x00_sysfs_write_optrom_ctl()
403 if (ha->optrom_state != QLA_SREADING && in qla2x00_sysfs_write_optrom_ctl()
404 ha->optrom_state != QLA_SWRITING) { in qla2x00_sysfs_write_optrom_ctl()
408 ha->optrom_state = QLA_SWAITING; in qla2x00_sysfs_write_optrom_ctl()
412 ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
414 vfree(ha->optrom_buffer); in qla2x00_sysfs_write_optrom_ctl()
415 ha->optrom_buffer = NULL; in qla2x00_sysfs_write_optrom_ctl()
418 if (ha->optrom_state != QLA_SWAITING) { in qla2x00_sysfs_write_optrom_ctl()
423 ha->optrom_region_start = start; in qla2x00_sysfs_write_optrom_ctl()
424 ha->optrom_region_size = start + size > ha->optrom_size ? in qla2x00_sysfs_write_optrom_ctl()
425 ha->optrom_size - start : size; in qla2x00_sysfs_write_optrom_ctl()
427 ha->optrom_state = QLA_SREADING; in qla2x00_sysfs_write_optrom_ctl()
428 ha->optrom_buffer = vmalloc(ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
429 if (ha->optrom_buffer == NULL) { in qla2x00_sysfs_write_optrom_ctl()
432 "(%x).\n", ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
434 ha->optrom_state = QLA_SWAITING; in qla2x00_sysfs_write_optrom_ctl()
448 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
450 memset(ha->optrom_buffer, 0, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
451 ha->isp_ops->read_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
452 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
455 if (ha->optrom_state != QLA_SWAITING) { in qla2x00_sysfs_write_optrom_ctl()
481 if (ha->optrom_size == OPTROM_SIZE_2300 && start == 0) in qla2x00_sysfs_write_optrom_ctl()
483 else if (start == (ha->flt_region_boot * 4) || in qla2x00_sysfs_write_optrom_ctl()
484 start == (ha->flt_region_fw * 4)) in qla2x00_sysfs_write_optrom_ctl()
486 else if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha) in qla2x00_sysfs_write_optrom_ctl()
487 || IS_CNA_CAPABLE(ha) || IS_QLA2031(ha) in qla2x00_sysfs_write_optrom_ctl()
488 || IS_QLA27XX(ha)) in qla2x00_sysfs_write_optrom_ctl()
497 ha->optrom_region_start = start; in qla2x00_sysfs_write_optrom_ctl()
498 ha->optrom_region_size = start + size > ha->optrom_size ? in qla2x00_sysfs_write_optrom_ctl()
499 ha->optrom_size - start : size; in qla2x00_sysfs_write_optrom_ctl()
501 ha->optrom_state = QLA_SWRITING; in qla2x00_sysfs_write_optrom_ctl()
502 ha->optrom_buffer = vmalloc(ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
503 if (ha->optrom_buffer == NULL) { in qla2x00_sysfs_write_optrom_ctl()
506 "(%x)\n", ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
508 ha->optrom_state = QLA_SWAITING; in qla2x00_sysfs_write_optrom_ctl()
515 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
517 memset(ha->optrom_buffer, 0, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
520 if (ha->optrom_state != QLA_SWRITING) { in qla2x00_sysfs_write_optrom_ctl()
534 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
536 ha->isp_ops->write_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
537 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
544 mutex_unlock(&ha->optrom_mutex); in qla2x00_sysfs_write_optrom_ctl()
564 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_vpd() local
566 if (unlikely(pci_channel_offline(ha->pdev))) in qla2x00_sysfs_read_vpd()
572 if (IS_NOCACHE_VPD_TYPE(ha)) in qla2x00_sysfs_read_vpd()
573 ha->isp_ops->read_optrom(vha, ha->vpd, ha->flt_region_vpd << 2, in qla2x00_sysfs_read_vpd()
574 ha->vpd_size); in qla2x00_sysfs_read_vpd()
575 return memory_read_from_buffer(buf, count, &off, ha->vpd, ha->vpd_size); in qla2x00_sysfs_read_vpd()
585 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_vpd() local
588 if (unlikely(pci_channel_offline(ha->pdev))) in qla2x00_sysfs_write_vpd()
591 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size || in qla2x00_sysfs_write_vpd()
592 !ha->isp_ops->write_nvram) 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()
606 if (!IS_FWI2_CAPABLE(ha)) in qla2x00_sysfs_write_vpd()
615 ha->isp_ops->get_flash_version(vha, tmp_data); in qla2x00_sysfs_write_vpd()
638 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_sfp() local
645 if (ha->sfp_data) in qla2x00_sysfs_read_sfp()
648 ha->sfp_data = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, in qla2x00_sysfs_read_sfp()
649 &ha->sfp_data_dma); in qla2x00_sysfs_read_sfp()
650 if (!ha->sfp_data) { in qla2x00_sysfs_read_sfp()
657 memset(ha->sfp_data, 0, SFP_BLOCK_SIZE); in qla2x00_sysfs_read_sfp()
667 rval = qla2x00_read_sfp(vha, ha->sfp_data_dma, ha->sfp_data, in qla2x00_sysfs_read_sfp()
676 memcpy(buf, ha->sfp_data, SFP_BLOCK_SIZE); in qla2x00_sysfs_read_sfp()
699 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_reset() local
700 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); in qla2x00_sysfs_write_reset()
714 if (IS_QLA82XX(ha)) { in qla2x00_sysfs_write_reset()
715 ha->flags.isp82xx_no_md_cap = 1; in qla2x00_sysfs_write_reset()
716 qla82xx_idc_lock(ha); in qla2x00_sysfs_write_reset()
718 qla82xx_idc_unlock(ha); in qla2x00_sysfs_write_reset()
719 } else if (IS_QLA8044(ha)) { in qla2x00_sysfs_write_reset()
720 qla8044_idc_lock(ha); in qla2x00_sysfs_write_reset()
721 idc_control = qla8044_rd_reg(ha, in qla2x00_sysfs_write_reset()
723 qla8044_wr_reg(ha, QLA8044_IDC_DRV_CTRL, in qla2x00_sysfs_write_reset()
726 qla8044_idc_unlock(ha); in qla2x00_sysfs_write_reset()
735 if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha)) in qla2x00_sysfs_write_reset()
741 if (IS_QLA83XX(ha) || IS_QLA27XX(ha)) { in qla2x00_sysfs_write_reset()
766 if (!IS_P3P_TYPE(ha) || vha != base_vha) { in qla2x00_sysfs_write_reset()
779 if (!IS_QLA8031(ha)) in qla2x00_sysfs_write_reset()
790 if (!IS_QLA8031(ha)) in qla2x00_sysfs_write_reset()
810 ha->isp_ops->get_flash_version(vha, tmp_data); in qla2x00_sysfs_write_reset()
833 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_xgmac_stats() local
840 if (ha->xgmac_data) in qla2x00_sysfs_read_xgmac_stats()
843 ha->xgmac_data = dma_alloc_coherent(&ha->pdev->dev, XGMAC_DATA_SIZE, in qla2x00_sysfs_read_xgmac_stats()
844 &ha->xgmac_data_dma, GFP_KERNEL); in qla2x00_sysfs_read_xgmac_stats()
845 if (!ha->xgmac_data) { in qla2x00_sysfs_read_xgmac_stats()
853 memset(ha->xgmac_data, 0, XGMAC_DATA_SIZE); in qla2x00_sysfs_read_xgmac_stats()
855 rval = qla2x00_get_xgmac_stats(vha, ha->xgmac_data_dma, in qla2x00_sysfs_read_xgmac_stats()
864 memcpy(buf, ha->xgmac_data, count); in qla2x00_sysfs_read_xgmac_stats()
885 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_dcbx_tlv() local
891 if (ha->dcbx_tlv) in qla2x00_sysfs_read_dcbx_tlv()
894 ha->dcbx_tlv = dma_alloc_coherent(&ha->pdev->dev, DCBX_TLV_DATA_SIZE, in qla2x00_sysfs_read_dcbx_tlv()
895 &ha->dcbx_tlv_dma, GFP_KERNEL); in qla2x00_sysfs_read_dcbx_tlv()
896 if (!ha->dcbx_tlv) { in qla2x00_sysfs_read_dcbx_tlv()
903 memset(ha->dcbx_tlv, 0, DCBX_TLV_DATA_SIZE); in qla2x00_sysfs_read_dcbx_tlv()
905 rval = qla2x00_get_dcbx_params(vha, ha->dcbx_tlv_dma, in qla2x00_sysfs_read_dcbx_tlv()
913 memcpy(buf, ha->dcbx_tlv, count); in qla2x00_sysfs_read_dcbx_tlv()
980 struct qla_hw_data *ha = vha->hw; in qla2x00_free_sysfs_attr() local
983 if (iter->is4GBp_only && !IS_FWI2_CAPABLE(ha)) in qla2x00_free_sysfs_attr()
985 if (iter->is4GBp_only == 2 && !IS_QLA25XX(ha)) in qla2x00_free_sysfs_attr()
996 if (stop_beacon && ha->beacon_blink_led == 1) in qla2x00_free_sysfs_attr()
997 ha->isp_ops->beacon_off(vha); in qla2x00_free_sysfs_attr()
1014 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_version_show() local
1018 ha->isp_ops->fw_version_str(vha, fw_str, sizeof(fw_str))); in qla2x00_fw_version_show()
1026 struct qla_hw_data *ha = vha->hw; in qla2x00_serial_num_show() local
1032 } else if (IS_FWI2_CAPABLE(ha)) { in qla2x00_serial_num_show()
1037 sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1; in qla2x00_serial_num_show()
1055 struct qla_hw_data *ha = vha->hw; in qla2x00_isp_id_show() local
1062 ha->product_id[0], ha->product_id[1], ha->product_id[2], in qla2x00_isp_id_show()
1063 ha->product_id[3]); in qla2x00_isp_id_show()
1099 struct qla_hw_data *ha = vha->hw; in qla2x00_link_state_show() local
1112 switch (ha->current_topology) { in qla2x00_link_state_show()
1157 struct qla_hw_data *ha = vha->hw; in qla2x00_zio_store() local
1161 if (!IS_ZIO_SUPPORTED(ha)) in qla2x00_zio_store()
1173 if (zio_mode != QLA_ZIO_DISABLED || ha->zio_mode != QLA_ZIO_DISABLED) { in qla2x00_zio_store()
1174 ha->zio_mode = zio_mode; in qla2x00_zio_store()
1227 struct qla_hw_data *ha = vha->hw; in qla2x00_beacon_store() local
1231 if (IS_QLA2100(ha) || IS_QLA2200(ha)) 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()
1259 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_bios_version_show() local
1260 return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->bios_revision[1], in qla2x00_optrom_bios_version_show()
1261 ha->bios_revision[0]); in qla2x00_optrom_bios_version_show()
1269 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_efi_version_show() local
1270 return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->efi_revision[1], in qla2x00_optrom_efi_version_show()
1271 ha->efi_revision[0]); in qla2x00_optrom_efi_version_show()
1279 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fcode_version_show() local
1280 return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fcode_revision[1], in qla2x00_optrom_fcode_version_show()
1281 ha->fcode_revision[0]); in qla2x00_optrom_fcode_version_show()
1289 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fw_version_show() local
1291 ha->fw_revision[0], ha->fw_revision[1], ha->fw_revision[2], in qla2x00_optrom_fw_version_show()
1292 ha->fw_revision[3]); in qla2x00_optrom_fw_version_show()
1300 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_gold_fw_version_show() local
1302 if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha) && !IS_QLA27XX(ha)) in qla2x00_optrom_gold_fw_version_show()
1306 ha->gold_fw_version[0], ha->gold_fw_version[1], in qla2x00_optrom_gold_fw_version_show()
1307 ha->gold_fw_version[2], ha->gold_fw_version[3]); in qla2x00_optrom_gold_fw_version_show()
1326 struct qla_hw_data *ha = vha->hw; in qla24xx_84xx_fw_version_show() local
1328 if (!IS_QLA84XX(ha)) in qla24xx_84xx_fw_version_show()
1331 if (ha->cs84xx->op_fw_version == 0) in qla24xx_84xx_fw_version_show()
1336 (uint32_t)ha->cs84xx->op_fw_version); in qla24xx_84xx_fw_version_show()
1346 struct qla_hw_data *ha = vha->hw; in qla2x00_mpi_version_show() local
1348 if (!IS_QLA81XX(ha) && !IS_QLA8031(ha) && !IS_QLA8044(ha) && in qla2x00_mpi_version_show()
1349 !IS_QLA27XX(ha)) in qla2x00_mpi_version_show()
1353 ha->mpi_version[0], ha->mpi_version[1], ha->mpi_version[2], in qla2x00_mpi_version_show()
1354 ha->mpi_capabilities); in qla2x00_mpi_version_show()
1362 struct qla_hw_data *ha = vha->hw; in qla2x00_phy_version_show() local
1364 if (!IS_QLA81XX(ha) && !IS_QLA8031(ha)) in qla2x00_phy_version_show()
1368 ha->phy_version[0], ha->phy_version[1], ha->phy_version[2]); in qla2x00_phy_version_show()
1376 struct qla_hw_data *ha = vha->hw; in qla2x00_flash_block_size_show() local
1378 return scnprintf(buf, PAGE_SIZE, "0x%x\n", ha->fdt_block_size); in qla2x00_flash_block_size_show()
1494 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_dump_size_show() local
1497 if (!ha->fw_dumped) in qla2x00_fw_dump_size_show()
1499 else if (IS_P3P_TYPE(ha)) in qla2x00_fw_dump_size_show()
1500 size = ha->md_template_size + ha->md_dump_size; in qla2x00_fw_dump_size_show()
1502 size = ha->fw_dump_len; in qla2x00_fw_dump_size_show()
1543 struct qla_hw_data *ha = vha->hw; in qla2x00_pep_version_show() local
1545 if (!IS_QLA27XX(ha)) in qla2x00_pep_version_show()
1549 ha->pep_version[0], ha->pep_version[1], ha->pep_version[2]); in qla2x00_pep_version_show()
1648 struct qla_hw_data *ha = ((struct scsi_qla_host *) in qla2x00_get_host_speed() local
1652 if (IS_QLAFX00(ha)) { in qla2x00_get_host_speed()
1657 switch (ha->link_data_rate) { in qla2x00_get_host_speed()
1854 struct qla_hw_data *ha = vha->hw; in qla2x00_get_fc_host_stats() local
1855 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); in qla2x00_get_fc_host_stats()
1870 if (unlikely(pci_channel_offline(ha->pdev))) in qla2x00_get_fc_host_stats()
1876 stats = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &stats_dma); in qla2x00_get_fc_host_stats()
1885 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_get_fc_host_stats()
1888 !ha->dpc_active) { in qla2x00_get_fc_host_stats()
1903 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_get_fc_host_stats()
1924 dma_pool_free(ha->s_dma_pool, stats, stats_dma); in qla2x00_get_fc_host_stats()
2010 struct qla_hw_data *ha = base_vha->hw; in qla24xx_vport_create() local
2013 struct req_que *req = ha->req_q_map[0]; in qla24xx_vport_create()
2052 if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) { in qla24xx_vport_create()
2053 if (ha->fw_attributes & BIT_4) { in qla24xx_vport_create()
2070 if (IS_PI_IPGUARD_CAPABLE(ha) && in qla24xx_vport_create()
2071 (ql2xenabledif > 1 || IS_PI_DIFB_DIX0_CAPABLE(ha))) in qla24xx_vport_create()
2080 &ha->pdev->dev)) { in qla24xx_vport_create()
2087 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; in qla24xx_vport_create()
2095 qlt_vport_create(vha, ha); in qla24xx_vport_create()
2098 if (ha->flags.cpu_affinity_enabled) { in qla24xx_vport_create()
2099 req = ha->req_q_map[1]; in qla24xx_vport_create()
2103 req, vha->vp_idx, ha->flags.cpu_affinity_enabled); in qla24xx_vport_create()
2105 } else if (ql2xmaxqueues == 1 || !ha->npiv_info) in qla24xx_vport_create()
2108 for (cnt = 0; cnt < ha->nvram_npiv_size; cnt++) { 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()
2112 qos = ha->npiv_info[cnt].q_qos; in qla24xx_vport_create()
2118 ret = qla25xx_create_req_que(ha, options, vha->vp_idx, 0, 0, in qla24xx_vport_create()
2131 req = ha->req_q_map[ret]; in qla24xx_vport_create()
2150 struct qla_hw_data *ha = vha->hw; in qla24xx_vport_delete() local
2161 qlt_remove_target(ha, vha); in qla24xx_vport_delete()
2180 mutex_lock(&ha->vport_lock); in qla24xx_vport_delete()
2181 ha->cur_vport_count--; in qla24xx_vport_delete()
2182 clear_bit(vha->vp_idx, ha->vp_idx_map); in qla24xx_vport_delete()
2183 mutex_unlock(&ha->vport_lock); in qla24xx_vport_delete()
2185 if (vha->req->id && !ha->flags.cpu_affinity_enabled) { in qla24xx_vport_delete()
2304 struct qla_hw_data *ha = vha->hw; in qla2x00_init_host_attr() local
2307 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; 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()
2315 if (IS_CNA_CAPABLE(ha)) in qla2x00_init_host_attr()
2317 else if (IS_QLA2031(ha)) in qla2x00_init_host_attr()
2320 else if (IS_QLA25XX(ha)) in qla2x00_init_host_attr()
2323 else if (IS_QLA24XX_TYPE(ha)) in qla2x00_init_host_attr()
2326 else if (IS_QLA23XX(ha)) in qla2x00_init_host_attr()
2328 else if (IS_QLAFX00(ha)) in qla2x00_init_host_attr()
2331 else if (IS_QLA27XX(ha)) in qla2x00_init_host_attr()