]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/qla2xxx/qla_init.c
[SCSI] qla2xxx: Add port-speed FC transport attribute.
[linux-2.6-omap-h63xx.git] / drivers / scsi / qla2xxx / qla_init.c
index 2d720121a0d36fea181edc21dbc701349dab6731..e67bb099781818339b6a1ef6342694c54825860c 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <linux/delay.h>
 #include <linux/vmalloc.h>
-#include <linux/firmware.h>
 #include <scsi/scsi_transport_fc.h>
 
 #include "qla_devtbl.h"
@@ -33,7 +32,6 @@ static int qla2x00_fw_ready(scsi_qla_host_t *);
 static int qla2x00_configure_hba(scsi_qla_host_t *);
 static int qla2x00_configure_loop(scsi_qla_host_t *);
 static int qla2x00_configure_local_loop(scsi_qla_host_t *);
-static void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *);
 static int qla2x00_configure_fabric(scsi_qla_host_t *);
 static int qla2x00_find_all_fabric_devs(scsi_qla_host_t *, struct list_head *);
 static int qla2x00_device_resync(scsi_qla_host_t *);
@@ -1015,11 +1013,13 @@ qla24xx_update_fw_options(scsi_qla_host_t *ha)
        int rval;
 
        /* Update Serial Link options. */
-       if ((ha->fw_seriallink_options24[0] & BIT_0) == 0)
+       if ((le16_to_cpu(ha->fw_seriallink_options24[0]) & BIT_0) == 0)
                return;
 
