Lines Matching refs:ha

16 	struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,  in qla4_8xxx_sysfs_read_fw_dump()  local
19 if (is_qla40XX(ha)) in qla4_8xxx_sysfs_read_fw_dump()
22 if (!test_bit(AF_82XX_DUMP_READING, &ha->flags)) in qla4_8xxx_sysfs_read_fw_dump()
25 return memory_read_from_buffer(buf, count, &off, ha->fw_dump, in qla4_8xxx_sysfs_read_fw_dump()
26 ha->fw_dump_size); in qla4_8xxx_sysfs_read_fw_dump()
34 struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, in qla4_8xxx_sysfs_write_fw_dump() local
40 if (is_qla40XX(ha)) in qla4_8xxx_sysfs_write_fw_dump()
49 ql4_printk(KERN_ERR, ha, "%s: Invalid input. Return err %d\n", in qla4_8xxx_sysfs_write_fw_dump()
57 if (test_and_clear_bit(AF_82XX_DUMP_READING, &ha->flags)) { in qla4_8xxx_sysfs_write_fw_dump()
58 clear_bit(AF_82XX_FW_DUMPED, &ha->flags); in qla4_8xxx_sysfs_write_fw_dump()
60 qla4xxx_alloc_fw_dump(ha); in qla4_8xxx_sysfs_write_fw_dump()
61 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_sysfs_write_fw_dump()
67 if (test_bit(AF_82XX_FW_DUMPED, &ha->flags) && in qla4_8xxx_sysfs_write_fw_dump()
68 !test_bit(AF_82XX_DUMP_READING, &ha->flags)) { in qla4_8xxx_sysfs_write_fw_dump()
69 set_bit(AF_82XX_DUMP_READING, &ha->flags); in qla4_8xxx_sysfs_write_fw_dump()
70 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_8xxx_sysfs_write_fw_dump()
72 ha->host_no)); in qla4_8xxx_sysfs_write_fw_dump()
77 ha->isp_ops->idc_lock(ha); in qla4_8xxx_sysfs_write_fw_dump()
78 dev_state = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DEV_STATE); in qla4_8xxx_sysfs_write_fw_dump()
80 ql4_printk(KERN_INFO, ha, "%s: Setting Need reset\n", in qla4_8xxx_sysfs_write_fw_dump()
82 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE, in qla4_8xxx_sysfs_write_fw_dump()
84 if (is_qla8022(ha) || in qla4_8xxx_sysfs_write_fw_dump()
85 ((is_qla8032(ha) || is_qla8042(ha)) && in qla4_8xxx_sysfs_write_fw_dump()
86 qla4_83xx_can_perform_reset(ha))) { in qla4_8xxx_sysfs_write_fw_dump()
87 set_bit(AF_8XXX_RST_OWNER, &ha->flags); in qla4_8xxx_sysfs_write_fw_dump()
88 set_bit(AF_FW_RECOVERY, &ha->flags); in qla4_8xxx_sysfs_write_fw_dump()
89 ql4_printk(KERN_INFO, ha, "%s: Reset owner is 0x%x\n", in qla4_8xxx_sysfs_write_fw_dump()
90 __func__, ha->func_num); in qla4_8xxx_sysfs_write_fw_dump()
93 ql4_printk(KERN_INFO, ha, in qla4_8xxx_sysfs_write_fw_dump()
97 ha->isp_ops->idc_unlock(ha); in qla4_8xxx_sysfs_write_fw_dump()
125 void qla4_8xxx_alloc_sysfs_attr(struct scsi_qla_host *ha) in qla4_8xxx_alloc_sysfs_attr() argument
127 struct Scsi_Host *host = ha->host; in qla4_8xxx_alloc_sysfs_attr()
135 ql4_printk(KERN_ERR, ha, in qla4_8xxx_alloc_sysfs_attr()
141 void qla4_8xxx_free_sysfs_attr(struct scsi_qla_host *ha) in qla4_8xxx_free_sysfs_attr() argument
143 struct Scsi_Host *host = ha->host; in qla4_8xxx_free_sysfs_attr()
156 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_fw_version_show() local
158 if (is_qla80XX(ha)) in qla4xxx_fw_version_show()
160 ha->fw_info.fw_major, ha->fw_info.fw_minor, in qla4xxx_fw_version_show()
161 ha->fw_info.fw_patch, ha->fw_info.fw_build); in qla4xxx_fw_version_show()
164 ha->fw_info.fw_major, ha->fw_info.fw_minor, in qla4xxx_fw_version_show()
165 ha->fw_info.fw_patch, ha->fw_info.fw_build); in qla4xxx_fw_version_show()
172 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_serial_num_show() local
173 return snprintf(buf, PAGE_SIZE, "%s\n", ha->serial_number); in qla4xxx_serial_num_show()
180 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_iscsi_version_show() local
181 return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fw_info.iscsi_major, in qla4xxx_iscsi_version_show()
182 ha->fw_info.iscsi_minor); in qla4xxx_iscsi_version_show()
189 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_optrom_version_show() local
191 ha->fw_info.bootload_major, ha->fw_info.bootload_minor, in qla4xxx_optrom_version_show()
192 ha->fw_info.bootload_patch, ha->fw_info.bootload_build); in qla4xxx_optrom_version_show()
199 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_board_id_show() local
200 return snprintf(buf, PAGE_SIZE, "0x%08X\n", ha->board_id); in qla4xxx_board_id_show()
207 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_fw_state_show() local
209 qla4xxx_get_firmware_state(ha); in qla4xxx_fw_state_show()
210 return snprintf(buf, PAGE_SIZE, "0x%08X%8X\n", ha->firmware_state, in qla4xxx_fw_state_show()
211 ha->addl_fw_state); in qla4xxx_fw_state_show()
218 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_phy_port_cnt_show() local
220 if (is_qla40XX(ha)) in qla4xxx_phy_port_cnt_show()
223 return snprintf(buf, PAGE_SIZE, "0x%04X\n", ha->phy_port_cnt); in qla4xxx_phy_port_cnt_show()
230 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_phy_port_num_show() local
232 if (is_qla40XX(ha)) in qla4xxx_phy_port_num_show()
235 return snprintf(buf, PAGE_SIZE, "0x%04X\n", ha->phy_port_num); in qla4xxx_phy_port_num_show()
242 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_iscsi_func_cnt_show() local
244 if (is_qla40XX(ha)) in qla4xxx_iscsi_func_cnt_show()
247 return snprintf(buf, PAGE_SIZE, "0x%04X\n", ha->iscsi_pci_func_cnt); in qla4xxx_iscsi_func_cnt_show()
254 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_hba_model_show() local
256 return snprintf(buf, PAGE_SIZE, "%s\n", ha->model_name); in qla4xxx_hba_model_show()
263 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_fw_timestamp_show() local
264 return snprintf(buf, PAGE_SIZE, "%s %s\n", ha->fw_info.fw_build_date, in qla4xxx_fw_timestamp_show()
265 ha->fw_info.fw_build_time); in qla4xxx_fw_timestamp_show()
272 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_fw_build_user_show() local
273 return snprintf(buf, PAGE_SIZE, "%s\n", ha->fw_info.fw_build_user); in qla4xxx_fw_build_user_show()
280 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_fw_ext_timestamp_show() local
281 return snprintf(buf, PAGE_SIZE, "%s\n", ha->fw_info.extended_timestamp); in qla4xxx_fw_ext_timestamp_show()
288 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_fw_load_src_show() local
291 switch (ha->fw_info.fw_load_source) { in qla4xxx_fw_load_src_show()
310 struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); in qla4xxx_fw_uptime_show() local
311 qla4xxx_about_firmware(ha); in qla4xxx_fw_uptime_show()
312 return snprintf(buf, PAGE_SIZE, "%u.%u secs\n", ha->fw_uptime_secs, in qla4xxx_fw_uptime_show()
313 ha->fw_uptime_msecs); in qla4xxx_fw_uptime_show()