Lines Matching +full:firmware +full:- +full:initialized

1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (c) 2003-2013 QLogic Corporation
19 spin_lock_irqsave(&ha->hardware_lock, flags); in ql4xxx_set_mac_number()
20 value = readw(&ha->reg->ctrl_status); in ql4xxx_set_mac_number()
21 spin_unlock_irqrestore(&ha->hardware_lock, flags); in ql4xxx_set_mac_number()
25 ha->mac_index = 1; in ql4xxx_set_mac_number()
28 ha->mac_index = 3; in ql4xxx_set_mac_number()
32 "ispControlStatus = 0x%x\n", ha->host_no, in ql4xxx_set_mac_number()
36 DEBUG2(printk("scsi%ld: %s: mac_index %d.\n", ha->host_no, __func__, in ql4xxx_set_mac_number()
37 ha->mac_index)); in ql4xxx_set_mac_number()
41 * qla4xxx_free_ddb - deallocate ddb
51 ha->fw_ddb_index_map[ddb_entry->fw_ddb_index] = in qla4xxx_free_ddb()
53 ha->tot_ddbs--; in qla4xxx_free_ddb()
57 * qla4xxx_init_response_q_entries() - Initializes response queue entries.
68 pkt = (struct response *)ha->response_ptr; in qla4xxx_init_response_q_entries()
70 pkt->signature = RESPONSE_PROCESSED; in qla4xxx_init_response_q_entries()
76 * qla4xxx_init_rings - initialize hw queues
89 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_init_rings()
90 ha->request_out = 0; in qla4xxx_init_rings()
91 ha->request_in = 0; in qla4xxx_init_rings()
92 ha->request_ptr = &ha->request_ring[ha->request_in]; in qla4xxx_init_rings()
93 ha->req_q_count = REQUEST_QUEUE_DEPTH; in qla4xxx_init_rings()
96 ha->response_in = 0; in qla4xxx_init_rings()
97 ha->response_out = 0; in qla4xxx_init_rings()
98 ha->response_ptr = &ha->response_ring[ha->response_out]; in qla4xxx_init_rings()
102 (unsigned long __iomem *)&ha->qla4_82xx_reg->req_q_out); in qla4xxx_init_rings()
104 (unsigned long __iomem *)&ha->qla4_82xx_reg->rsp_q_in); in qla4xxx_init_rings()
106 (unsigned long __iomem *)&ha->qla4_82xx_reg->rsp_q_out); in qla4xxx_init_rings()
109 (unsigned long __iomem *)&ha->qla4_83xx_reg->req_q_in); in qla4xxx_init_rings()
111 (unsigned long __iomem *)&ha->qla4_83xx_reg->rsp_q_in); in qla4xxx_init_rings()
113 (unsigned long __iomem *)&ha->qla4_83xx_reg->rsp_q_out); in qla4xxx_init_rings()
116 * Initialize DMA Shadow registers. The firmware is really in qla4xxx_init_rings()
118 * systems, the shadow registers aren't cleared-- causing in qla4xxx_init_rings()
122 ha->shadow_regs->req_q_out = cpu_to_le32(0); in qla4xxx_init_rings()
123 ha->shadow_regs->rsp_q_in = cpu_to_le32(0); in qla4xxx_init_rings()
126 writel(0, &ha->reg->req_q_in); in qla4xxx_init_rings()
127 writel(0, &ha->reg->rsp_q_out); in qla4xxx_init_rings()
128 readl(&ha->reg->rsp_q_out); in qla4xxx_init_rings()
135 ha->active_mrb_array[i] = NULL; in qla4xxx_init_rings()
137 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_init_rings()
143 * qla4xxx_get_sys_info - validate adapter MAC address(es)
153 sys_info = dma_alloc_coherent(&ha->pdev->dev, sizeof(*sys_info), in qla4xxx_get_sys_info()
157 ha->host_no, __func__)); in qla4xxx_get_sys_info()
166 "failed\n", ha->host_no, __func__)); in qla4xxx_get_sys_info()
172 memcpy(ha->my_mac, &sys_info->physAddr[0].address[0], in qla4xxx_get_sys_info()
173 min(sizeof(ha->my_mac), in qla4xxx_get_sys_info()
174 sizeof(sys_info->physAddr[0].address))); in qla4xxx_get_sys_info()
175 memcpy(ha->serial_number, &sys_info->acSerialNumber, in qla4xxx_get_sys_info()
176 min(sizeof(ha->serial_number), in qla4xxx_get_sys_info()
177 sizeof(sys_info->acSerialNumber))); in qla4xxx_get_sys_info()
182 dma_free_coherent(&ha->pdev->dev, sizeof(*sys_info), sys_info, in qla4xxx_get_sys_info()
190 * qla4xxx_init_local_data - initialize adapter specific local data
197 ha->aen_q_count = MAX_AEN_ENTRIES; in qla4xxx_init_local_data()
211 if (((ha->addl_fw_state & FW_ADDSTATE_DHCPv4_ENABLED) != 0) && in qla4xxx_wait_for_ip_config()
212 ((ha->addl_fw_state & in qla4xxx_wait_for_ip_config()
216 if (((ha->ip_config.ipv6_addl_options & in qla4xxx_wait_for_ip_config()
218 ((ha->ip_config.ipv6_link_local_state == in qla4xxx_wait_for_ip_config()
220 (ha->ip_config.ipv6_addr0_state == in qla4xxx_wait_for_ip_config()
222 (ha->ip_config.ipv6_addr1_state == in qla4xxx_wait_for_ip_config()
227 if ((ha->ip_config.ipv6_link_local_state == in qla4xxx_wait_for_ip_config()
229 (ha->ip_config.ipv6_addr0_state == in qla4xxx_wait_for_ip_config()
231 (ha->ip_config.ipv6_addr1_state == in qla4xxx_wait_for_ip_config()
235 " Don't wait!\n", ha->host_no, in qla4xxx_wait_for_ip_config()
239 if (memcmp(&ha->ip_config.ipv6_default_router_addr, in qla4xxx_wait_for_ip_config()
243 "Don't wait!\n", ha->host_no, in qla4xxx_wait_for_ip_config()
247 if ((ha->ip_config.ipv6_default_router_state == in qla4xxx_wait_for_ip_config()
249 (ha->ip_config.ipv6_link_local_state == in qla4xxx_wait_for_ip_config()
251 (memcmp(&ha->ip_config.ipv6_link_local_addr, in qla4xxx_wait_for_ip_config()
252 &ha->ip_config.ipv6_default_router_addr, 4) == in qla4xxx_wait_for_ip_config()
256 ha->host_no, __func__)); in qla4xxx_wait_for_ip_config()
262 "IP(s) \"", ha->host_no, __func__)); in qla4xxx_wait_for_ip_config()
265 if (ha->ip_config.ipv6_link_local_state == in qla4xxx_wait_for_ip_config()
268 if (ha->ip_config.ipv6_addr0_state == in qla4xxx_wait_for_ip_config()
271 if (ha->ip_config.ipv6_addr1_state == in qla4xxx_wait_for_ip_config()
301 * qla4xxx_alloc_fw_dump - Allocate memory for minidump data.
314 if (ha->fw_dump) { in qla4xxx_alloc_fw_dump()
316 "Firmware dump previously allocated.\n"); in qla4xxx_alloc_fw_dump()
324 ha->host_no); in qla4xxx_alloc_fw_dump()
328 clear_bit(AF_82XX_FW_DUMPED, &ha->flags); in qla4xxx_alloc_fw_dump()
331 md_tmp = dma_alloc_coherent(&ha->pdev->dev, ha->fw_dump_tmplt_size, in qla4xxx_alloc_fw_dump()
336 ha->host_no); in qla4xxx_alloc_fw_dump()
345 ha->host_no); in qla4xxx_alloc_fw_dump()
353 capture_debug_level = md_hdr->capture_debug_level; in qla4xxx_alloc_fw_dump()
358 ha->fw_dump_capture_mask = ql4xmdcapmask; in qla4xxx_alloc_fw_dump()
362 ha->fw_dump_capture_mask = capture_debug_level; in qla4xxx_alloc_fw_dump()
365 md_hdr->driver_capture_mask = ha->fw_dump_capture_mask; in qla4xxx_alloc_fw_dump()
368 md_hdr->num_of_entries)); in qla4xxx_alloc_fw_dump()
370 ha->fw_dump_tmplt_size)); in qla4xxx_alloc_fw_dump()
372 ha->fw_dump_capture_mask)); in qla4xxx_alloc_fw_dump()
377 if (hdr_entry_bit & ha->fw_dump_capture_mask) in qla4xxx_alloc_fw_dump()
378 ha->fw_dump_size += md_hdr->capture_size_array[k]; in qla4xxx_alloc_fw_dump()
381 /* Total firmware dump size including command header */ in qla4xxx_alloc_fw_dump()
382 ha->fw_dump_size += ha->fw_dump_tmplt_size; in qla4xxx_alloc_fw_dump()
383 ha->fw_dump = vmalloc(ha->fw_dump_size); in qla4xxx_alloc_fw_dump()
384 if (!ha->fw_dump) in qla4xxx_alloc_fw_dump()
389 ha->fw_dump_tmplt_size)); in qla4xxx_alloc_fw_dump()
391 "Total Minidump size = 0x%x KB\n", ha->fw_dump_size)); in qla4xxx_alloc_fw_dump()
393 memcpy(ha->fw_dump, md_tmp, ha->fw_dump_tmplt_size); in qla4xxx_alloc_fw_dump()
394 ha->fw_dump_tmplt_hdr = ha->fw_dump; in qla4xxx_alloc_fw_dump()
397 dma_free_coherent(&ha->pdev->dev, ha->fw_dump_tmplt_size, in qla4xxx_alloc_fw_dump()
406 DEBUG2(ql4_printk(KERN_INFO, ha, "Waiting for Firmware Ready..\n")); in qla4xxx_fw_ready()
408 timeout_count--) { in qla4xxx_fw_ready()
409 if (test_and_clear_bit(DPC_GET_DHCP_IP_ADDR, &ha->dpc_flags)) in qla4xxx_fw_ready()
412 /* Get firmware state. */ in qla4xxx_fw_ready()
414 DEBUG2(printk("scsi%ld: %s: unable to get firmware " in qla4xxx_fw_ready()
415 "state\n", ha->host_no, __func__)); in qla4xxx_fw_ready()
419 if (ha->firmware_state & FW_STATE_ERROR) { in qla4xxx_fw_ready()
421 " occurred\n", ha->host_no, __func__)); in qla4xxx_fw_ready()
425 if (ha->firmware_state & FW_STATE_CONFIG_WAIT) { in qla4xxx_fw_ready()
427 * The firmware has not yet been issued an Initialize in qla4xxx_fw_ready()
428 * Firmware command, so issue it now. in qla4xxx_fw_ready()
433 /* Go back and test for ready state - no wait. */ in qla4xxx_fw_ready()
437 if (ha->firmware_state & FW_STATE_WAIT_AUTOCONNECT) { in qla4xxx_fw_ready()
440 ha->host_no, __func__)); in qla4xxx_fw_ready()
443 if (ha->firmware_state & FW_STATE_CONFIGURING_IP) { in qla4xxx_fw_ready()
446 ha->host_no, __func__)); in qla4xxx_fw_ready()
450 * in Progress/CONFIGURING IP" bit to check if firmware in qla4xxx_fw_ready()
452 * This is applicable for both 2.x & 3.x firmware in qla4xxx_fw_ready()
454 if (timeout_count <= (ADAPTER_INIT_TOV - 15)) { in qla4xxx_fw_ready()
455 if (ha->addl_fw_state & FW_ADDSTATE_LINK_UP) { in qla4xxx_fw_ready()
458 ha->host_no, __func__)); in qla4xxx_fw_ready()
459 } else if (ha->firmware_state & in qla4xxx_fw_ready()
464 ha->host_no, __func__)); in qla4xxx_fw_ready()
465 ha->firmware_state = FW_STATE_READY; in qla4xxx_fw_ready()
470 if (ha->firmware_state == FW_STATE_READY) { in qla4xxx_fw_ready()
473 &ha->dpc_flags)) in qla4xxx_fw_ready()
479 "Firmware Ready..\n")); in qla4xxx_fw_ready()
480 /* The firmware is ready to process SCSI in qla4xxx_fw_ready()
484 " - %s\n", ha->host_no, in qla4xxx_fw_ready()
485 __func__, (ha->addl_fw_state & in qla4xxx_fw_ready()
490 " Enabled %s\n", ha->host_no, in qla4xxx_fw_ready()
491 __func__, (ha->addl_fw_state & in qla4xxx_fw_ready()
496 ha->host_no, __func__, in qla4xxx_fw_ready()
497 (ha->addl_fw_state & in qla4xxx_fw_ready()
503 ha->host_no, __func__, in qla4xxx_fw_ready()
504 (ha->addl_fw_state & in qla4xxx_fw_ready()
512 DEBUG2(printk("scsi%ld: %s: waiting on fw, state=%x:%x - " in qla4xxx_fw_ready()
513 "seconds expired= %d\n", ha->host_no, __func__, in qla4xxx_fw_ready()
514 ha->firmware_state, ha->addl_fw_state, in qla4xxx_fw_ready()
517 !(ha->addl_fw_state & FW_ADDSTATE_LINK_UP) && in qla4xxx_fw_ready()
518 (timeout_count < ADAPTER_INIT_TOV - 5)) { in qla4xxx_fw_ready()
527 ha->host_no, __func__)); in qla4xxx_fw_ready()
529 if (ha->firmware_state & FW_STATE_CONFIGURING_IP) { in qla4xxx_fw_ready()
530 DEBUG2(printk("scsi%ld: %s: FW initialized, but is reporting " in qla4xxx_fw_ready()
532 ha->host_no, __func__)); in qla4xxx_fw_ready()
534 } else if (ha->firmware_state & FW_STATE_WAIT_AUTOCONNECT) { in qla4xxx_fw_ready()
535 DEBUG2(printk("scsi%ld: %s: FW initialized, but " in qla4xxx_fw_ready()
536 "auto-discovery still in process\n", in qla4xxx_fw_ready()
537 ha->host_no, __func__)); in qla4xxx_fw_ready()
545 * qla4xxx_init_firmware - initializes the firmware.
554 test_bit(AF_PCI_CHANNEL_IO_PERM_FAILURE, &ha->flags)) in qla4xxx_init_firmware()
557 /* For 82xx, stop firmware before initializing because if BIOS in qla4xxx_init_firmware()
558 * has previously initialized firmware, then driver's initialize in qla4xxx_init_firmware()
559 * firmware will fail. */ in qla4xxx_init_firmware()
563 ql4_printk(KERN_INFO, ha, "Initializing firmware..\n"); in qla4xxx_init_firmware()
565 DEBUG2(printk("scsi%ld: %s: Failed to initialize firmware " in qla4xxx_init_firmware()
566 "control block\n", ha->host_no, __func__)); in qla4xxx_init_firmware()
573 if (is_qla80XX(ha) && !test_bit(AF_INIT_DONE, &ha->flags)) in qla4xxx_init_firmware()
583 int size = sizeof(ha->nvram->isp4022.boardIdStr); in qla4xxx_set_model_info()
591 memcpy(ha->model_name, board_id_string, size); in qla4xxx_set_model_info()
599 DEBUG2(printk("scsi%ld: %s: Get EEProm parameters \n", ha->host_no, in qla4xxx_config_nvram()
611 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_config_nvram()
614 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_config_nvram()
618 "Please update your EEPROM\n", ha->host_no, in qla4xxx_config_nvram()
633 strcpy(ha->model_name, "QLA4010"); in qla4xxx_config_nvram()
636 ha->host_no, __func__, extHwConfig.Asuint32_t)); in qla4xxx_config_nvram()
638 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_config_nvram()
641 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_config_nvram()
650 * qla4_8xxx_pci_config() - Setup ISP82xx PCI configuration registers.
655 pci_set_master(ha->pdev); in qla4_8xxx_pci_config()
665 pci_set_master(ha->pdev); in qla4xxx_pci_config()
666 status = pci_set_mwi(ha->pdev); in qla4xxx_pci_config()
675 pci_read_config_word(ha->pdev, PCI_COMMAND, &w); in qla4xxx_pci_config()
678 pci_write_config_word(ha->pdev, PCI_COMMAND, w); in qla4xxx_pci_config()
688 ql4_printk(KERN_INFO, ha, "Starting firmware ...\n"); in qla4xxx_start_firmware_from_flash()
691 * Start firmware from flash ROM in qla4xxx_start_firmware_from_flash()
693 * WORKAROUND: Stuff a non-constant value that the firmware can in qla4xxx_start_firmware_from_flash()
697 * causing some connections to not get re-established. in qla4xxx_start_firmware_from_flash()
699 DEBUG(printk("scsi%d: %s: Start firmware from flash ROM\n", in qla4xxx_start_firmware_from_flash()
700 ha->host_no, __func__)); in qla4xxx_start_firmware_from_flash()
702 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_start_firmware_from_flash()
703 writel(jiffies, &ha->reg->mailbox[7]); in qla4xxx_start_firmware_from_flash()
706 &ha->reg->u1.isp4022.nvram); in qla4xxx_start_firmware_from_flash()
708 writel(2, &ha->reg->mailbox[6]); in qla4xxx_start_firmware_from_flash()
709 readl(&ha->reg->mailbox[6]); in qla4xxx_start_firmware_from_flash()
711 writel(set_rmask(CSR_BOOT_ENABLE), &ha->reg->ctrl_status); in qla4xxx_start_firmware_from_flash()
712 readl(&ha->reg->ctrl_status); in qla4xxx_start_firmware_from_flash()
713 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_start_firmware_from_flash()
715 /* Wait for firmware to come UP. */ in qla4xxx_start_firmware_from_flash()
717 "boot firmware to complete...\n", in qla4xxx_start_firmware_from_flash()
718 ha->host_no, __func__, FIRMWARE_UP_TOV)); in qla4xxx_start_firmware_from_flash()
723 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_start_firmware_from_flash()
724 ctrl_status = readw(&ha->reg->ctrl_status); in qla4xxx_start_firmware_from_flash()
725 mbox_status = readw(&ha->reg->mailbox[0]); in qla4xxx_start_firmware_from_flash()
726 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_start_firmware_from_flash()
734 "firmware to complete... ctrl_sts=0x%x, remaining=%ld\n", in qla4xxx_start_firmware_from_flash()
735 ha->host_no, __func__, ctrl_status, max_wait_time)); in qla4xxx_start_firmware_from_flash()
741 DEBUG(printk(KERN_INFO "scsi%ld: %s: Firmware has started\n", in qla4xxx_start_firmware_from_flash()
742 ha->host_no, __func__)); in qla4xxx_start_firmware_from_flash()
744 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_start_firmware_from_flash()
746 &ha->reg->ctrl_status); in qla4xxx_start_firmware_from_flash()
747 readl(&ha->reg->ctrl_status); in qla4xxx_start_firmware_from_flash()
748 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_start_firmware_from_flash()
752 printk(KERN_INFO "scsi%ld: %s: Boot firmware failed " in qla4xxx_start_firmware_from_flash()
753 "- mbox status 0x%x\n", ha->host_no, __func__, in qla4xxx_start_firmware_from_flash()
771 a->host_no, in ql4xxx_lock_drvr_wait()
773 drvr_wait -= QL4_LOCK_DRVR_SLEEP; in ql4xxx_lock_drvr_wait()
776 "acquired\n", a->host_no, __func__)); in ql4xxx_lock_drvr_wait()
784 * qla4xxx_start_firmware - starts qla4xxx firmware
787 * This routine performs the necessary steps to start the firmware for
804 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_start_firmware()
806 DEBUG2(printk("scsi%ld: %s: port_ctrl = 0x%08X\n", ha->host_no, in qla4xxx_start_firmware()
808 DEBUG(printk("scsi%ld: %s: port_status = 0x%08X\n", ha->host_no, in qla4xxx_start_firmware()
811 /* Is Hardware already initialized? */ in qla4xxx_start_firmware()
814 "initialized\n", ha->host_no, __func__)); in qla4xxx_start_firmware()
816 /* Receive firmware boot acknowledgement */ in qla4xxx_start_firmware()
817 mbox_status = readw(&ha->reg->mailbox[0]); in qla4xxx_start_firmware()
819 DEBUG2(printk("scsi%ld: %s: H/W Config complete - mbox[0]= " in qla4xxx_start_firmware()
820 "0x%x\n", ha->host_no, __func__, mbox_status)); in qla4xxx_start_firmware()
822 /* Is firmware already booted? */ in qla4xxx_start_firmware()
829 &ha->reg->ctrl_status); in qla4xxx_start_firmware()
830 readl(&ha->reg->ctrl_status); in qla4xxx_start_firmware()
832 &ha->reg->ctrl_status); in qla4xxx_start_firmware()
833 readl(&ha->reg->ctrl_status); in qla4xxx_start_firmware()
834 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_start_firmware()
836 DEBUG2(printk("scsi%ld: %s: Get firmware " in qla4xxx_start_firmware()
837 "state -- state = 0x%x\n", in qla4xxx_start_firmware()
838 ha->host_no, in qla4xxx_start_firmware()
839 __func__, ha->firmware_state)); in qla4xxx_start_firmware()
841 if (ha->firmware_state & in qla4xxx_start_firmware()
843 DEBUG2(printk("scsi%ld: %s: Firmware " in qla4xxx_start_firmware()
844 "in known state -- " in qla4xxx_start_firmware()
847 ha->host_no, __func__, in qla4xxx_start_firmware()
848 ha->firmware_state)); in qla4xxx_start_firmware()
853 DEBUG2(printk("scsi%ld: %s: Firmware in " in qla4xxx_start_firmware()
854 "unknown state -- resetting," in qla4xxx_start_firmware()
856 "0x%x\n", ha->host_no, __func__, in qla4xxx_start_firmware()
857 ha->firmware_state)); in qla4xxx_start_firmware()
859 spin_lock_irqsave(&ha->hardware_lock, flags); in qla4xxx_start_firmware()
863 "started - resetting\n", ha->host_no, __func__)); in qla4xxx_start_firmware()
865 spin_unlock_irqrestore(&ha->hardware_lock, flags); in qla4xxx_start_firmware()
868 ha->host_no, __func__, soft_reset, config_chip)); in qla4xxx_start_firmware()
870 DEBUG(printk("scsi%ld: %s: Issue Soft Reset\n", ha->host_no, in qla4xxx_start_firmware()
876 ha->host_no, __func__)); in qla4xxx_start_firmware()
894 if (test_and_clear_bit(AF_GET_CRASH_RECORD, &ha->flags)) in qla4xxx_start_firmware()
899 DEBUG(printk("scsi%ld: %s: Firmware has NOT started\n", in qla4xxx_start_firmware()
900 ha->host_no, __func__)); in qla4xxx_start_firmware()
905 * qla4xxx_free_ddb_index - Free DDBs reserved by firmware
908 * Since firmware is not running in autoconnect mode the DDB indices should
946 * qla4xxx_initialize_adapter - initiailizes hba
957 ha->eeprom_cmd_data = 0; in qla4xxx_initialize_adapter()
960 ha->isp_ops->pci_config(ha); in qla4xxx_initialize_adapter()
962 ha->isp_ops->disable_intrs(ha); in qla4xxx_initialize_adapter()
964 /* Initialize the Host adapter request/response queues and firmware */ in qla4xxx_initialize_adapter()
965 if (ha->isp_ops->start_firmware(ha) == QLA_ERROR) in qla4xxx_initialize_adapter()
973 * enabled via isp_ops->enable_intrs. in qla4xxx_initialize_adapter()
981 if (ha->isp_ops->get_sys_info(ha) == QLA_ERROR) in qla4xxx_initialize_adapter()
993 set_bit(AF_ONLINE, &ha->flags); in qla4xxx_initialize_adapter()
996 DEBUG2(printk("scsi%ld: initialize adapter: %s\n", ha->host_no, in qla4xxx_initialize_adapter()
1007 old_fw_ddb_device_state = ddb_entry->fw_ddb_device_state; in qla4xxx_ddb_change()
1009 "%s: DDB - old state = 0x%x, new state = 0x%x for " in qla4xxx_ddb_change()
1011 ddb_entry->fw_ddb_device_state, state, fw_ddb_index)); in qla4xxx_ddb_change()
1013 ddb_entry->fw_ddb_device_state = state; in qla4xxx_ddb_change()
1021 ddb_entry->unblock_sess(ddb_entry->sess); in qla4xxx_ddb_change()
1026 iscsi_conn_login_event(ddb_entry->conn, in qla4xxx_ddb_change()
1041 iscsi_session_failure(ddb_entry->sess->dd_data, in qla4xxx_ddb_change()
1046 clear_bit(fw_ddb_index, ha->ddb_idx_map); in qla4xxx_ddb_change()
1055 ddb_entry->unblock_sess(ddb_entry->sess); in qla4xxx_ddb_change()
1060 iscsi_session_failure(ddb_entry->sess->dd_data, in qla4xxx_ddb_change()
1083 * Firmware pads this timeout: (time2wait +1). in qla4xxx_arm_relogin_timer()
1089 atomic_set(&ddb_entry->relogin_timer, 0); in qla4xxx_arm_relogin_timer()
1090 atomic_set(&ddb_entry->retry_relogin_timer, in qla4xxx_arm_relogin_timer()
1091 ddb_entry->default_time2wait + 4); in qla4xxx_arm_relogin_timer()
1101 old_fw_ddb_device_state = ddb_entry->fw_ddb_device_state; in qla4xxx_flash_ddb_change()
1103 "%s: DDB - old state = 0x%x, new state = 0x%x for " in qla4xxx_flash_ddb_change()
1105 ddb_entry->fw_ddb_device_state, state, fw_ddb_index)); in qla4xxx_flash_ddb_change()
1107 ddb_entry->fw_ddb_device_state = state; in qla4xxx_flash_ddb_change()
1114 ddb_entry->unblock_sess(ddb_entry->sess); in qla4xxx_flash_ddb_change()
1119 iscsi_block_session(ddb_entry->sess); in qla4xxx_flash_ddb_change()
1120 if (!test_bit(DF_RELOGIN, &ddb_entry->flags)) in qla4xxx_flash_ddb_change()
1129 iscsi_block_session(ddb_entry->sess); in qla4xxx_flash_ddb_change()
1130 if (!test_bit(DF_RELOGIN, &ddb_entry->flags)) in qla4xxx_flash_ddb_change()
1139 ddb_entry->unblock_sess(ddb_entry->sess); in qla4xxx_flash_ddb_change()
1144 if (!test_bit(DF_RELOGIN, &ddb_entry->flags)) in qla4xxx_flash_ddb_change()
1159 * qla4xxx_process_ddb_changed - process ddb state change
1161 * @fw_ddb_index: Firmware's device database index
1185 clear_bit(fw_ddb_index, ha->ddb_idx_map); in qla4xxx_process_ddb_changed()
1190 ddb_entry->ddb_change(ha, fw_ddb_index, ddb_entry, state); in qla4xxx_process_ddb_changed()
1197 * qla4xxx_login_flash_ddb - Login to target (DDB)
1213 sess = cls_session->dd_data; in qla4xxx_login_flash_ddb()
1214 ddb_entry = sess->dd_data; in qla4xxx_login_flash_ddb()
1215 ha = ddb_entry->ha; in qla4xxx_login_flash_ddb()
1217 if (!test_bit(AF_LINK_UP, &ha->flags)) in qla4xxx_login_flash_ddb()
1220 if (ddb_entry->ddb_type != FLASH_DDB) { in qla4xxx_login_flash_ddb()
1226 fw_ddb_entry = dma_pool_alloc(ha->fw_ddb_dma_pool, GFP_KERNEL, in qla4xxx_login_flash_ddb()
1233 if (ddb_entry->fw_ddb_index == INVALID_ENTRY) { in qla4xxx_login_flash_ddb()
1234 ret = qla4xxx_get_ddb_index(ha, &ddb_entry->fw_ddb_index); in qla4xxx_login_flash_ddb()
1238 ha->fw_ddb_index_map[ddb_entry->fw_ddb_index] = ddb_entry; in qla4xxx_login_flash_ddb()
1239 ha->tot_ddbs++; in qla4xxx_login_flash_ddb()
1242 memcpy(fw_ddb_entry, &ddb_entry->fw_ddb_entry, in qla4xxx_login_flash_ddb()
1244 ddb_entry->sess->target_id = ddb_entry->fw_ddb_index; in qla4xxx_login_flash_ddb()
1246 ret = qla4xxx_set_ddb_entry(ha, ddb_entry->fw_ddb_index, in qla4xxx_login_flash_ddb()
1253 ddb_entry->fw_ddb_device_state = DDB_DS_LOGIN_IN_PROCESS; in qla4xxx_login_flash_ddb()
1254 ret = qla4xxx_conn_open(ha, ddb_entry->fw_ddb_index); in qla4xxx_login_flash_ddb()
1257 sess->targetname); in qla4xxx_login_flash_ddb()
1263 dma_pool_free(ha->fw_ddb_dma_pool, fw_ddb_entry, fw_ddb_dma); in qla4xxx_login_flash_ddb()