22 value =
readw(&ha->
reg->ctrl_status);
23 spin_unlock_irqrestore(&ha->hardware_lock, flags);
25 func_number = (
uint8_t) ((value >> 4) & 0x30);
35 "ispControlStatus = 0x%x\n", ha->
host_no,
66 static void qla4xxx_init_response_q_entries(
struct scsi_qla_host *ha)
88 unsigned long flags = 0;
103 if (is_qla8022(ha)) {
110 }
else if (is_qla8032(ha)) {
134 qla4xxx_init_response_q_entries(ha);
140 spin_unlock_irqrestore(&ha->hardware_lock, flags);
158 if (sys_info ==
NULL) {
159 DEBUG2(
printk(
"scsi%ld: %s: Unable to allocate dma buffer.\n",
162 goto exit_get_sys_info_no_free;
164 memset(sys_info, 0,
sizeof(*sys_info));
169 DEBUG2(
printk(
"scsi%ld: %s: get_flash FLASH_OFFSET_SYS_INFO "
170 "failed\n", ha->
host_no, __func__));
172 goto exit_get_sys_info;
178 sizeof(sys_info->
physAddr[0].address)));
189 exit_get_sys_info_no_free:
216 if (is_ipv4_enabled(ha) && is_ipv6_enabled(ha)) {
233 if ((ha->
ip_config.ipv6_link_local_state ==
240 "Preferred IP configured."
248 "No Router configured. "
253 if ((ha->
ip_config.ipv6_default_router_state ==
258 &ha->
ip_config.ipv6_default_router_addr, 4) ==
261 "IP configured. Don't wait!\n",
266 if (ipv4_wait || ipv6_wait) {
268 "IP(s) \"", ha->
host_no, __func__));
271 if (ha->
ip_config.ipv6_link_local_state ==
284 return ipv4_wait|ipv6_wait;
295 int hdr_entry_bit,
k;
302 "Firmware dump previously allocated.\n");
309 "scsi%ld: Failed to get template size\n",
324 "scsi%ld: Failed to get minidump template\n",
349 for (hdr_entry_bit = 0x2, k = 1; (hdr_entry_bit & 0xFF);
350 hdr_entry_bit <<= 1, k++) {
362 "Minidump Tempalate Size = 0x%x KB\n",
389 "state\n", ha->
host_no, __func__));
395 " occurred\n", ha->
host_no, __func__));
413 "AUTOCONNECT in progress\n",
431 " LINK UP (Cable plugged)\n",
437 "LINK DOWN (Cable unplugged)\n",
450 if (!qla4xxx_wait_for_ip_config(ha) ||
451 timeout_count == 1) {
453 "Firmware Ready..\n"));
457 "scsi%ld: %s: MEDIA TYPE"
461 != 0 ?
"OPTICAL" :
"COPPER"));
463 "scsi%ld: %s: DHCPv4 STATE"
469 "scsi%ld: %s: LINK %s\n",
475 "scsi%ld: %s: iSNS Service "
486 DEBUG2(
printk(
"scsi%ld: %s: waiting on fw, state=%x:%x - "
487 "seconds expired= %d\n", ha->
host_no, __func__,
490 if (is_qla4032(ha) &&
499 if (timeout_count <= 0)
500 DEBUG2(
printk(
"scsi%ld: %s: FW Initialization timed out!\n",
504 DEBUG2(
printk(
"scsi%ld: %s: FW initialized, but is reporting "
505 "it's waiting to configure an IP address\n",
510 "auto-discovery still in process\n",
527 if (is_aer_supported(ha) &&
539 DEBUG2(
printk(
"scsi%ld: %s: Failed to initialize firmware "
540 "control block\n", ha->
host_no, __func__));
544 if (!qla4xxx_fw_ready(ha))
557 int size =
sizeof(ha->
nvram->isp4022.boardIdStr);
560 for (i = 0; i < (size / 2) ; i++) {
578 ql4xxx_unlock_flash(ha);
586 extHwConfig.Asuint32_t =
588 spin_unlock_irqrestore(&ha->hardware_lock, flags);
591 "scsi%ld: %s: EEProm checksum invalid. "
592 "Please update your EEPROM\n", ha->
host_no,
597 extHwConfig.Asuint32_t = 0x1912;
598 else if (is_qla4022(ha) | is_qla4032(ha))
599 extHwConfig.Asuint32_t = 0x0023;
604 if (is_qla4022(ha) || is_qla4032(ha))
605 qla4xxx_set_model_info(ha);
609 DEBUG(
printk(
"scsi%ld: %s: Setting extHwConfig to 0xFFFF%04x\n",
610 ha->
host_no, __func__, extHwConfig.Asuint32_t));
613 writel((0xFFFF << 16) | extHwConfig.Asuint32_t, isp_ext_hw_conf(ha));
614 readl(isp_ext_hw_conf(ha));
615 spin_unlock_irqrestore(&ha->hardware_lock, flags);
617 ql4xxx_unlock_nvram(ha);
618 ql4xxx_unlock_flash(ha);
652 static int qla4xxx_start_firmware_from_flash(
struct scsi_qla_host *ha)
655 unsigned long max_wait_time;
670 DEBUG(
printk(
"scsi%d: %s: Start firmware from flash ROM\n",
675 if (is_qla4022(ha) | is_qla4032(ha))
677 &ha->
reg->u1.isp4022.nvram);
684 spin_unlock_irqrestore(&ha->hardware_lock, flags);
688 "boot firmware to complete...\n",
695 ctrl_status =
readw(&ha->
reg->ctrl_status);
696 mbox_status =
readw(&ha->
reg->mailbox[0]);
697 spin_unlock_irqrestore(&ha->hardware_lock, flags);
705 "firmware to complete... ctrl_sts=0x%x, remaining=%ld\n",
706 ha->
host_no, __func__, ctrl_status, max_wait_time));
717 &ha->
reg->ctrl_status);
719 spin_unlock_irqrestore(&ha->hardware_lock, flags);
724 "- mbox status 0x%x\n", ha->
host_no, __func__,
733 #define QL4_LOCK_DRVR_WAIT 60
734 #define QL4_LOCK_DRVR_SLEEP 1
738 if (ql4xxx_lock_drvr(a) == 0) {
742 "Global Init Semaphore(%d)...\n",
744 __func__, drvr_wait));
749 "acquired\n", a->
host_no, __func__));
765 unsigned long flags = 0;
771 if (is_qla4022(ha) | is_qla4032(ha))
772 ql4xxx_set_mac_number(ha);
780 __func__,
readw(isp_port_ctrl(ha))));
782 __func__,
readw(isp_port_status(ha))));
785 if ((
readw(isp_port_ctrl(ha)) & 0x8000) != 0) {
786 DEBUG(
printk(
"scsi%ld: %s: Hardware has already been "
787 "initialized\n", ha->
host_no, __func__));
790 mbox_status =
readw(&ha->
reg->mailbox[0]);
792 DEBUG2(
printk(
"scsi%ld: %s: H/W Config complete - mbox[0]= "
793 "0x%x\n", ha->
host_no, __func__, mbox_status));
796 if (mbox_status == 0) {
802 &ha->
reg->ctrl_status);
805 &ha->
reg->ctrl_status);
807 spin_unlock_irqrestore(&ha->hardware_lock, flags);
810 "state -- state = 0x%x\n",
819 "boot, state = 0x%x\n",
827 "unknown state -- resetting,"
829 "0x%x\n", ha->
host_no, __func__,
835 DEBUG(
printk(
"scsi%ld: %s: H/W initialization hasn't been "
836 "started - resetting\n", ha->
host_no, __func__));
838 spin_unlock_irqrestore(&ha->hardware_lock, flags);
840 DEBUG(
printk(
"scsi%ld: %s: Flags soft_rest=%d, config= %d\n ",
841 ha->
host_no, __func__, soft_reset, config_chip));
850 ql4xxx_unlock_drvr(ha);
861 if ((status = qla4xxx_config_nvram(ha)) ==
QLA_SUCCESS)
862 status = qla4xxx_start_firmware_from_flash(ha);
865 ql4xxx_unlock_drvr(ha);
870 DEBUG(
printk(
"scsi%ld: %s: Firmware has NOT started\n",
893 for (idx = 0; idx < max_ddbs; idx = next_idx) {
895 &next_idx, &state, &conn_err,
904 "Freeing DDB index = 0x%x\n", idx));
908 "Unable to clear DDB index = "
932 ha->
isp_ops->disable_intrs(ha);
944 if (qla4xxx_init_local_data(ha) ==
QLA_ERROR)
947 status = qla4xxx_init_firmware(ha);
956 if (is_qla80XX(ha) && (status ==
QLA_ERROR)) {
963 status ==
QLA_ERROR ?
"FAILED" :
"SUCCEEDED"));
975 "%s: DDB - old state = 0x%x, new state = 0x%x for "
976 "index [%d]\n", __func__,
981 switch (old_fw_ddb_device_state) {
1069 "%s: DDB - old state = 0x%x, new state = 0x%x for "
1070 "index [%d]\n", __func__,
1075 switch (old_fw_ddb_device_state) {
1141 goto exit_ddb_event;
1144 ddb_entry = qla4xxx_lookup_ddb_by_fw_index(ha, fw_ddb_index);
1146 if (ddb_entry ==
NULL) {
1148 __func__, fw_ddb_index);
1153 goto exit_ddb_event;
1156 ddb_entry->
ddb_change(ha, fw_ddb_index, ddb_entry, state);
1188 "Skipping login to non FLASH DB"));
1194 if (fw_ddb_entry ==
NULL) {
1213 fw_ddb_dma, &mbx_sts);