Lines Matching refs:ha
24 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_fw_dump() local
26 if (ha->fw_dump_reading == 0) in qla2x00_sysfs_read_fw_dump()
29 return memory_read_from_buffer(buf, count, &off, ha->fw_dump, in qla2x00_sysfs_read_fw_dump()
30 ha->fw_dump_len); in qla2x00_sysfs_read_fw_dump()
40 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_fw_dump() local
49 if (!ha->fw_dump_reading) in qla2x00_sysfs_write_fw_dump()
52 qla_printk(KERN_INFO, ha, in qla2x00_sysfs_write_fw_dump()
55 ha->fw_dump_reading = 0; in qla2x00_sysfs_write_fw_dump()
56 ha->fw_dumped = 0; in qla2x00_sysfs_write_fw_dump()
59 if (ha->fw_dumped && !ha->fw_dump_reading) { in qla2x00_sysfs_write_fw_dump()
60 ha->fw_dump_reading = 1; in qla2x00_sysfs_write_fw_dump()
62 qla_printk(KERN_INFO, ha, in qla2x00_sysfs_write_fw_dump()
94 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_nvram() local
100 return memory_read_from_buffer(buf, count, &off, ha->nvram, in qla2x00_sysfs_read_nvram()
101 ha->nvram_size); in qla2x00_sysfs_read_nvram()
111 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_nvram() local
114 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->nvram_size) in qla2x00_sysfs_write_nvram()
118 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_sysfs_write_nvram()
141 ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->nvram_base, count); in qla2x00_sysfs_write_nvram()
142 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->nvram, ha->nvram_base, in qla2x00_sysfs_write_nvram()
167 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_optrom() local
169 if (ha->optrom_state != QLA_SREADING) in qla2x00_sysfs_read_optrom()
172 return memory_read_from_buffer(buf, count, &off, ha->optrom_buffer, in qla2x00_sysfs_read_optrom()
173 ha->optrom_region_size); in qla2x00_sysfs_read_optrom()
183 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom() local
185 if (ha->optrom_state != QLA_SWRITING) in qla2x00_sysfs_write_optrom()
187 if (off > ha->optrom_region_size) in qla2x00_sysfs_write_optrom()
189 if (off + count > ha->optrom_region_size) in qla2x00_sysfs_write_optrom()
190 count = ha->optrom_region_size - off; in qla2x00_sysfs_write_optrom()
192 memcpy(&ha->optrom_buffer[off], buf, count); in qla2x00_sysfs_write_optrom()
214 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_optrom_ctl() local
217 uint32_t size = ha->optrom_size; in qla2x00_sysfs_write_optrom_ctl()
225 if (start > ha->optrom_size) in qla2x00_sysfs_write_optrom_ctl()
230 if (ha->optrom_state != QLA_SREADING && in qla2x00_sysfs_write_optrom_ctl()
231 ha->optrom_state != QLA_SWRITING) in qla2x00_sysfs_write_optrom_ctl()
234 ha->optrom_state = QLA_SWAITING; in qla2x00_sysfs_write_optrom_ctl()
236 DEBUG2(qla_printk(KERN_INFO, ha, in qla2x00_sysfs_write_optrom_ctl()
238 ha->optrom_region_size)); in qla2x00_sysfs_write_optrom_ctl()
240 vfree(ha->optrom_buffer); in qla2x00_sysfs_write_optrom_ctl()
241 ha->optrom_buffer = NULL; in qla2x00_sysfs_write_optrom_ctl()
244 if (ha->optrom_state != QLA_SWAITING) in qla2x00_sysfs_write_optrom_ctl()
247 ha->optrom_region_start = start; in qla2x00_sysfs_write_optrom_ctl()
248 ha->optrom_region_size = start + size > ha->optrom_size ? in qla2x00_sysfs_write_optrom_ctl()
249 ha->optrom_size - start : size; in qla2x00_sysfs_write_optrom_ctl()
251 ha->optrom_state = QLA_SREADING; in qla2x00_sysfs_write_optrom_ctl()
252 ha->optrom_buffer = vmalloc(ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
253 if (ha->optrom_buffer == NULL) { in qla2x00_sysfs_write_optrom_ctl()
254 qla_printk(KERN_WARNING, ha, in qla2x00_sysfs_write_optrom_ctl()
256 "(%x).\n", ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
258 ha->optrom_state = QLA_SWAITING; in qla2x00_sysfs_write_optrom_ctl()
262 DEBUG2(qla_printk(KERN_INFO, ha, in qla2x00_sysfs_write_optrom_ctl()
264 ha->optrom_region_start, ha->optrom_region_size)); in qla2x00_sysfs_write_optrom_ctl()
266 memset(ha->optrom_buffer, 0, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
267 ha->isp_ops->read_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
268 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
271 if (ha->optrom_state != QLA_SWAITING) in qla2x00_sysfs_write_optrom_ctl()
295 if (ha->optrom_size == OPTROM_SIZE_2300 && start == 0) in qla2x00_sysfs_write_optrom_ctl()
297 else if (start == (ha->flt_region_boot * 4) || in qla2x00_sysfs_write_optrom_ctl()
298 start == (ha->flt_region_fw * 4)) in qla2x00_sysfs_write_optrom_ctl()
300 else if (IS_QLA25XX(ha) || IS_QLA81XX(ha)) in qla2x00_sysfs_write_optrom_ctl()
303 qla_printk(KERN_WARNING, ha, in qla2x00_sysfs_write_optrom_ctl()
308 ha->optrom_region_start = start; in qla2x00_sysfs_write_optrom_ctl()
309 ha->optrom_region_size = start + size > ha->optrom_size ? in qla2x00_sysfs_write_optrom_ctl()
310 ha->optrom_size - start : size; in qla2x00_sysfs_write_optrom_ctl()
312 ha->optrom_state = QLA_SWRITING; in qla2x00_sysfs_write_optrom_ctl()
313 ha->optrom_buffer = vmalloc(ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
314 if (ha->optrom_buffer == NULL) { in qla2x00_sysfs_write_optrom_ctl()
315 qla_printk(KERN_WARNING, ha, in qla2x00_sysfs_write_optrom_ctl()
317 "(%x).\n", ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
319 ha->optrom_state = QLA_SWAITING; in qla2x00_sysfs_write_optrom_ctl()
323 DEBUG2(qla_printk(KERN_INFO, ha, in qla2x00_sysfs_write_optrom_ctl()
325 ha->optrom_region_start, ha->optrom_region_size)); in qla2x00_sysfs_write_optrom_ctl()
327 memset(ha->optrom_buffer, 0, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
330 if (ha->optrom_state != QLA_SWRITING) in qla2x00_sysfs_write_optrom_ctl()
333 DEBUG2(qla_printk(KERN_INFO, ha, in qla2x00_sysfs_write_optrom_ctl()
335 ha->optrom_region_start, ha->optrom_region_size)); in qla2x00_sysfs_write_optrom_ctl()
337 ha->isp_ops->write_optrom(vha, ha->optrom_buffer, in qla2x00_sysfs_write_optrom_ctl()
338 ha->optrom_region_start, ha->optrom_region_size); in qla2x00_sysfs_write_optrom_ctl()
362 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_vpd() local
368 return memory_read_from_buffer(buf, count, &off, ha->vpd, ha->vpd_size); in qla2x00_sysfs_read_vpd()
378 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_write_vpd() local
380 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size) in qla2x00_sysfs_write_vpd()
384 ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->vpd_base, count); in qla2x00_sysfs_write_vpd()
385 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->vpd, ha->vpd_base, count); in qla2x00_sysfs_write_vpd()
407 struct qla_hw_data *ha = vha->hw; in qla2x00_sysfs_read_sfp() local
414 if (ha->sfp_data) in qla2x00_sysfs_read_sfp()
417 ha->sfp_data = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, in qla2x00_sysfs_read_sfp()
418 &ha->sfp_data_dma); in qla2x00_sysfs_read_sfp()
419 if (!ha->sfp_data) { in qla2x00_sysfs_read_sfp()
420 qla_printk(KERN_WARNING, ha, in qla2x00_sysfs_read_sfp()
426 memset(ha->sfp_data, 0, SFP_BLOCK_SIZE); in qla2x00_sysfs_read_sfp()
436 rval = qla2x00_read_sfp(vha, ha->sfp_data_dma, addr, offset, in qla2x00_sysfs_read_sfp()
439 qla_printk(KERN_WARNING, ha, in qla2x00_sysfs_read_sfp()
445 memcpy(buf, ha->sfp_data, SFP_BLOCK_SIZE); in qla2x00_sysfs_read_sfp()
500 struct qla_hw_data *ha = vha->hw; in qla2x00_free_sysfs_attr() local
503 if (iter->is4GBp_only && !IS_FWI2_CAPABLE(ha)) in qla2x00_free_sysfs_attr()
510 if (ha->beacon_blink_led == 1) in qla2x00_free_sysfs_attr()
511 ha->isp_ops->beacon_off(vha); in qla2x00_free_sysfs_attr()
528 struct qla_hw_data *ha = vha->hw; in qla2x00_fw_version_show() local
532 ha->isp_ops->fw_version_str(vha, fw_str)); in qla2x00_fw_version_show()
540 struct qla_hw_data *ha = vha->hw; in qla2x00_serial_num_show() local
543 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_serial_num_show()
548 sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1; in qla2x00_serial_num_show()
566 struct qla_hw_data *ha = vha->hw; in qla2x00_isp_id_show() local
568 ha->product_id[0], ha->product_id[1], ha->product_id[2], in qla2x00_isp_id_show()
569 ha->product_id[3]); in qla2x00_isp_id_show()
605 struct qla_hw_data *ha = vha->hw; in qla2x00_link_state_show() local
618 switch (ha->current_topology) { in qla2x00_link_state_show()
663 struct qla_hw_data *ha = vha->hw; in qla2x00_zio_store() local
667 if (!IS_ZIO_SUPPORTED(ha)) in qla2x00_zio_store()
679 if (zio_mode != QLA_ZIO_DISABLED || ha->zio_mode != QLA_ZIO_DISABLED) { in qla2x00_zio_store()
680 ha->zio_mode = zio_mode; in qla2x00_zio_store()
733 struct qla_hw_data *ha = vha->hw; in qla2x00_beacon_store() local
737 if (IS_QLA2100(ha) || IS_QLA2200(ha)) in qla2x00_beacon_store()
741 qla_printk(KERN_WARNING, ha, in qla2x00_beacon_store()
750 rval = ha->isp_ops->beacon_on(vha); in qla2x00_beacon_store()
752 rval = ha->isp_ops->beacon_off(vha); in qla2x00_beacon_store()
765 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_bios_version_show() local
766 return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->bios_revision[1], in qla2x00_optrom_bios_version_show()
767 ha->bios_revision[0]); in qla2x00_optrom_bios_version_show()
775 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_efi_version_show() local
776 return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->efi_revision[1], in qla2x00_optrom_efi_version_show()
777 ha->efi_revision[0]); in qla2x00_optrom_efi_version_show()
785 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fcode_version_show() local
786 return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fcode_revision[1], in qla2x00_optrom_fcode_version_show()
787 ha->fcode_revision[0]); in qla2x00_optrom_fcode_version_show()
795 struct qla_hw_data *ha = vha->hw; in qla2x00_optrom_fw_version_show() local
797 ha->fw_revision[0], ha->fw_revision[1], ha->fw_revision[2], in qla2x00_optrom_fw_version_show()
798 ha->fw_revision[3]); in qla2x00_optrom_fw_version_show()
806 struct qla_hw_data *ha = vha->hw; in qla2x00_total_isp_aborts_show() local
808 ha->qla_stats.total_isp_aborts); in qla2x00_total_isp_aborts_show()
816 struct qla_hw_data *ha = vha->hw; in qla2x00_mpi_version_show() local
818 if (!IS_QLA81XX(ha)) in qla2x00_mpi_version_show()
822 ha->mpi_version[0], ha->mpi_version[1], ha->mpi_version[2], in qla2x00_mpi_version_show()
823 ha->mpi_version[3], ha->mpi_capabilities); in qla2x00_mpi_version_show()
888 struct qla_hw_data *ha = ((struct scsi_qla_host *) in qla2x00_get_host_speed() local
892 switch (ha->link_data_rate) { in qla2x00_get_host_speed()
1062 struct qla_hw_data *ha = vha->hw; in qla2x00_get_fc_host_stats() local
1063 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); in qla2x00_get_fc_host_stats()
1069 pfc_host_stat = &ha->fc_host_stat; in qla2x00_get_fc_host_stats()
1072 stats = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &stats_dma); in qla2x00_get_fc_host_stats()
1081 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_get_fc_host_stats()
1086 !ha->dpc_active) { in qla2x00_get_fc_host_stats()
1101 if (IS_FWI2_CAPABLE(ha)) { in qla2x00_get_fc_host_stats()
1108 pfc_host_stat->fcp_input_megabytes = ha->qla_stats.input_bytes >> 20; in qla2x00_get_fc_host_stats()
1109 pfc_host_stat->fcp_output_megabytes = ha->qla_stats.output_bytes >> 20; in qla2x00_get_fc_host_stats()
1112 dma_pool_free(ha->s_dma_pool, stats, stats_dma); in qla2x00_get_fc_host_stats()
1169 struct qla_hw_data *ha = base_vha->hw; in qla24xx_vport_create() local
1226 if (ha->mqenable) { in qla24xx_vport_create()
1227 if (ha->npiv_info) { in qla24xx_vport_create()
1228 for (; cnt < ha->nvram_npiv_size; cnt++) { in qla24xx_vport_create()
1229 if (ha->npiv_info[cnt].port_name == in qla24xx_vport_create()
1231 ha->npiv_info[cnt].node_name == in qla24xx_vport_create()
1233 qos = ha->npiv_info[cnt].q_qos; in qla24xx_vport_create()
1254 struct qla_hw_data *ha = vha->hw; in qla24xx_vport_delete() local
1282 if (ha->mqenable) { in qla24xx_vport_delete()
1284 qla_printk(KERN_WARNING, ha, in qla24xx_vport_delete()
1289 qla_printk(KERN_INFO, ha, "vport %d deleted\n", id); in qla24xx_vport_delete()
1394 struct qla_hw_data *ha = vha->hw; in qla2x00_init_host_attr() local
1400 fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; in qla2x00_init_host_attr()
1401 fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; in qla2x00_init_host_attr()
1403 if (IS_QLA81XX(ha)) in qla2x00_init_host_attr()
1405 else if (IS_QLA25XX(ha)) in qla2x00_init_host_attr()
1408 else if (IS_QLA24XX_TYPE(ha)) in qla2x00_init_host_attr()
1411 else if (IS_QLA23XX(ha)) in qla2x00_init_host_attr()