Lines Matching refs:ha

14 void qla4xxx_queue_mbox_cmd(struct scsi_qla_host *ha, uint32_t *mbx_cmd,  in qla4xxx_queue_mbox_cmd()  argument
21 writel(mbx_cmd[i], &ha->reg->mailbox[i]); in qla4xxx_queue_mbox_cmd()
24 writel(mbx_cmd[0], &ha->reg->mailbox[0]); in qla4xxx_queue_mbox_cmd()
25 readl(&ha->reg->mailbox[0]); in qla4xxx_queue_mbox_cmd()
26 writel(set_rmask(CSR_INTR_RISC), &ha->reg->ctrl_status); in qla4xxx_queue_mbox_cmd()
27 readl(&ha->reg->ctrl_status); in qla4xxx_queue_mbox_cmd()
30 void qla4xxx_process_mbox_intr(struct scsi_qla_host *ha, int out_count) in qla4xxx_process_mbox_intr() argument
34 intr_status = readl(&ha->reg->ctrl_status); in qla4xxx_process_mbox_intr()
41 ha->mbox_status_count = out_count; in qla4xxx_process_mbox_intr()
42 ha->isp_ops->interrupt_service_routine(ha, intr_status); in qla4xxx_process_mbox_intr()
51 static int qla4xxx_is_intr_poll_mode(struct scsi_qla_host *ha) in qla4xxx_is_intr_poll_mode() argument
55 if (is_qla8032(ha) || is_qla8042(ha)) { in qla4xxx_is_intr_poll_mode()
56 if (test_bit(AF_IRQ_ATTACHED, &ha->flags) && in qla4xxx_is_intr_poll_mode()
57 test_bit(AF_83XX_MBOX_INTR_ON, &ha->flags)) in qla4xxx_is_intr_poll_mode()
60 if (test_bit(AF_IRQ_ATTACHED, &ha->flags) && in qla4xxx_is_intr_poll_mode()
61 test_bit(AF_INTERRUPTS_ON, &ha->flags) && in qla4xxx_is_intr_poll_mode()
62 test_bit(AF_ONLINE, &ha->flags) && in qla4xxx_is_intr_poll_mode()
63 !test_bit(AF_HA_REMOVAL, &ha->flags)) in qla4xxx_is_intr_poll_mode()
82 int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, in qla4xxx_mailbox_command() argument
95 "pointer\n", ha->host_no, __func__)); in qla4xxx_mailbox_command()
99 if (is_qla40XX(ha)) { in qla4xxx_mailbox_command()
100 if (test_bit(AF_HA_REMOVAL, &ha->flags)) { in qla4xxx_mailbox_command()
101 DEBUG2(ql4_printk(KERN_WARNING, ha, "scsi%ld: %s: " in qla4xxx_mailbox_command()
104 ha->host_no, __func__)); in qla4xxx_mailbox_command()
109 if ((is_aer_supported(ha)) && in qla4xxx_mailbox_command()
110 (test_bit(AF_PCI_CHANNEL_IO_PERM_FAILURE, &ha->flags))) { in qla4xxx_mailbox_command()
112 "timeout MBX Exiting.\n", ha->host_no, __func__)); in qla4xxx_mailbox_command()
120 mutex_lock(&ha->mbox_sem); in qla4xxx_mailbox_command()
121 if (!test_bit(AF_MBOX_COMMAND, &ha->flags)) { in qla4xxx_mailbox_command()
122 set_bit(AF_MBOX_COMMAND, &ha->flags); in qla4xxx_mailbox_command()
123 mutex_unlock(&ha->mbox_sem); in qla4xxx_mailbox_command()
126 mutex_unlock(&ha->mbox_sem); in qla4xxx_mailbox_command()
129 ha->host_no, __func__)); in qla4xxx_mailbox_command()
135 if (is_qla80XX(ha)) { in qla4xxx_mailbox_command()
136 if (test_bit(AF_FW_RECOVERY, &ha->flags)) { in qla4xxx_mailbox_command()
137 DEBUG2(ql4_printk(KERN_WARNING, ha, in qla4xxx_mailbox_command()
139 ha->host_no, __func__)); in qla4xxx_mailbox_command()
143 ha->isp_ops->idc_lock(ha); in qla4xxx_mailbox_command()
144 dev_state = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DEV_STATE); in qla4xxx_mailbox_command()
145 ha->isp_ops->idc_unlock(ha); in qla4xxx_mailbox_command()
147 ql4_printk(KERN_WARNING, ha, in qla4xxx_mailbox_command()
149 ha->host_no, __func__); in qla4xxx_mailbox_command()
154 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_mailbox_command()
156 ha->mbox_status_count = outCount; in qla4xxx_mailbox_command()
158 ha->mbox_status[i] = 0; in qla4xxx_mailbox_command()
161 ha->isp_ops->queue_mailbox_command(ha, mbx_cmd, inCount); in qla4xxx_mailbox_command()
163 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_mailbox_command()
180 if (qla4xxx_is_intr_poll_mode(ha)) { in qla4xxx_mailbox_command()
183 while (test_bit(AF_MBOX_COMMAND_DONE, &ha->flags) == 0) { in qla4xxx_mailbox_command()
192 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_mailbox_command()
193 ha->isp_ops->process_mailbox_interrupt(ha, outCount); in qla4xxx_mailbox_command()
194 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_mailbox_command()
199 set_bit(AF_MBOX_COMMAND_NOPOLL, &ha->flags); in qla4xxx_mailbox_command()
200 wait_for_completion_timeout(&ha->mbx_intr_comp, MBOX_TOV * HZ); in qla4xxx_mailbox_command()
201 clear_bit(AF_MBOX_COMMAND_NOPOLL, &ha->flags); in qla4xxx_mailbox_command()
205 if (!test_bit(AF_MBOX_COMMAND_DONE, &ha->flags)) { in qla4xxx_mailbox_command()
206 if (is_qla80XX(ha) && in qla4xxx_mailbox_command()
207 test_bit(AF_FW_RECOVERY, &ha->flags)) { in qla4xxx_mailbox_command()
208 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4xxx_mailbox_command()
211 ha->host_no, __func__)); in qla4xxx_mailbox_command()
214 ql4_printk(KERN_WARNING, ha, "scsi%ld: Mailbox Cmd 0x%08X timed out, Scheduling Adapter Reset\n", in qla4xxx_mailbox_command()
215 ha->host_no, mbx_cmd[0]); in qla4xxx_mailbox_command()
216 ha->mailbox_timeout_count++; in qla4xxx_mailbox_command()
218 set_bit(DPC_RESET_HA, &ha->dpc_flags); in qla4xxx_mailbox_command()
219 if (is_qla8022(ha)) { in qla4xxx_mailbox_command()
220 ql4_printk(KERN_INFO, ha, in qla4xxx_mailbox_command()
222 qla4_82xx_wr_32(ha, QLA82XX_CRB_NIU + 0x98, in qla4xxx_mailbox_command()
225 } else if (is_qla8032(ha) || is_qla8042(ha)) { in qla4xxx_mailbox_command()
226 ql4_printk(KERN_INFO, ha, " %s: disabling pause transmit on port 0 & 1.\n", in qla4xxx_mailbox_command()
228 qla4_83xx_disable_pause(ha); in qla4xxx_mailbox_command()
237 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_mailbox_command()
239 mbx_sts[i] = ha->mbox_status[i]; in qla4xxx_mailbox_command()
242 switch (ha->mbox_status[0]) { in qla4xxx_mailbox_command()
252 ql4_printk(KERN_WARNING, ha, "scsi%ld: %s: Cmd = %08X, ISP BUSY\n", in qla4xxx_mailbox_command()
253 ha->host_no, __func__, mbx_cmd[0]); in qla4xxx_mailbox_command()
254 ha->mailbox_timeout_count++; in qla4xxx_mailbox_command()
258 …ql4_printk(KERN_WARNING, ha, "scsi%ld: %s: FAILED, MBOX CMD = %08X, MBOX STS = %08X %08X %08X %08X… in qla4xxx_mailbox_command()
259 ha->host_no, __func__, mbx_cmd[0], mbx_sts[0], in qla4xxx_mailbox_command()
264 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_mailbox_command()
267 mutex_lock(&ha->mbox_sem); in qla4xxx_mailbox_command()
268 clear_bit(AF_MBOX_COMMAND, &ha->flags); in qla4xxx_mailbox_command()
269 mutex_unlock(&ha->mbox_sem); in qla4xxx_mailbox_command()
270 clear_bit(AF_MBOX_COMMAND_DONE, &ha->flags); in qla4xxx_mailbox_command()
283 int qla4xxx_get_minidump_template(struct scsi_qla_host *ha, in qla4xxx_get_minidump_template() argument
297 mbox_cmd[4] = ha->fw_dump_tmplt_size; in qla4xxx_get_minidump_template()
300 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 2, &mbox_cmd[0], in qla4xxx_get_minidump_template()
303 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4xxx_get_minidump_template()
305 ha->host_no, __func__, mbox_cmd[0], in qla4xxx_get_minidump_template()
315 int qla4xxx_req_template_size(struct scsi_qla_host *ha) in qla4xxx_req_template_size() argument
327 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 8, &mbox_cmd[0], in qla4xxx_req_template_size()
330 ha->fw_dump_tmplt_size = mbox_sts[1]; in qla4xxx_req_template_size()
331 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4xxx_req_template_size()
336 if (ha->fw_dump_tmplt_size == 0) in qla4xxx_req_template_size()
339 ql4_printk(KERN_WARNING, ha, in qla4xxx_req_template_size()
348 void qla4xxx_mailbox_premature_completion(struct scsi_qla_host *ha) in qla4xxx_mailbox_premature_completion() argument
350 set_bit(AF_FW_RECOVERY, &ha->flags); in qla4xxx_mailbox_premature_completion()
351 ql4_printk(KERN_INFO, ha, "scsi%ld: %s: set FW RECOVERY!\n", in qla4xxx_mailbox_premature_completion()
352 ha->host_no, __func__); in qla4xxx_mailbox_premature_completion()
354 if (test_bit(AF_MBOX_COMMAND, &ha->flags)) { in qla4xxx_mailbox_premature_completion()
355 if (test_bit(AF_MBOX_COMMAND_NOPOLL, &ha->flags)) { in qla4xxx_mailbox_premature_completion()
356 complete(&ha->mbx_intr_comp); in qla4xxx_mailbox_premature_completion()
357 ql4_printk(KERN_INFO, ha, "scsi%ld: %s: Due to fw " in qla4xxx_mailbox_premature_completion()
359 "mbx cmd\n", ha->host_no, __func__); in qla4xxx_mailbox_premature_completion()
362 set_bit(AF_MBOX_COMMAND_DONE, &ha->flags); in qla4xxx_mailbox_premature_completion()
363 ql4_printk(KERN_INFO, ha, "scsi%ld: %s: Due to fw " in qla4xxx_mailbox_premature_completion()
365 "polling mbx cmd\n", ha->host_no, __func__); in qla4xxx_mailbox_premature_completion()
371 qla4xxx_set_ifcb(struct scsi_qla_host *ha, uint32_t *mbox_cmd, in qla4xxx_set_ifcb() argument
377 if (is_qla8022(ha)) in qla4xxx_set_ifcb()
378 qla4_82xx_wr_32(ha, ha->nx_db_wr_ptr, 0); in qla4xxx_set_ifcb()
386 if (qla4xxx_mailbox_command(ha, 6, 6, mbox_cmd, mbox_sts) != in qla4xxx_set_ifcb()
391 ha->host_no, __func__, mbox_sts[0])); in qla4xxx_set_ifcb()
398 qla4xxx_get_ifcb(struct scsi_qla_host *ha, uint32_t *mbox_cmd, in qla4xxx_get_ifcb() argument
408 if (qla4xxx_mailbox_command(ha, 5, 5, mbox_cmd, mbox_sts) != in qla4xxx_get_ifcb()
413 ha->host_no, __func__, mbox_sts[0])); in qla4xxx_get_ifcb()
452 qla4xxx_update_local_ip(struct scsi_qla_host *ha, in qla4xxx_update_local_ip() argument
455 ha->ip_config.tcp_options = le16_to_cpu(init_fw_cb->ipv4_tcp_opts); in qla4xxx_update_local_ip()
456 ha->ip_config.ipv4_options = le16_to_cpu(init_fw_cb->ipv4_ip_opts); in qla4xxx_update_local_ip()
457 ha->ip_config.ipv4_addr_state = in qla4xxx_update_local_ip()
459 ha->ip_config.eth_mtu_size = in qla4xxx_update_local_ip()
461 ha->ip_config.ipv4_port = le16_to_cpu(init_fw_cb->ipv4_port); in qla4xxx_update_local_ip()
463 if (ha->acb_version == ACB_SUPPORTED) { in qla4xxx_update_local_ip()
464 ha->ip_config.ipv6_options = le16_to_cpu(init_fw_cb->ipv6_opts); in qla4xxx_update_local_ip()
465 ha->ip_config.ipv6_addl_options = in qla4xxx_update_local_ip()
467 ha->ip_config.ipv6_tcp_options = in qla4xxx_update_local_ip()
472 memcpy(ha->ip_config.ip_address, init_fw_cb->ipv4_addr, in qla4xxx_update_local_ip()
473 min(sizeof(ha->ip_config.ip_address), in qla4xxx_update_local_ip()
475 memcpy(ha->ip_config.subnet_mask, init_fw_cb->ipv4_subnet, in qla4xxx_update_local_ip()
476 min(sizeof(ha->ip_config.subnet_mask), in qla4xxx_update_local_ip()
478 memcpy(ha->ip_config.gateway, init_fw_cb->ipv4_gw_addr, in qla4xxx_update_local_ip()
479 min(sizeof(ha->ip_config.gateway), in qla4xxx_update_local_ip()
482 ha->ip_config.ipv4_vlan_tag = be16_to_cpu(init_fw_cb->ipv4_vlan_tag); in qla4xxx_update_local_ip()
483 ha->ip_config.control = init_fw_cb->control; in qla4xxx_update_local_ip()
484 ha->ip_config.tcp_wsf = init_fw_cb->ipv4_tcp_wsf; in qla4xxx_update_local_ip()
485 ha->ip_config.ipv4_tos = init_fw_cb->ipv4_tos; in qla4xxx_update_local_ip()
486 ha->ip_config.ipv4_cache_id = init_fw_cb->ipv4_cacheid; in qla4xxx_update_local_ip()
487 ha->ip_config.ipv4_alt_cid_len = init_fw_cb->ipv4_dhcp_alt_cid_len; in qla4xxx_update_local_ip()
488 memcpy(ha->ip_config.ipv4_alt_cid, init_fw_cb->ipv4_dhcp_alt_cid, in qla4xxx_update_local_ip()
489 min(sizeof(ha->ip_config.ipv4_alt_cid), in qla4xxx_update_local_ip()
491 ha->ip_config.ipv4_vid_len = init_fw_cb->ipv4_dhcp_vid_len; in qla4xxx_update_local_ip()
492 memcpy(ha->ip_config.ipv4_vid, init_fw_cb->ipv4_dhcp_vid, in qla4xxx_update_local_ip()
493 min(sizeof(ha->ip_config.ipv4_vid), in qla4xxx_update_local_ip()
495 ha->ip_config.ipv4_ttl = init_fw_cb->ipv4_ttl; in qla4xxx_update_local_ip()
496 ha->ip_config.def_timeout = le16_to_cpu(init_fw_cb->def_timeout); in qla4xxx_update_local_ip()
497 ha->ip_config.abort_timer = init_fw_cb->abort_timer; in qla4xxx_update_local_ip()
498 ha->ip_config.iscsi_options = le16_to_cpu(init_fw_cb->iscsi_opts); in qla4xxx_update_local_ip()
499 ha->ip_config.iscsi_max_pdu_size = in qla4xxx_update_local_ip()
501 ha->ip_config.iscsi_first_burst_len = in qla4xxx_update_local_ip()
503 ha->ip_config.iscsi_max_outstnd_r2t = in qla4xxx_update_local_ip()
505 ha->ip_config.iscsi_max_burst_len = in qla4xxx_update_local_ip()
507 memcpy(ha->ip_config.iscsi_name, init_fw_cb->iscsi_name, in qla4xxx_update_local_ip()
508 min(sizeof(ha->ip_config.iscsi_name), in qla4xxx_update_local_ip()
511 if (is_ipv6_enabled(ha)) { in qla4xxx_update_local_ip()
513 ha->ip_config.ipv6_link_local_state = in qla4xxx_update_local_ip()
515 ha->ip_config.ipv6_addr0_state = in qla4xxx_update_local_ip()
517 ha->ip_config.ipv6_addr1_state = in qla4xxx_update_local_ip()
522 ha->ip_config.ipv6_default_router_state = in qla4xxx_update_local_ip()
526 ha->ip_config.ipv6_default_router_state = in qla4xxx_update_local_ip()
530 ha->ip_config.ipv6_default_router_state = in qla4xxx_update_local_ip()
534 ha->ip_config.ipv6_default_router_state = in qla4xxx_update_local_ip()
538 ha->ip_config.ipv6_default_router_state = in qla4xxx_update_local_ip()
542 ha->ip_config.ipv6_link_local_addr.in6_u.u6_addr8[0] = 0xFE; in qla4xxx_update_local_ip()
543 ha->ip_config.ipv6_link_local_addr.in6_u.u6_addr8[1] = 0x80; in qla4xxx_update_local_ip()
545 memcpy(&ha->ip_config.ipv6_link_local_addr.in6_u.u6_addr8[8], in qla4xxx_update_local_ip()
547 min(sizeof(ha->ip_config.ipv6_link_local_addr)/2, in qla4xxx_update_local_ip()
549 memcpy(&ha->ip_config.ipv6_addr0, init_fw_cb->ipv6_addr0, in qla4xxx_update_local_ip()
550 min(sizeof(ha->ip_config.ipv6_addr0), in qla4xxx_update_local_ip()
552 memcpy(&ha->ip_config.ipv6_addr1, init_fw_cb->ipv6_addr1, in qla4xxx_update_local_ip()
553 min(sizeof(ha->ip_config.ipv6_addr1), in qla4xxx_update_local_ip()
555 memcpy(&ha->ip_config.ipv6_default_router_addr, in qla4xxx_update_local_ip()
557 min(sizeof(ha->ip_config.ipv6_default_router_addr), in qla4xxx_update_local_ip()
559 ha->ip_config.ipv6_vlan_tag = in qla4xxx_update_local_ip()
561 ha->ip_config.ipv6_port = le16_to_cpu(init_fw_cb->ipv6_port); in qla4xxx_update_local_ip()
562 ha->ip_config.ipv6_cache_id = init_fw_cb->ipv6_cache_id; in qla4xxx_update_local_ip()
563 ha->ip_config.ipv6_flow_lbl = in qla4xxx_update_local_ip()
565 ha->ip_config.ipv6_traffic_class = in qla4xxx_update_local_ip()
567 ha->ip_config.ipv6_hop_limit = init_fw_cb->ipv6_hop_limit; in qla4xxx_update_local_ip()
568 ha->ip_config.ipv6_nd_reach_time = in qla4xxx_update_local_ip()
570 ha->ip_config.ipv6_nd_rexmit_timer = in qla4xxx_update_local_ip()
572 ha->ip_config.ipv6_nd_stale_timeout = in qla4xxx_update_local_ip()
574 ha->ip_config.ipv6_dup_addr_detect_count = in qla4xxx_update_local_ip()
576 ha->ip_config.ipv6_gw_advrt_mtu = in qla4xxx_update_local_ip()
578 ha->ip_config.ipv6_tcp_wsf = init_fw_cb->ipv6_tcp_wsf; in qla4xxx_update_local_ip()
583 qla4xxx_update_local_ifcb(struct scsi_qla_host *ha, in qla4xxx_update_local_ifcb() argument
589 if (qla4xxx_get_ifcb(ha, mbox_cmd, mbox_sts, init_fw_cb_dma) in qla4xxx_update_local_ifcb()
593 ha->host_no, __func__)); in qla4xxx_update_local_ifcb()
600 ha->acb_version = init_fw_cb->acb_version; in qla4xxx_update_local_ifcb()
601 ha->firmware_options = le16_to_cpu(init_fw_cb->fw_options); in qla4xxx_update_local_ifcb()
602 ha->heartbeat_interval = init_fw_cb->hb_interval; in qla4xxx_update_local_ifcb()
603 memcpy(ha->name_string, init_fw_cb->iscsi_name, in qla4xxx_update_local_ifcb()
604 min(sizeof(ha->name_string), in qla4xxx_update_local_ifcb()
606 ha->def_timeout = le16_to_cpu(init_fw_cb->def_timeout); in qla4xxx_update_local_ifcb()
610 qla4xxx_update_local_ip(ha, init_fw_cb); in qla4xxx_update_local_ifcb()
619 int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha) in qla4xxx_initialize_fw_cb() argument
627 init_fw_cb = dma_alloc_coherent(&ha->pdev->dev, in qla4xxx_initialize_fw_cb()
632 ha->host_no, __func__)); in qla4xxx_initialize_fw_cb()
640 if (qla4xxx_get_ifcb(ha, &mbox_cmd[0], &mbox_sts[0], init_fw_cb_dma) != in qla4xxx_initialize_fw_cb()
646 init_fw_cb->rqq_consumer_idx = cpu_to_le16(ha->request_out); in qla4xxx_initialize_fw_cb()
647 init_fw_cb->compq_producer_idx = cpu_to_le16(ha->response_in); in qla4xxx_initialize_fw_cb()
650 init_fw_cb->rqq_addr_lo = cpu_to_le32(LSDW(ha->request_dma)); in qla4xxx_initialize_fw_cb()
651 init_fw_cb->rqq_addr_hi = cpu_to_le32(MSDW(ha->request_dma)); in qla4xxx_initialize_fw_cb()
652 init_fw_cb->compq_addr_lo = cpu_to_le32(LSDW(ha->response_dma)); in qla4xxx_initialize_fw_cb()
653 init_fw_cb->compq_addr_hi = cpu_to_le32(MSDW(ha->response_dma)); in qla4xxx_initialize_fw_cb()
654 init_fw_cb->shdwreg_addr_lo = cpu_to_le32(LSDW(ha->shadow_regs_dma)); in qla4xxx_initialize_fw_cb()
655 init_fw_cb->shdwreg_addr_hi = cpu_to_le32(MSDW(ha->shadow_regs_dma)); in qla4xxx_initialize_fw_cb()
662 if (is_qla80XX(ha)) in qla4xxx_initialize_fw_cb()
674 if (qla4xxx_set_ifcb(ha, &mbox_cmd[0], &mbox_sts[0], init_fw_cb_dma) in qla4xxx_initialize_fw_cb()
678 ha->host_no, __func__)); in qla4xxx_initialize_fw_cb()
682 if (qla4xxx_update_local_ifcb(ha, &mbox_cmd[0], &mbox_sts[0], in qla4xxx_initialize_fw_cb()
685 ha->host_no, __func__)); in qla4xxx_initialize_fw_cb()
691 dma_free_coherent(&ha->pdev->dev, sizeof(struct addr_ctrl_blk), in qla4xxx_initialize_fw_cb()
701 int qla4xxx_get_dhcp_ip_address(struct scsi_qla_host * ha) in qla4xxx_get_dhcp_ip_address() argument
708 init_fw_cb = dma_alloc_coherent(&ha->pdev->dev, in qla4xxx_get_dhcp_ip_address()
712 printk("scsi%ld: %s: Unable to alloc init_cb\n", ha->host_no, in qla4xxx_get_dhcp_ip_address()
718 if (qla4xxx_get_ifcb(ha, &mbox_cmd[0], &mbox_sts[0], init_fw_cb_dma) != in qla4xxx_get_dhcp_ip_address()
721 ha->host_no, __func__)); in qla4xxx_get_dhcp_ip_address()
722 dma_free_coherent(&ha->pdev->dev, in qla4xxx_get_dhcp_ip_address()
729 qla4xxx_update_local_ip(ha, init_fw_cb); in qla4xxx_get_dhcp_ip_address()
730 dma_free_coherent(&ha->pdev->dev, sizeof(struct addr_ctrl_blk), in qla4xxx_get_dhcp_ip_address()
740 int qla4xxx_get_firmware_state(struct scsi_qla_host * ha) in qla4xxx_get_firmware_state() argument
751 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 4, &mbox_cmd[0], &mbox_sts[0]) != in qla4xxx_get_firmware_state()
754 "status %04X\n", ha->host_no, __func__, in qla4xxx_get_firmware_state()
758 ha->firmware_state = mbox_sts[1]; in qla4xxx_get_firmware_state()
759 ha->board_id = mbox_sts[2]; in qla4xxx_get_firmware_state()
760 ha->addl_fw_state = mbox_sts[3]; in qla4xxx_get_firmware_state()
762 ha->host_no, __func__, ha->firmware_state);) in qla4xxx_get_firmware_state()
771 int qla4xxx_get_firmware_status(struct scsi_qla_host * ha) in qla4xxx_get_firmware_status() argument
782 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 3, &mbox_cmd[0], &mbox_sts[0]) != in qla4xxx_get_firmware_status()
785 "status %04X\n", ha->host_no, __func__, in qla4xxx_get_firmware_status()
791 ha->iocb_hiwat = mbox_sts[2]; in qla4xxx_get_firmware_status()
792 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4xxx_get_firmware_status()
794 ha->iocb_hiwat)); in qla4xxx_get_firmware_status()
796 if (ha->iocb_hiwat > IOCB_HIWAT_CUSHION) in qla4xxx_get_firmware_status()
797 ha->iocb_hiwat -= IOCB_HIWAT_CUSHION; in qla4xxx_get_firmware_status()
802 if (ha->iocb_hiwat == 0) { in qla4xxx_get_firmware_status()
803 ha->iocb_hiwat = REQUEST_QUEUE_DEPTH / 4; in qla4xxx_get_firmware_status()
804 DEBUG2(ql4_printk(KERN_WARNING, ha, in qla4xxx_get_firmware_status()
806 ha->iocb_hiwat)); in qla4xxx_get_firmware_status()
821 int qla4xxx_get_fwddb_entry(struct scsi_qla_host *ha, in qla4xxx_get_fwddb_entry() argument
840 ha->host_no, __func__, fw_ddb_index)); in qla4xxx_get_fwddb_entry()
854 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 7, &mbox_cmd[0], &mbox_sts[0]) == in qla4xxx_get_fwddb_entry()
857 " with status 0x%04X\n", ha->host_no, __func__, in qla4xxx_get_fwddb_entry()
863 ha->host_no, __func__, fw_ddb_index, in qla4xxx_get_fwddb_entry()
870 ql4_printk(KERN_INFO, ha, "%s: DDB[%d] MB0 %04x Tot %d " in qla4xxx_get_fwddb_entry()
879 ql4_printk(KERN_INFO, ha, "%s: DDB[%d] MB0 %04x Tot %d " in qla4xxx_get_fwddb_entry()
915 int qla4xxx_conn_open(struct scsi_qla_host *ha, uint16_t fw_ddb_index) in qla4xxx_conn_open() argument
927 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 2, &mbox_cmd[0], in qla4xxx_conn_open()
929 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4xxx_conn_open()
945 int qla4xxx_set_ddb_entry(struct scsi_qla_host * ha, uint16_t fw_ddb_index, in qla4xxx_set_ddb_entry() argument
964 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], in qla4xxx_set_ddb_entry()
969 ha->host_no, __func__, status, mbox_sts[0], mbox_sts[4]);) in qla4xxx_set_ddb_entry()
974 int qla4xxx_session_logout_ddb(struct scsi_qla_host *ha, in qla4xxx_session_logout_ddb() argument
988 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 2, &mbox_cmd[0], in qla4xxx_session_logout_ddb()
991 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4xxx_session_logout_ddb()
1010 void qla4xxx_get_crash_record(struct scsi_qla_host * ha) in qla4xxx_get_crash_record() argument
1024 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], &mbox_sts[0]) != in qla4xxx_get_crash_record()
1027 ha->host_no, __func__)); in qla4xxx_get_crash_record()
1033 ha->host_no, __func__)); in qla4xxx_get_crash_record()
1038 crash_record = dma_alloc_coherent(&ha->pdev->dev, crash_record_size, in qla4xxx_get_crash_record()
1052 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], &mbox_sts[0]) != in qla4xxx_get_crash_record()
1060 dma_free_coherent(&ha->pdev->dev, crash_record_size, in qla4xxx_get_crash_record()
1068 void qla4xxx_get_conn_event_log(struct scsi_qla_host * ha) in qla4xxx_get_conn_event_log() argument
1086 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], &mbox_sts[0]) != in qla4xxx_get_conn_event_log()
1095 event_log = dma_alloc_coherent(&ha->pdev->dev, event_log_size, in qla4xxx_get_conn_event_log()
1108 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], &mbox_sts[0]) != in qla4xxx_get_conn_event_log()
1111 "log!\n", ha->host_no, __func__)); in qla4xxx_get_conn_event_log()
1125 ha->host_no, num_valid_entries)); in qla4xxx_get_conn_event_log()
1154 dma_free_coherent(&ha->pdev->dev, event_log_size, event_log, in qla4xxx_get_conn_event_log()
1167 int qla4xxx_abort_task(struct scsi_qla_host *ha, struct srb *srb) in qla4xxx_abort_task() argument
1183 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_abort_task()
1185 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_abort_task()
1197 qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], in qla4xxx_abort_task()
1204 ha->host_no, cmd->device->id, cmd->device->lun, mbox_sts[0], in qla4xxx_abort_task()
1221 int qla4xxx_reset_lun(struct scsi_qla_host * ha, struct ddb_entry * ddb_entry, in qla4xxx_reset_lun() argument
1229 DEBUG2(printk("scsi%ld:%d:%llu: lun reset issued\n", ha->host_no, in qla4xxx_reset_lun()
1250 qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], &mbox_sts[0]); in qla4xxx_reset_lun()
1267 int qla4xxx_reset_target(struct scsi_qla_host *ha, in qla4xxx_reset_target() argument
1274 DEBUG2(printk("scsi%ld:%d: target reset issued\n", ha->host_no, in qla4xxx_reset_target()
1288 qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], in qla4xxx_reset_target()
1297 int qla4xxx_get_flash(struct scsi_qla_host * ha, dma_addr_t dma_addr, in qla4xxx_get_flash() argument
1312 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 2, &mbox_cmd[0], &mbox_sts[0]) != in qla4xxx_get_flash()
1315 "status %04X %04X, offset %08x, len %08x\n", ha->host_no, in qla4xxx_get_flash()
1330 int qla4xxx_about_firmware(struct scsi_qla_host *ha) in qla4xxx_about_firmware() argument
1338 about_fw = dma_alloc_coherent(&ha->pdev->dev, in qla4xxx_about_firmware()
1342 DEBUG2(ql4_printk(KERN_ERR, ha, "%s: Unable to alloc memory " in qla4xxx_about_firmware()
1355 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, MBOX_REG_COUNT, in qla4xxx_about_firmware()
1358 DEBUG2(ql4_printk(KERN_WARNING, ha, "%s: MBOX_CMD_ABOUT_FW " in qla4xxx_about_firmware()
1365 ha->fw_info.fw_major = le16_to_cpu(about_fw->fw_major); in qla4xxx_about_firmware()
1366 ha->fw_info.fw_minor = le16_to_cpu(about_fw->fw_minor); in qla4xxx_about_firmware()
1367 ha->fw_info.fw_patch = le16_to_cpu(about_fw->fw_patch); in qla4xxx_about_firmware()
1368 ha->fw_info.fw_build = le16_to_cpu(about_fw->fw_build); in qla4xxx_about_firmware()
1369 memcpy(ha->fw_info.fw_build_date, about_fw->fw_build_date, in qla4xxx_about_firmware()
1371 memcpy(ha->fw_info.fw_build_time, about_fw->fw_build_time, in qla4xxx_about_firmware()
1373 strcpy((char *)ha->fw_info.fw_build_user, in qla4xxx_about_firmware()
1375 ha->fw_info.fw_load_source = le16_to_cpu(about_fw->fw_load_source); in qla4xxx_about_firmware()
1376 ha->fw_info.iscsi_major = le16_to_cpu(about_fw->iscsi_major); in qla4xxx_about_firmware()
1377 ha->fw_info.iscsi_minor = le16_to_cpu(about_fw->iscsi_minor); in qla4xxx_about_firmware()
1378 ha->fw_info.bootload_major = le16_to_cpu(about_fw->bootload_major); in qla4xxx_about_firmware()
1379 ha->fw_info.bootload_minor = le16_to_cpu(about_fw->bootload_minor); in qla4xxx_about_firmware()
1380 ha->fw_info.bootload_patch = le16_to_cpu(about_fw->bootload_patch); in qla4xxx_about_firmware()
1381 ha->fw_info.bootload_build = le16_to_cpu(about_fw->bootload_build); in qla4xxx_about_firmware()
1382 strcpy((char *)ha->fw_info.extended_timestamp, in qla4xxx_about_firmware()
1385 ha->fw_uptime_secs = le32_to_cpu(mbox_sts[5]); in qla4xxx_about_firmware()
1386 ha->fw_uptime_msecs = le32_to_cpu(mbox_sts[6]); in qla4xxx_about_firmware()
1390 dma_free_coherent(&ha->pdev->dev, sizeof(struct about_fw_info), in qla4xxx_about_firmware()
1395 int qla4xxx_get_default_ddb(struct scsi_qla_host *ha, uint32_t options, in qla4xxx_get_default_ddb() argument
1409 if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], &mbox_sts[0]) != in qla4xxx_get_default_ddb()
1412 ha->host_no, __func__, mbox_sts[0])); in qla4xxx_get_default_ddb()
1418 int qla4xxx_req_ddb_entry(struct scsi_qla_host *ha, uint32_t ddb_index, in qla4xxx_req_ddb_entry() argument
1431 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], in qla4xxx_req_ddb_entry()
1434 DEBUG2(ql4_printk(KERN_ERR, ha, "%s: failed status %04X\n", in qla4xxx_req_ddb_entry()
1442 int qla4xxx_clear_ddb_entry(struct scsi_qla_host *ha, uint32_t ddb_index) in qla4xxx_clear_ddb_entry() argument
1454 status = qla4xxx_mailbox_command(ha, 2, 1, &mbox_cmd[0], in qla4xxx_clear_ddb_entry()
1457 DEBUG2(ql4_printk(KERN_ERR, ha, "%s: failed status %04X\n", in qla4xxx_clear_ddb_entry()
1464 int qla4xxx_set_flash(struct scsi_qla_host *ha, dma_addr_t dma_addr, in qla4xxx_set_flash() argument
1481 status = qla4xxx_mailbox_command(ha, 6, 2, &mbox_cmd[0], &mbox_sts[0]); in qla4xxx_set_flash()
1483 DEBUG2(ql4_printk(KERN_WARNING, ha, "%s: MBOX_CMD_WRITE_FLASH " in qla4xxx_set_flash()
1490 int qla4xxx_bootdb_by_index(struct scsi_qla_host *ha, in qla4xxx_bootdb_by_index() argument
1504 DEBUG2(ql4_printk(KERN_ERR, ha, in qla4xxx_bootdb_by_index()
1510 if (qla4xxx_get_flash(ha, fw_ddb_entry_dma, dev_db_start_offset, in qla4xxx_bootdb_by_index()
1512 ql4_printk(KERN_ERR, ha, "scsi%ld: %s: Get Flash" in qla4xxx_bootdb_by_index()
1513 "failed\n", ha->host_no, __func__); in qla4xxx_bootdb_by_index()
1524 int qla4xxx_flashdb_by_index(struct scsi_qla_host *ha, in qla4xxx_flashdb_by_index() argument
1534 if (is_qla40XX(ha)) { in qla4xxx_flashdb_by_index()
1539 (ha->hw.flt_region_ddb << 2); in qla4xxx_flashdb_by_index()
1543 if (ha->port_num == 1) in qla4xxx_flashdb_by_index()
1544 dev_db_start_offset += (ha->hw.flt_ddb_size / 2); in qla4xxx_flashdb_by_index()
1547 (ha->hw.flt_ddb_size / 2); in qla4xxx_flashdb_by_index()
1553 DEBUG2(ql4_printk(KERN_ERR, ha, in qla4xxx_flashdb_by_index()
1559 if (qla4xxx_get_flash(ha, fw_ddb_entry_dma, dev_db_start_offset, in qla4xxx_flashdb_by_index()
1561 ql4_printk(KERN_ERR, ha, "scsi%ld: %s: Get Flash failed\n", in qla4xxx_flashdb_by_index()
1562 ha->host_no, __func__); in qla4xxx_flashdb_by_index()
1573 int qla4xxx_get_chap(struct scsi_qla_host *ha, char *username, char *password, in qla4xxx_get_chap() argument
1582 chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma); in qla4xxx_get_chap()
1588 if (is_qla40XX(ha)) in qla4xxx_get_chap()
1591 offset = FLASH_RAW_ACCESS_ADDR + (ha->hw.flt_region_chap << 2); in qla4xxx_get_chap()
1595 if (ha->port_num == 1) in qla4xxx_get_chap()
1596 offset += (ha->hw.flt_chap_size / 2); in qla4xxx_get_chap()
1600 rval = qla4xxx_get_flash(ha, chap_dma, offset, chap_size); in qla4xxx_get_chap()
1606 DEBUG2(ql4_printk(KERN_INFO, ha, "Chap Cookie: x%x\n", in qla4xxx_get_chap()
1610 ql4_printk(KERN_ERR, ha, "No valid chap entry found\n"); in qla4xxx_get_chap()
1619 dma_pool_free(ha->chap_dma_pool, chap_table, chap_dma); in qla4xxx_get_chap()
1635 int qla4xxx_set_chap(struct scsi_qla_host *ha, char *username, char *password, in qla4xxx_set_chap() argument
1645 chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma); in qla4xxx_set_chap()
1660 if (is_qla40XX(ha)) { in qla4xxx_set_chap()
1666 chap_size = ha->hw.flt_chap_size / 2; in qla4xxx_set_chap()
1667 offset = FLASH_RAW_ACCESS_ADDR + (ha->hw.flt_region_chap << 2); in qla4xxx_set_chap()
1668 if (ha->port_num == 1) in qla4xxx_set_chap()
1673 rval = qla4xxx_set_flash(ha, chap_dma, offset, in qla4xxx_set_chap()
1677 if (rval == QLA_SUCCESS && ha->chap_list) { in qla4xxx_set_chap()
1679 memcpy((struct ql4_chap_table *)ha->chap_list + idx, in qla4xxx_set_chap()
1682 dma_pool_free(ha->chap_dma_pool, chap_table, chap_dma); in qla4xxx_set_chap()
1691 int qla4xxx_get_uni_chap_at_index(struct scsi_qla_host *ha, char *username, in qla4xxx_get_uni_chap_at_index() argument
1698 if (!ha->chap_list) { in qla4xxx_get_uni_chap_at_index()
1699 ql4_printk(KERN_ERR, ha, "Do not have CHAP table cache\n"); in qla4xxx_get_uni_chap_at_index()
1705 ql4_printk(KERN_ERR, ha, "No memory for username & secret\n"); in qla4xxx_get_uni_chap_at_index()
1710 if (is_qla80XX(ha)) in qla4xxx_get_uni_chap_at_index()
1711 max_chap_entries = (ha->hw.flt_chap_size / 2) / in qla4xxx_get_uni_chap_at_index()
1717 ql4_printk(KERN_ERR, ha, "Invalid Chap index\n"); in qla4xxx_get_uni_chap_at_index()
1722 mutex_lock(&ha->chap_sem); in qla4xxx_get_uni_chap_at_index()
1723 chap_table = (struct ql4_chap_table *)ha->chap_list + chap_index; in qla4xxx_get_uni_chap_at_index()
1730 ql4_printk(KERN_ERR, ha, "Unidirectional entry not set\n"); in qla4xxx_get_uni_chap_at_index()
1741 mutex_unlock(&ha->chap_sem); in qla4xxx_get_uni_chap_at_index()
1758 int qla4xxx_get_chap_index(struct scsi_qla_host *ha, char *username, in qla4xxx_get_chap_index() argument
1767 if (is_qla80XX(ha)) in qla4xxx_get_chap_index()
1768 max_chap_entries = (ha->hw.flt_chap_size / 2) / in qla4xxx_get_chap_index()
1773 if (!ha->chap_list) { in qla4xxx_get_chap_index()
1774 ql4_printk(KERN_ERR, ha, "Do not have CHAP table cache\n"); in qla4xxx_get_chap_index()
1779 ql4_printk(KERN_ERR, ha, "Do not have username and psw\n"); in qla4xxx_get_chap_index()
1783 mutex_lock(&ha->chap_sem); in qla4xxx_get_chap_index()
1785 chap_table = (struct ql4_chap_table *)ha->chap_list + i; in qla4xxx_get_chap_index()
1813 rval = qla4xxx_set_chap(ha, username, password, in qla4xxx_get_chap_index()
1821 mutex_unlock(&ha->chap_sem); in qla4xxx_get_chap_index()
1828 int qla4xxx_conn_close_sess_logout(struct scsi_qla_host *ha, in qla4xxx_conn_close_sess_logout() argument
1845 status = qla4xxx_mailbox_command(ha, 4, 2, &mbox_cmd[0], &mbox_sts[0]); in qla4xxx_conn_close_sess_logout()
1847 DEBUG2(ql4_printk(KERN_WARNING, ha, "%s: MBOX_CMD_CONN_CLOSE " in qla4xxx_conn_close_sess_logout()
1861 static int qla4_84xx_extend_idc_tmo(struct scsi_qla_host *ha, uint32_t ext_tmo) in qla4_84xx_extend_idc_tmo() argument
1872 mbox_cmd[1] = ((ha->idc_info.request_desc & 0xfffff0ff) | in qla4_84xx_extend_idc_tmo()
1874 mbox_cmd[2] = ha->idc_info.info1; in qla4_84xx_extend_idc_tmo()
1875 mbox_cmd[3] = ha->idc_info.info2; in qla4_84xx_extend_idc_tmo()
1876 mbox_cmd[4] = ha->idc_info.info3; in qla4_84xx_extend_idc_tmo()
1878 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, MBOX_REG_COUNT, in qla4_84xx_extend_idc_tmo()
1881 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_84xx_extend_idc_tmo()
1883 ha->host_no, __func__, mbox_sts[0])); in qla4_84xx_extend_idc_tmo()
1886 ql4_printk(KERN_INFO, ha, "%s: IDC timeout extended by %d secs\n", in qla4_84xx_extend_idc_tmo()
1893 int qla4xxx_disable_acb(struct scsi_qla_host *ha) in qla4xxx_disable_acb() argument
1904 status = qla4xxx_mailbox_command(ha, 8, 5, &mbox_cmd[0], &mbox_sts[0]); in qla4xxx_disable_acb()
1906 DEBUG2(ql4_printk(KERN_WARNING, ha, "%s: MBOX_CMD_DISABLE_ACB " in qla4xxx_disable_acb()
1910 if (is_qla8042(ha) && in qla4xxx_disable_acb()
1911 test_bit(DPC_POST_IDC_ACK, &ha->dpc_flags) && in qla4xxx_disable_acb()
1920 qla4_84xx_extend_idc_tmo(ha, IDC_EXTEND_TOV); in qla4xxx_disable_acb()
1921 if (!wait_for_completion_timeout(&ha->disable_acb_comp, in qla4xxx_disable_acb()
1923 ql4_printk(KERN_WARNING, ha, "%s: Disable ACB Completion not received\n", in qla4xxx_disable_acb()
1931 int qla4xxx_get_acb(struct scsi_qla_host *ha, dma_addr_t acb_dma, in qla4xxx_get_acb() argument
1947 status = qla4xxx_mailbox_command(ha, 5, 5, &mbox_cmd[0], &mbox_sts[0]); in qla4xxx_get_acb()
1949 DEBUG2(ql4_printk(KERN_WARNING, ha, "%s: MBOX_CMD_GET_ACB " in qla4xxx_get_acb()
1956 int qla4xxx_set_acb(struct scsi_qla_host *ha, uint32_t *mbox_cmd, in qla4xxx_set_acb() argument
1969 status = qla4xxx_mailbox_command(ha, 5, 5, &mbox_cmd[0], &mbox_sts[0]); in qla4xxx_set_acb()
1971 DEBUG2(ql4_printk(KERN_WARNING, ha, "%s: MBOX_CMD_SET_ACB " in qla4xxx_set_acb()
1978 int qla4xxx_set_param_ddbentry(struct scsi_qla_host *ha, in qla4xxx_set_param_ddbentry() argument
1998 fw_ddb_entry = dma_alloc_coherent(&ha->pdev->dev, sizeof(*fw_ddb_entry), in qla4xxx_set_param_ddbentry()
2001 DEBUG2(ql4_printk(KERN_ERR, ha, in qla4xxx_set_param_ddbentry()
2016 status = qla4xxx_get_default_ddb(ha, options, fw_ddb_entry_dma); in qla4xxx_set_param_ddbentry()
2025 DEBUG2(ql4_printk(KERN_INFO, ha, "ISID [%pmR]\n", fw_ddb_entry->isid)); in qla4xxx_set_param_ddbentry()
2048 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4xxx_set_param_ddbentry()
2058 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4xxx_set_param_ddbentry()
2063 ql4_printk(KERN_ERR, ha, in qla4xxx_set_param_ddbentry()
2075 rval = qla4xxx_get_chap_index(ha, sess->username, in qla4xxx_set_param_ddbentry()
2090 rval = qla4xxx_get_chap_index(ha, sess->username_in, in qla4xxx_set_param_ddbentry()
2129 status = qla4xxx_set_ddb_entry(ha, ddb_entry->fw_ddb_index, in qla4xxx_set_param_ddbentry()
2135 dma_free_coherent(&ha->pdev->dev, sizeof(*fw_ddb_entry), in qla4xxx_set_param_ddbentry()
2141 int qla4xxx_get_mgmt_data(struct scsi_qla_host *ha, uint16_t fw_ddb_index, in qla4xxx_get_mgmt_data() argument
2156 status = qla4xxx_mailbox_command(ha, 5, 1, &mbox_cmd[0], &mbox_sts[0]); in qla4xxx_get_mgmt_data()
2158 DEBUG2(ql4_printk(KERN_WARNING, ha, in qla4xxx_get_mgmt_data()
2166 int qla4xxx_get_ip_state(struct scsi_qla_host *ha, uint32_t acb_idx, in qla4xxx_get_ip_state() argument
2179 status = qla4xxx_mailbox_command(ha, 3, 8, &mbox_cmd[0], &mbox_sts[0]); in qla4xxx_get_ip_state()
2181 DEBUG2(ql4_printk(KERN_WARNING, ha, "%s: " in qla4xxx_get_ip_state()
2189 int qla4xxx_get_nvram(struct scsi_qla_host *ha, dma_addr_t nvram_dma, in qla4xxx_get_nvram() argument
2205 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], in qla4xxx_get_nvram()
2208 DEBUG2(ql4_printk(KERN_ERR, ha, "scsi%ld: %s: failed " in qla4xxx_get_nvram()
2209 "status %04X\n", ha->host_no, __func__, in qla4xxx_get_nvram()
2215 int qla4xxx_set_nvram(struct scsi_qla_host *ha, dma_addr_t nvram_dma, in qla4xxx_set_nvram() argument
2231 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], in qla4xxx_set_nvram()
2234 DEBUG2(ql4_printk(KERN_ERR, ha, "scsi%ld: %s: failed " in qla4xxx_set_nvram()
2235 "status %04X\n", ha->host_no, __func__, in qla4xxx_set_nvram()
2241 int qla4xxx_restore_factory_defaults(struct scsi_qla_host *ha, in qla4xxx_restore_factory_defaults() argument
2257 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 3, &mbox_cmd[0], in qla4xxx_restore_factory_defaults()
2260 DEBUG2(ql4_printk(KERN_ERR, ha, "scsi%ld: %s: failed " in qla4xxx_restore_factory_defaults()
2261 "status %04X\n", ha->host_no, __func__, in qla4xxx_restore_factory_defaults()
2272 int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param) in qla4_8xxx_set_param() argument
2287 ql4_printk(KERN_ERR, ha, "%s: invalid parameter 0x%x\n", in qla4_8xxx_set_param()
2293 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 2, mbox_cmd, in qla4_8xxx_set_param()
2296 ql4_printk(KERN_ERR, ha, "%s: failed status %04X\n", in qla4_8xxx_set_param()
2309 int qla4_83xx_post_idc_ack(struct scsi_qla_host *ha) in qla4_83xx_post_idc_ack() argument
2319 mbox_cmd[1] = ha->idc_info.request_desc; in qla4_83xx_post_idc_ack()
2320 mbox_cmd[2] = ha->idc_info.info1; in qla4_83xx_post_idc_ack()
2321 mbox_cmd[3] = ha->idc_info.info2; in qla4_83xx_post_idc_ack()
2322 mbox_cmd[4] = ha->idc_info.info3; in qla4_83xx_post_idc_ack()
2324 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, MBOX_REG_COUNT, in qla4_83xx_post_idc_ack()
2327 ql4_printk(KERN_ERR, ha, "%s: failed status %04X\n", __func__, in qla4_83xx_post_idc_ack()
2330 ql4_printk(KERN_INFO, ha, "%s: IDC ACK posted\n", __func__); in qla4_83xx_post_idc_ack()
2335 int qla4_84xx_config_acb(struct scsi_qla_host *ha, int acb_config) in qla4_84xx_config_acb() argument
2344 acb = dma_alloc_coherent(&ha->pdev->dev, in qla4_84xx_config_acb()
2348 ql4_printk(KERN_ERR, ha, "%s: Unable to alloc acb\n", __func__); in qla4_84xx_config_acb()
2356 rval = qla4xxx_get_acb(ha, acb_dma, 0, acb_len); in qla4_84xx_config_acb()
2360 rval = qla4xxx_disable_acb(ha); in qla4_84xx_config_acb()
2364 if (!ha->saved_acb) in qla4_84xx_config_acb()
2365 ha->saved_acb = kzalloc(acb_len, GFP_KERNEL); in qla4_84xx_config_acb()
2367 if (!ha->saved_acb) { in qla4_84xx_config_acb()
2368 ql4_printk(KERN_ERR, ha, "%s: Unable to alloc acb\n", in qla4_84xx_config_acb()
2373 memcpy(ha->saved_acb, acb, acb_len); in qla4_84xx_config_acb()
2377 if (!ha->saved_acb) { in qla4_84xx_config_acb()
2378 ql4_printk(KERN_ERR, ha, "%s: Can't set ACB, Saved ACB not available\n", in qla4_84xx_config_acb()
2384 memcpy(acb, ha->saved_acb, acb_len); in qla4_84xx_config_acb()
2386 rval = qla4xxx_set_acb(ha, &mbox_cmd[0], &mbox_sts[0], acb_dma); in qla4_84xx_config_acb()
2392 ql4_printk(KERN_ERR, ha, "%s: Invalid ACB Configuration\n", in qla4_84xx_config_acb()
2397 dma_free_coherent(&ha->pdev->dev, sizeof(struct addr_ctrl_blk), acb, in qla4_84xx_config_acb()
2400 if ((acb_config == ACB_CONFIG_SET) && ha->saved_acb) { in qla4_84xx_config_acb()
2401 kfree(ha->saved_acb); in qla4_84xx_config_acb()
2402 ha->saved_acb = NULL; in qla4_84xx_config_acb()
2404 DEBUG2(ql4_printk(KERN_INFO, ha, in qla4_84xx_config_acb()
2410 int qla4_83xx_get_port_config(struct scsi_qla_host *ha, uint32_t *config) in qla4_83xx_get_port_config() argument
2421 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, MBOX_REG_COUNT, in qla4_83xx_get_port_config()
2426 ql4_printk(KERN_ERR, ha, "%s: failed status %04X\n", __func__, in qla4_83xx_get_port_config()
2432 int qla4_83xx_set_port_config(struct scsi_qla_host *ha, uint32_t *config) in qla4_83xx_set_port_config() argument
2444 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, MBOX_REG_COUNT, in qla4_83xx_set_port_config()
2447 ql4_printk(KERN_ERR, ha, "%s: failed status %04X\n", __func__, in qla4_83xx_set_port_config()