-       rval = qla2x00_set_serdes_params(ha, ha->fw_seriallink_options24[1],
-           ha->fw_seriallink_options24[2], ha->fw_seriallink_options24[3]);
+       rval = qla2x00_set_serdes_params(ha,
+           le16_to_cpu(ha->fw_seriallink_options24[1]),
+           le16_to_cpu(ha->fw_seriallink_options24[2]),
+           le16_to_cpu(ha->fw_seriallink_options24[3]));
        if (rval != QLA_SUCCESS) {
                qla_printk(KERN_WARNING, ha,
                    "Unable to update Serial Link options (%x).\n", rval);
@@ -1259,7 +1259,7 @@ qla2x00_configure_hba(scsi_qla_host_t *ha)
        rval = qla2x00_get_adapter_id(ha,
            &loop_id, &al_pa, &area, &domain, &topo);
        if (rval != QLA_SUCCESS) {
-               if (LOOP_NOT_READY(ha) || atomic_read(&ha->loop_down_timer) ||
+               if (LOOP_TRANSITION(ha) || atomic_read(&ha->loop_down_timer) ||
                    (rval == QLA_COMMAND_ERROR && loop_id == 0x7)) {
                        DEBUG2(printk("%s(%ld) Loop is in a transition state\n",
                            __func__, ha->host_no));
@@ -1687,10 +1687,16 @@ static void
 qla2x00_rport_del(void *data)
 {
        fc_port_t *fcport = data;
+       struct fc_rport *rport;
+       unsigned long flags;
+
+       spin_lock_irqsave(&fcport->rport_lock, flags);
+       rport = fcport->drport;
+       fcport->drport = NULL;
+       spin_unlock_irqrestore(&fcport->rport_lock, flags);
+       if (rport)
+               fc_remote_port_delete(rport);
 
-       if (fcport->rport)
-               fc_remote_port_delete(fcport->rport);
-       fcport->rport = NULL;
 }
 
 /**
@@ -1718,6 +1724,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags)
        atomic_set(&fcport->state, FCS_UNCONFIGURED);
        fcport->flags = FCF_RLC_SUPPORT;
        fcport->supported_classes = FC_COS_UNSPECIFIED;
+       spin_lock_init(&fcport->rport_lock);
        INIT_WORK(&fcport->rport_add_work, qla2x00_rport_add, fcport);
        INIT_WORK(&fcport->rport_del_work, qla2x00_rport_del, fcport);
 
@@ -1796,7 +1803,7 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
        }
 
        if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) {
-               if (LOOP_NOT_READY(ha)) {
+               if (LOOP_TRANSITION(ha)) {
                        rval = QLA_FUNCTION_FAILED;
                } else {
                        rval = qla2x00_configure_fabric(ha);
@@ -1940,6 +1947,9 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha)
                            "information -- get_port_database=%x, "
                            "loop_id=0x%04x\n",
                            ha->host_no, rval2, new_fcport->loop_id));
+                       DEBUG2(printk("scsi(%ld): Scheduling resync...\n",
+                           ha->host_no));
+                       set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
                        continue;
                }
 
@@ -2004,7 +2014,7 @@ qla2x00_probe_for_all_luns(scsi_qla_host_t *ha)
 {
        fc_port_t       *fcport;
 
-       qla2x00_mark_all_devices_lost(ha);
+       qla2x00_mark_all_devices_lost(ha, 0);
        list_for_each_entry(fcport, &ha->fcports, list) {
                if (fcport->port_type != FCT_TARGET)
                        continue;
@@ -2028,13 +2038,9 @@ qla2x00_probe_for_all_luns(scsi_qla_host_t *ha)
  * Context:
  *     Kernel context.
  */
-static void
+void
 qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
 {
-       uint16_t        index;
-       unsigned long flags;
-       srb_t *sp;
-
        fcport->ha = ha;
        fcport->login_retry = 0;
        fcport->port_login_retry_count = ha->port_down_retry_count *
@@ -2043,28 +2049,6 @@ qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
            PORT_RETRY_TIME);
        fcport->flags &= ~FCF_LOGIN_NEEDED;
 
-       /*
-        * Check for outstanding cmd on tape Bypass LUN discovery if active
-        * command on tape.
-        */
-       if (fcport->flags & FCF_TAPE_PRESENT) {
-               spin_lock_irqsave(&ha->hardware_lock, flags);
-               for (index = 1; index < MAX_OUTSTANDING_COMMANDS; index++) {
-                       fc_port_t *sfcp;
-
-                       if ((sp = ha->outstanding_cmds[index]) != 0) {
-                               sfcp = sp->fcport;
-                               if (sfcp == fcport) {
-                                       atomic_set(&fcport->state, FCS_ONLINE);
-                                       spin_unlock_irqrestore(
-                                           &ha->hardware_lock, flags);
-                                       return;
-                               }
-                       }
-               }
-               spin_unlock_irqrestore(&ha->hardware_lock, flags);
-       }
-
        if (fcport->port_type == FCT_INITIATOR ||
            fcport->port_type == FCT_BROADCAST)
                fcport->device_type = TYPE_PROCESSOR;
@@ -2080,24 +2064,29 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport)
 {
        struct fc_rport_identifiers rport_ids;
        struct fc_rport *rport;
+       unsigned long flags;
 
-       if (fcport->rport) {
-               fc_remote_port_delete(fcport->rport);
-               fcport->rport = NULL;
-       }
+       if (fcport->drport)
+               qla2x00_rport_del(fcport);
+       if (fcport->rport)
+               return;
 
        rport_ids.node_name = wwn_to_u64(fcport->node_name);
        rport_ids.port_name = wwn_to_u64(fcport->port_name);
        rport_ids.port_id = fcport->d_id.b.domain << 16 |
            fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa;
        rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
-       fcport->rport = rport = fc_remote_port_add(ha->host, 0, &rport_ids);
+       rport = fc_remote_port_add(ha->host, 0, &rport_ids);
        if (!rport) {
                qla_printk(KERN_WARNING, ha,
                    "Unable to allocate fc remote port!\n");
                return;
        }
+       spin_lock_irqsave(&fcport->rport_lock, flags);
+       fcport->rport = rport;
        *((fc_port_t **)rport->dd_data) = fcport;
+       spin_unlock_irqrestore(&fcport->rport_lock, flags);
+
        rport->supported_classes = fcport->supported_classes;
 
        rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
@@ -2213,12 +2202,11 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha)
 
                        if (atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
                                qla2x00_mark_device_lost(ha, fcport,
-                                   ql2xplogiabsentdevice);
+                                   ql2xplogiabsentdevice, 0);
                                if (fcport->loop_id != FC_NO_LOOP_ID &&
                                    (fcport->flags & FCF_TAPE_PRESENT) == 0 &&
                                    fcport->port_type != FCT_INITIATOR &&
                                    fcport->port_type != FCT_BROADCAST) {
-
                                        ha->isp_ops.fabric_logout(ha,
                                            fcport->loop_id,
                                            fcport->d_id.b.domain,
@@ -2369,7 +2357,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
                if (qla2x00_is_reserved_id(ha, loop_id))
                        continue;
 
-               if (atomic_read(&ha->loop_down_timer) || LOOP_NOT_READY(ha))
+               if (atomic_read(&ha->loop_down_timer) || LOOP_TRANSITION(ha))
                        break;
 
                if (swl != NULL) {
@@ -2649,7 +2637,8 @@ qla2x00_device_resync(scsi_qla_host_t *ha)
 
                switch (format) {
                case 0:
-                       if (!IS_QLA2100(ha) && !IS_QLA2200(ha) &&
+                       if (ql2xprocessrscn &&
+                           !IS_QLA2100(ha) && !IS_QLA2200(ha) &&
                            !IS_QLA6312(ha) && !IS_QLA6322(ha) &&
                            !IS_QLA24XX(ha) && !IS_QLA25XX(ha) &&
                            ha->flags.init_done) {
@@ -2689,7 +2678,8 @@ qla2x00_device_resync(scsi_qla_host_t *ha)
                        if (atomic_read(&fcport->state) == FCS_ONLINE) {
                                if (format != 3 ||
                                    fcport->port_type != FCT_INITIATOR) {
-                                       qla2x00_mark_device_lost(ha, fcport, 0);
+                                       qla2x00_mark_device_lost(ha, fcport,
+                                           0, 0);
                                }
                        }
                        fcport->flags &= ~FCF_FARP_DONE;
@@ -2736,8 +2726,7 @@ qla2x00_fabric_dev_login(scsi_qla_host_t *ha, fc_port_t *fcport,
                        ha->isp_ops.fabric_logout(ha, fcport->loop_id,
                            fcport->d_id.b.domain, fcport->d_id.b.area,
                            fcport->d_id.b.al_pa);
-                       qla2x00_mark_device_lost(ha, fcport, 1);
-
+                       qla2x00_mark_device_lost(ha, fcport, 1, 0);
                } else {
                        qla2x00_update_fcport(ha, fcport);
                }
@@ -2850,7 +2839,7 @@ qla2x00_fabric_login(scsi_qla_host_t *ha, fc_port_t *fcport,
                        ha->isp_ops.fabric_logout(ha, fcport->loop_id,
                            fcport->d_id.b.domain, fcport->d_id.b.area,
                            fcport->d_id.b.al_pa);
-                       qla2x00_mark_device_lost(ha, fcport, 1);
+                       qla2x00_mark_device_lost(ha, fcport, 1, 0);
 
                        rval = 1;
                        break;
@@ -2985,6 +2974,17 @@ qla2x00_rescan_fcports(scsi_qla_host_t *ha)
        qla2x00_probe_for_all_luns(ha);
 }
 
+void
+qla2x00_update_fcports(scsi_qla_host_t *ha)
+{
+       fc_port_t *fcport;
+
+       /* Go with deferred removal of rport references. */
+       list_for_each_entry(fcport, &ha->fcports, list)
+               if (fcport->drport)
+                       qla2x00_rport_del(fcport);
+}
+
 /*
 *  qla2x00_abort_isp
 *      Resets ISP and aborts all outstanding commands.
@@ -3014,7 +3014,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
                atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
                if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
                        atomic_set(&ha->loop_state, LOOP_DOWN);
-                       qla2x00_mark_all_devices_lost(ha);
+                       qla2x00_mark_all_devices_lost(ha, 0);
                } else {
                        if (!atomic_read(&ha->loop_down_timer))
                                atomic_set(&ha->loop_down_timer,
@@ -3403,6 +3403,8 @@ qla24xx_nvram_config(scsi_qla_host_t *ha)
        ha->node_name = icb->node_name;
        ha->port_name = icb->port_name;
 
+       icb->execution_throttle = __constant_cpu_to_le16(0xFFFF);
+
        ha->retry_count = le16_to_cpu(nv->login_retry_count);
 
        /* Set minimum login_timeout to 4 seconds. */
@@ -3484,17 +3486,16 @@ qla24xx_nvram_config(scsi_qla_host_t *ha)
        return (rval);
 }
 
+#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
+
 int
 qla2x00_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr)
 {
-       int             rval;
-       uint16_t        cnt;
-       uint16_t        *risc_code;
-       unsigned long   risc_address;
-       unsigned long   risc_code_size;
-       int             num;
-       int             i;
-       uint16_t        *req_ring;
+       int     rval, num, i;
+       uint32_t cnt;
+       uint16_t *risc_code;
+       uint32_t risc_addr, risc_size;
+       uint16_t *req_ring;
        struct qla_fw_info *fw_iter;
 
        rval = QLA_SUCCESS;
@@ -3504,37 +3505,29 @@ qla2x00_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr)
        *srisc_addr = *ha->brd_info->fw_info->fwstart;
        while (fw_iter->addressing != FW_INFO_ADDR_NOMORE) {
                risc_code = fw_iter->fwcode;
-               risc_code_size = *fw_iter->fwlen;
-
-               if (fw_iter->addressing == FW_INFO_ADDR_NORMAL) {
-                       risc_address = *fw_iter->fwstart;
-               } else {
-                       /* Extended address */
-                       risc_address = *fw_iter->lfwstart;
-               }
+               risc_size = *fw_iter->fwlen;
+               if (fw_iter->addressing == FW_INFO_ADDR_NORMAL)
+                       risc_addr = *fw_iter->fwstart;
+               else
+                       risc_addr = *fw_iter->lfwstart;
 
                num = 0;
                rval = 0;
-               while (risc_code_size > 0 && !rval) {
+               while (risc_size > 0 && !rval) {
                        cnt = (uint16_t)(ha->fw_transfer_size >> 1);
-                       if (cnt > risc_code_size)
-                               cnt = risc_code_size;
+                       if (cnt > risc_size)
+                               cnt = risc_size;
 
                        DEBUG7(printk("scsi(%ld): Loading risc segment@ "
                            "addr %p, number of bytes 0x%x, offset 0x%lx.\n",
-                           ha->host_no, risc_code, cnt, risc_address));
+                           ha->host_no, risc_code, cnt, risc_addr));
 
                        req_ring = (uint16_t *)ha->request_ring;
                        for (i = 0; i < cnt; i++)
                                req_ring[i] = cpu_to_le16(risc_code[i]);
 
-                       if (fw_iter->addressing == FW_INFO_ADDR_NORMAL) {
-                               rval = qla2x00_load_ram(ha, ha->request_dma,
-                                   risc_address, cnt);
-                       } else {
-                               rval = qla2x00_load_ram_ext(ha,
-                                   ha->request_dma, risc_address, cnt);
-                       }
+                       rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr,
+                           cnt);
                        if (rval) {
                                DEBUG(printk("scsi(%ld): [ERROR] Failed to "
                                    "load segment %d of firmware\n",
@@ -3548,16 +3541,76 @@ qla2x00_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr)
                        }
 
                        risc_code += cnt;
-                       risc_address += cnt;
-                       risc_code_size -= cnt;
+                       risc_addr += cnt;
+                       risc_size -= cnt;
                        num++;
                }
 
                /* Next firmware sequence */
                fw_iter++;
        }
+       return rval;
+}
 
-       return (rval);
+int
+qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr)
+{
+       int     rval, num, i;
+       uint32_t cnt;
+       uint32_t *risc_code;
+       uint32_t risc_addr, risc_size;
+       uint32_t *req_ring;
+       struct qla_fw_info *fw_iter;
+
+       rval = QLA_SUCCESS;
+
+       /* Load firmware sequences */
+       fw_iter = ha->brd_info->fw_info;
+       *srisc_addr = *((uint32_t *)fw_iter->lfwstart);
+       while (fw_iter->addressing != FW_INFO_ADDR_NOMORE) {
+               risc_code = (uint32_t *)fw_iter->fwcode;
+               risc_size = *((uint32_t *)fw_iter->fwlen);
+               risc_addr = *((uint32_t *)fw_iter->lfwstart);
+
+               num = 0;
+               rval = 0;
+               while (risc_size > 0 && !rval) {
+                       cnt = (uint32_t)(ha->fw_transfer_size >> 2);
+                       if (cnt > risc_size)
+                               cnt = risc_size;
+
+                       DEBUG7(printk("scsi(%ld): Loading risc segment@ "
+                           "addr %p, number of bytes 0x%x, offset 0x%lx.\n",
+                           ha->host_no, risc_code, cnt, risc_addr));
+
+                       req_ring = (uint32_t *)ha->request_ring;
+                       for (i = 0; i < cnt; i++)
+                               req_ring[i] = cpu_to_le32(risc_code[i]);
+
+                       rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr,
+                           cnt);
+                       if (rval) {
+                               DEBUG(printk("scsi(%ld): [ERROR] Failed to "
+                                   "load segment %d of firmware\n",
+                                   ha->host_no, num));
+                               qla_printk(KERN_WARNING, ha,
+                                   "[ERROR] Failed to load segment %d of "
+                                   "firmware\n", num);
+
+                               qla2x00_dump_regs(ha);
+                               break;
+                       }
+
+                       risc_code += cnt;
+                       risc_addr += cnt;
+                       risc_size -= cnt;
+                       num++;
+               }
+
+               /* Next firmware sequence */
+               fw_iter++;
+       }
+       return rval;
 }
 
 int
@@ -3617,8 +3670,8 @@ qla24xx_load_risc_flash(scsi_qla_host_t *ha, uint32_t *srisc_addr)
                        for (i = 0; i < dlen; i++)
                                dcode[i] = swab32(dcode[i]);
 
-                       rval = qla2x00_load_ram_ext(ha, ha->request_dma,
-                           risc_addr, dlen);
+                       rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr,
+                           dlen);
                        if (rval) {
                                DEBUG(printk("scsi(%ld):[ERROR] Failed to load "
                                    "segment %d of firmware\n", ha->host_no,
@@ -3642,8 +3695,108 @@ qla24xx_load_risc_flash(scsi_qla_host_t *ha, uint32_t *srisc_addr)
        return rval;
 }
 
+#else  /* !defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) */
+
 int
-qla24xx_load_risc_hotplug(scsi_qla_host_t *ha, uint32_t *srisc_addr)
+qla2x00_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr)
+{
+       int     rval;
+       int     i, fragment;
+       uint16_t *wcode, *fwcode;
+       uint32_t risc_addr, risc_size, fwclen, wlen, *seg;
+       struct fw_blob *blob;
+
+       /* Load firmware blob. */
+       blob = qla2x00_request_firmware(ha);
+       if (!blob) {
+               qla_printk(KERN_ERR, ha, "Firmware image unavailable.\n");
+               return QLA_FUNCTION_FAILED;
+       }
+
+       rval = QLA_SUCCESS;
+
+       wcode = (uint16_t *)ha->request_ring;
+       *srisc_addr = 0;
+       fwcode = (uint16_t *)blob->fw->data;
+       fwclen = 0;
+
+       /* Validate firmware image by checking version. */
+       if (blob->fw->size < 8 * sizeof(uint16_t)) {
+               qla_printk(KERN_WARNING, ha,
+                   "Unable to verify integrity of firmware image (%Zd)!\n",
+                   blob->fw->size);
+               goto fail_fw_integrity;
+       }
+       for (i = 0; i < 4; i++)
+               wcode[i] = be16_to_cpu(fwcode[i + 4]);
+       if ((wcode[0] == 0xffff && wcode[1] == 0xffff && wcode[2] == 0xffff &&
+           wcode[3] == 0xffff) || (wcode[0] == 0 && wcode[1] == 0 &&
+               wcode[2] == 0 && wcode[3] == 0)) {
+               qla_printk(KERN_WARNING, ha,
+                   "Unable to verify integrity of firmware image!\n");
+               qla_printk(KERN_WARNING, ha,
+                   "Firmware data: %04x %04x %04x %04x!\n", wcode[0],
+                   wcode[1], wcode[2], wcode[3]);
+               goto fail_fw_integrity;
+       }
+
+       seg = blob->segs;
+       while (*seg && rval == QLA_SUCCESS) {
+               risc_addr = *seg;
+               *srisc_addr = *srisc_addr == 0 ? *seg : *srisc_addr;
+               risc_size = be16_to_cpu(fwcode[3]);
+
+               /* Validate firmware image size. */
+               fwclen += risc_size * sizeof(uint16_t);
+               if (blob->fw->size < fwclen) {
+                       qla_printk(KERN_WARNING, ha,
+                           "Unable to verify integrity of firmware image "
+                           "(%Zd)!\n", blob->fw->size);
+                       goto fail_fw_integrity;
+               }
+
+               fragment = 0;
+               while (risc_size > 0 && rval == QLA_SUCCESS) {
+                       wlen = (uint16_t)(ha->fw_transfer_size >> 1);
+                       if (wlen > risc_size)
+                               wlen = risc_size;
+
+                       DEBUG7(printk("scsi(%ld): Loading risc segment@ risc "
+                           "addr %x, number of words 0x%x.\n", ha->host_no,
+                           risc_addr, wlen));
+
+                       for (i = 0; i < wlen; i++)
+                               wcode[i] = swab16(fwcode[i]);
+
+                       rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr,
+                           wlen);
+                       if (rval) {
+                               DEBUG(printk("scsi(%ld):[ERROR] Failed to load "
+                                   "segment %d of firmware\n", ha->host_no,
+                                   fragment));
+                               qla_printk(KERN_WARNING, ha,
+                                   "[ERROR] Failed to load segment %d of "
+                                   "firmware\n", fragment);
+                               break;
+                       }
+
+                       fwcode += wlen;
+                       risc_addr += wlen;
+                       risc_size -= wlen;
+                       fragment++;
+               }
+
+               /* Next segment. */
+               seg++;
+       }
+       return rval;
+
+fail_fw_integrity:
+       return QLA_FUNCTION_FAILED;
+}
+
+int
+qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr)
 {
        int     rval;
        int     segments, fragment;
@@ -3651,14 +3804,13 @@ qla24xx_load_risc_hotplug(scsi_qla_host_t *ha, uint32_t *srisc_addr)
        uint32_t risc_addr;
        uint32_t risc_size;
        uint32_t i;
-       const struct firmware *fw_entry;
+       struct fw_blob *blob;
        uint32_t *fwcode, fwclen;
 
-       if (request_firmware(&fw_entry, ha->brd_info->fw_fname,
-           &ha->pdev->dev)) {
-               qla_printk(KERN_ERR, ha,
-                   "Firmware image file not available: '%s'\n",
-                   ha->brd_info->fw_fname);
+       /* Load firmware blob. */
+       blob = qla2x00_request_firmware(ha);
+       if (!blob) {
+               qla_printk(KERN_ERR, ha, "Firmware image unavailable.\n");
                return QLA_FUNCTION_FAILED;
        }
 
@@ -3667,14 +3819,14 @@ qla24xx_load_risc_hotplug(scsi_qla_host_t *ha, uint32_t *srisc_addr)
        segments = FA_RISC_CODE_SEGMENTS;
        dcode = (uint32_t *)ha->request_ring;
        *srisc_addr = 0;
-       fwcode = (uint32_t *)fw_entry->data;
+       fwcode = (uint32_t *)blob->fw->data;
        fwclen = 0;
 
        /* Validate firmware image by checking version. */
-       if (fw_entry->size < 8 * sizeof(uint32_t)) {
+       if (blob->fw->size < 8 * sizeof(uint32_t)) {
                qla_printk(KERN_WARNING, ha,
-                   "Unable to verify integrity of flash firmware image "
-                   "(%Zd)!\n", fw_entry->size);
+                   "Unable to verify integrity of firmware image (%Zd)!\n",
+                   blob->fw->size);
                goto fail_fw_integrity;
        }
        for (i = 0; i < 4; i++)
@@ -3684,7 +3836,7 @@ qla24xx_load_risc_hotplug(scsi_qla_host_t *ha, uint32_t *srisc_addr)
            (dcode[0] == 0 && dcode[1] == 0 && dcode[2] == 0 &&
                dcode[3] == 0)) {
                qla_printk(KERN_WARNING, ha,
-                   "Unable to verify integrity of flash firmware image!\n");
+                   "Unable to verify integrity of firmware image!\n");
                qla_printk(KERN_WARNING, ha,
                    "Firmware data: %08x %08x %08x %08x!\n", dcode[0],
                    dcode[1], dcode[2], dcode[3]);
@@ -3698,10 +3850,11 @@ qla24xx_load_risc_hotplug(scsi_qla_host_t *ha, uint32_t *srisc_addr)
 
                /* Validate firmware image size. */
                fwclen += risc_size * sizeof(uint32_t);
-               if (fw_entry->size < fwclen) {
+               if (blob->fw->size < fwclen) {
                        qla_printk(KERN_WARNING, ha,
-                           "Unable to verify integrity of flash firmware "
-                           "image (%Zd)!\n", fw_entry->size);
+                           "Unable to verify integrity of firmware image "
+                           "(%Zd)!\n", blob->fw->size);
+
                        goto fail_fw_integrity;
                }
 
@@ -3718,8 +3871,8 @@ qla24xx_load_risc_hotplug(scsi_qla_host_t *ha, uint32_t *srisc_addr)
                        for (i = 0; i < dlen; i++)
                                dcode[i] = swab32(fwcode[i]);
 
-                       rval = qla2x00_load_ram_ext(ha, ha->request_dma,
-                           risc_addr, dlen);
+                       rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr,
+                           dlen);
                        if (rval) {
                                DEBUG(printk("scsi(%ld):[ERROR] Failed to load "
                                    "segment %d of firmware\n", ha->host_no,
@@ -3739,13 +3892,9 @@ qla24xx_load_risc_hotplug(scsi_qla_host_t *ha, uint32_t *srisc_addr)
                /* Next segment. */
                segments--;
        }
-
-       release_firmware(fw_entry);
        return rval;
 
 fail_fw_integrity:
-
-       release_firmware(fw_entry);
        return QLA_FUNCTION_FAILED;
-
 }
+#endif