aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c168
1 files changed, 41 insertions, 127 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 584fe5d8e507..ccaad0b08d35 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -54,13 +54,6 @@ module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR);
54MODULE_PARM_DESC(ql2xloginretrycount, 54MODULE_PARM_DESC(ql2xloginretrycount,
55 "Specify an alternate value for the NVRAM login retry count."); 55 "Specify an alternate value for the NVRAM login retry count.");
56 56
57#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
58int ql2xfwloadflash;
59module_param(ql2xfwloadflash, int, S_IRUGO|S_IRUSR);
60MODULE_PARM_DESC(ql2xfwloadflash,
61 "Load ISP24xx firmware image from FLASH (onboard memory).");
62#endif
63
64static void qla2x00_free_device(scsi_qla_host_t *); 57static void qla2x00_free_device(scsi_qla_host_t *);
65 58
66static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha); 59static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha);
@@ -71,12 +64,6 @@ MODULE_PARM_DESC(ql2xfdmienable,
71 "Enables FDMI registratons " 64 "Enables FDMI registratons "
72 "Default is 0 - no FDMI. 1 - perfom FDMI."); 65 "Default is 0 - no FDMI. 1 - perfom FDMI.");
73 66
74int ql2xprocessrscn;
75module_param(ql2xprocessrscn, int, S_IRUGO|S_IRUSR);
76MODULE_PARM_DESC(ql2xprocessrscn,
77 "Option to enable port RSCN handling via a series of less"
78 "fabric intrusive ADISCs and PLOGIs.");
79
80/* 67/*
81 * SCSI host template entry points 68 * SCSI host template entry points
82 */ 69 */
@@ -99,7 +86,7 @@ static int qla2x00_change_queue_type(struct scsi_device *, int);
99 86
100static struct scsi_host_template qla2x00_driver_template = { 87static struct scsi_host_template qla2x00_driver_template = {
101 .module = THIS_MODULE, 88 .module = THIS_MODULE,
102 .name = "qla2xxx", 89 .name = QLA2XXX_DRIVER_NAME,
103 .queuecommand = qla2x00_queuecommand, 90 .queuecommand = qla2x00_queuecommand,
104 91
105 .eh_abort_handler = qla2xxx_eh_abort, 92 .eh_abort_handler = qla2xxx_eh_abort,
@@ -128,7 +115,7 @@ static struct scsi_host_template qla2x00_driver_template = {
128 115
129static struct scsi_host_template qla24xx_driver_template = { 116static struct scsi_host_template qla24xx_driver_template = {
130 .module = THIS_MODULE, 117 .module = THIS_MODULE,
131 .name = "qla2xxx", 118 .name = QLA2XXX_DRIVER_NAME,
132 .queuecommand = qla24xx_queuecommand, 119 .queuecommand = qla24xx_queuecommand,
133 120
134 .eh_abort_handler = qla2xxx_eh_abort, 121 .eh_abort_handler = qla2xxx_eh_abort,
@@ -340,7 +327,6 @@ qla2x00_get_new_sp(scsi_qla_host_t *ha, fc_port_t *fcport,
340 if (!sp) 327 if (!sp)
341 return sp; 328 return sp;
342 329
343 atomic_set(&sp->ref_count, 1);
344 sp->ha = ha; 330 sp->ha = ha;
345 sp->fcport = fcport; 331 sp->fcport = fcport;
346 sp->cmd = cmd; 332 sp->cmd = cmd;
@@ -577,6 +563,10 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
577 while ((!atomic_read(&ha->loop_down_timer) && 563 while ((!atomic_read(&ha->loop_down_timer) &&
578 atomic_read(&ha->loop_state) == LOOP_DOWN) || 564 atomic_read(&ha->loop_state) == LOOP_DOWN) ||
579 atomic_read(&ha->loop_state) != LOOP_READY) { 565 atomic_read(&ha->loop_state) != LOOP_READY) {
566 if (atomic_read(&ha->loop_state) == LOOP_DEAD) {
567 return_status = QLA_FUNCTION_FAILED;
568 break;
569 }
580 msleep(1000); 570 msleep(1000);
581 if (time_after_eq(jiffies, loop_timeout)) { 571 if (time_after_eq(jiffies, loop_timeout)) {
582 return_status = QLA_FUNCTION_FAILED; 572 return_status = QLA_FUNCTION_FAILED;
@@ -632,9 +622,8 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
632 if (sp->cmd != cmd) 622 if (sp->cmd != cmd)
633 continue; 623 continue;
634 624
635 DEBUG2(printk("%s(%ld): aborting sp %p from RISC. pid=%ld " 625 DEBUG2(printk("%s(%ld): aborting sp %p from RISC. pid=%ld.\n",
636 "sp->state=%x\n", __func__, ha->host_no, sp, serial, 626 __func__, ha->host_no, sp, serial));
637 sp->state));
638 DEBUG3(qla2x00_print_scsi_cmd(cmd);) 627 DEBUG3(qla2x00_print_scsi_cmd(cmd);)
639 628
640 spin_unlock_irqrestore(&ha->hardware_lock, flags); 629 spin_unlock_irqrestore(&ha->hardware_lock, flags);
@@ -1157,18 +1146,22 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha)
1157 case PCI_DEVICE_ID_QLOGIC_ISP2100: 1146 case PCI_DEVICE_ID_QLOGIC_ISP2100:
1158 ha->device_type |= DT_ISP2100; 1147 ha->device_type |= DT_ISP2100;
1159 ha->device_type &= ~DT_EXTENDED_IDS; 1148 ha->device_type &= ~DT_EXTENDED_IDS;
1149 ha->fw_srisc_address = RISC_START_ADDRESS_2100;
1160 break; 1150 break;
1161 case PCI_DEVICE_ID_QLOGIC_ISP2200: 1151 case PCI_DEVICE_ID_QLOGIC_ISP2200:
1162 ha->device_type |= DT_ISP2200; 1152 ha->device_type |= DT_ISP2200;
1163 ha->device_type &= ~DT_EXTENDED_IDS; 1153 ha->device_type &= ~DT_EXTENDED_IDS;
1154 ha->fw_srisc_address = RISC_START_ADDRESS_2100;
1164 break; 1155 break;
1165 case PCI_DEVICE_ID_QLOGIC_ISP2300: 1156 case PCI_DEVICE_ID_QLOGIC_ISP2300:
1166 ha->device_type |= DT_ISP2300; 1157 ha->device_type |= DT_ISP2300;
1167 ha->device_type |= DT_ZIO_SUPPORTED; 1158 ha->device_type |= DT_ZIO_SUPPORTED;
1159 ha->fw_srisc_address = RISC_START_ADDRESS_2300;
1168 break; 1160 break;
1169 case PCI_DEVICE_ID_QLOGIC_ISP2312: 1161 case PCI_DEVICE_ID_QLOGIC_ISP2312:
1170 ha->device_type |= DT_ISP2312; 1162 ha->device_type |= DT_ISP2312;
1171 ha->device_type |= DT_ZIO_SUPPORTED; 1163 ha->device_type |= DT_ZIO_SUPPORTED;
1164 ha->fw_srisc_address = RISC_START_ADDRESS_2300;
1172 break; 1165 break;
1173 case PCI_DEVICE_ID_QLOGIC_ISP2322: 1166 case PCI_DEVICE_ID_QLOGIC_ISP2322:
1174 ha->device_type |= DT_ISP2322; 1167 ha->device_type |= DT_ISP2322;
@@ -1176,26 +1169,33 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha)
1176 if (ha->pdev->subsystem_vendor == 0x1028 && 1169 if (ha->pdev->subsystem_vendor == 0x1028 &&
1177 ha->pdev->subsystem_device == 0x0170) 1170 ha->pdev->subsystem_device == 0x0170)
1178 ha->device_type |= DT_OEM_001; 1171 ha->device_type |= DT_OEM_001;
1172 ha->fw_srisc_address = RISC_START_ADDRESS_2300;
1179 break; 1173 break;
1180 case PCI_DEVICE_ID_QLOGIC_ISP6312: 1174 case PCI_DEVICE_ID_QLOGIC_ISP6312:
1181 ha->device_type |= DT_ISP6312; 1175 ha->device_type |= DT_ISP6312;
1176 ha->fw_srisc_address = RISC_START_ADDRESS_2300;
1182 break; 1177 break;
1183 case PCI_DEVICE_ID_QLOGIC_ISP6322: 1178 case PCI_DEVICE_ID_QLOGIC_ISP6322:
1184 ha->device_type |= DT_ISP6322; 1179 ha->device_type |= DT_ISP6322;
1180 ha->fw_srisc_address = RISC_START_ADDRESS_2300;
1185 break; 1181 break;
1186 case PCI_DEVICE_ID_QLOGIC_ISP2422: 1182 case PCI_DEVICE_ID_QLOGIC_ISP2422:
1187 ha->device_type |= DT_ISP2422; 1183 ha->device_type |= DT_ISP2422;
1188 ha->device_type |= DT_ZIO_SUPPORTED; 1184 ha->device_type |= DT_ZIO_SUPPORTED;
1185 ha->fw_srisc_address = RISC_START_ADDRESS_2400;
1189 break; 1186 break;
1190 case PCI_DEVICE_ID_QLOGIC_ISP2432: 1187 case PCI_DEVICE_ID_QLOGIC_ISP2432:
1191 ha->device_type |= DT_ISP2432; 1188 ha->device_type |= DT_ISP2432;
1192 ha->device_type |= DT_ZIO_SUPPORTED; 1189 ha->device_type |= DT_ZIO_SUPPORTED;
1190 ha->fw_srisc_address = RISC_START_ADDRESS_2400;
1193 break; 1191 break;
1194 case PCI_DEVICE_ID_QLOGIC_ISP5422: 1192 case PCI_DEVICE_ID_QLOGIC_ISP5422:
1195 ha->device_type |= DT_ISP5422; 1193 ha->device_type |= DT_ISP5422;
1194 ha->fw_srisc_address = RISC_START_ADDRESS_2400;
1196 break; 1195 break;
1197 case PCI_DEVICE_ID_QLOGIC_ISP5432: 1196 case PCI_DEVICE_ID_QLOGIC_ISP5432:
1198 ha->device_type |= DT_ISP5432; 1197 ha->device_type |= DT_ISP5432;
1198 ha->fw_srisc_address = RISC_START_ADDRESS_2400;
1199 break; 1199 break;
1200 } 1200 }
1201} 1201}
@@ -1242,7 +1242,7 @@ qla2x00_iospace_config(scsi_qla_host_t *ha)
1242 goto iospace_error_exit; 1242 goto iospace_error_exit;
1243 } 1243 }
1244 1244
1245 if (pci_request_regions(ha->pdev, ha->brd_info->drv_name)) { 1245 if (pci_request_regions(ha->pdev, QLA2XXX_DRIVER_NAME)) {
1246 qla_printk(KERN_WARNING, ha, 1246 qla_printk(KERN_WARNING, ha,
1247 "Failed to reserve PIO/MMIO regions (%s)\n", 1247 "Failed to reserve PIO/MMIO regions (%s)\n",
1248 pci_name(ha->pdev)); 1248 pci_name(ha->pdev));
@@ -1324,7 +1324,7 @@ qla24xx_disable_intrs(scsi_qla_host_t *ha)
1324/* 1324/*
1325 * PCI driver interface 1325 * PCI driver interface
1326 */ 1326 */
1327int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info) 1327static int qla2x00_probe_one(struct pci_dev *pdev)
1328{ 1328{
1329 int ret = -ENODEV; 1329 int ret = -ENODEV;
1330 device_reg_t __iomem *reg; 1330 device_reg_t __iomem *reg;
@@ -1358,8 +1358,7 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1358 ha->pdev = pdev; 1358 ha->pdev = pdev;
1359 ha->host = host; 1359 ha->host = host;
1360 ha->host_no = host->host_no; 1360 ha->host_no = host->host_no;
1361 ha->brd_info = brd_info; 1361 sprintf(ha->host_str, "%s_%ld", QLA2XXX_DRIVER_NAME, ha->host_no);
1362 sprintf(ha->host_str, "%s_%ld", ha->brd_info->drv_name, ha->host_no);
1363 1362
1364 /* Set ISP-type information. */ 1363 /* Set ISP-type information. */
1365 qla2x00_set_isp_flags(ha); 1364 qla2x00_set_isp_flags(ha);
@@ -1376,7 +1375,6 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1376 spin_lock_init(&ha->hardware_lock); 1375 spin_lock_init(&ha->hardware_lock);
1377 1376
1378 ha->prev_topology = 0; 1377 ha->prev_topology = 0;
1379 ha->ports = MAX_BUSES;
1380 ha->init_cb_size = sizeof(init_cb_t); 1378 ha->init_cb_size = sizeof(init_cb_t);
1381 ha->mgmt_svr_loop_id = MANAGEMENT_SERVER; 1379 ha->mgmt_svr_loop_id = MANAGEMENT_SERVER;
1382 ha->link_data_rate = LDR_UNKNOWN; 1380 ha->link_data_rate = LDR_UNKNOWN;
@@ -1457,10 +1455,6 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1457 ha->isp_ops.nvram_config = qla24xx_nvram_config; 1455 ha->isp_ops.nvram_config = qla24xx_nvram_config;
1458 ha->isp_ops.update_fw_options = qla24xx_update_fw_options; 1456 ha->isp_ops.update_fw_options = qla24xx_update_fw_options;
1459 ha->isp_ops.load_risc = qla24xx_load_risc; 1457 ha->isp_ops.load_risc = qla24xx_load_risc;
1460#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
1461 if (ql2xfwloadflash)
1462 ha->isp_ops.load_risc = qla24xx_load_risc_flash;
1463#endif
1464 ha->isp_ops.pci_info_str = qla24xx_pci_info_str; 1458 ha->isp_ops.pci_info_str = qla24xx_pci_info_str;
1465 ha->isp_ops.fw_version_str = qla24xx_fw_version_str; 1459 ha->isp_ops.fw_version_str = qla24xx_fw_version_str;
1466 ha->isp_ops.intr_handler = qla24xx_intr_handler; 1460 ha->isp_ops.intr_handler = qla24xx_intr_handler;
@@ -1494,7 +1488,6 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1494 1488
1495 INIT_LIST_HEAD(&ha->list); 1489 INIT_LIST_HEAD(&ha->list);
1496 INIT_LIST_HEAD(&ha->fcports); 1490 INIT_LIST_HEAD(&ha->fcports);
1497 INIT_LIST_HEAD(&ha->rscn_fcports);
1498 1491
1499 /* 1492 /*
1500 * These locks are used to prevent more than one CPU 1493 * These locks are used to prevent more than one CPU
@@ -1543,12 +1536,12 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1543 host->cmd_per_lun = 3; 1536 host->cmd_per_lun = 3;
1544 host->unique_id = ha->instance; 1537 host->unique_id = ha->instance;
1545 host->max_cmd_len = MAX_CMDSZ; 1538 host->max_cmd_len = MAX_CMDSZ;
1546 host->max_channel = ha->ports - 1; 1539 host->max_channel = MAX_BUSES - 1;
1547 host->max_lun = MAX_LUNS; 1540 host->max_lun = MAX_LUNS;
1548 host->transportt = qla2xxx_transport_template; 1541 host->transportt = qla2xxx_transport_template;
1549 1542
1550 ret = request_irq(pdev->irq, ha->isp_ops.intr_handler, 1543 ret = request_irq(pdev->irq, ha->isp_ops.intr_handler,
1551 SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha); 1544 SA_INTERRUPT|SA_SHIRQ, QLA2XXX_DRIVER_NAME, ha);
1552 if (ret) { 1545 if (ret) {
1553 qla_printk(KERN_WARNING, ha, 1546 qla_printk(KERN_WARNING, ha,
1554 "Failed to reserve interrupt %d already in use.\n", 1547 "Failed to reserve interrupt %d already in use.\n",
@@ -1646,9 +1639,8 @@ probe_disable_device:
1646probe_out: 1639probe_out:
1647 return ret; 1640 return ret;
1648} 1641}
1649EXPORT_SYMBOL_GPL(qla2x00_probe_one);
1650 1642
1651void qla2x00_remove_one(struct pci_dev *pdev) 1643static void qla2x00_remove_one(struct pci_dev *pdev)
1652{ 1644{
1653 scsi_qla_host_t *ha; 1645 scsi_qla_host_t *ha;
1654 1646
@@ -1666,15 +1658,10 @@ void qla2x00_remove_one(struct pci_dev *pdev)
1666 1658
1667 pci_set_drvdata(pdev, NULL); 1659 pci_set_drvdata(pdev, NULL);
1668} 1660}
1669EXPORT_SYMBOL_GPL(qla2x00_remove_one);
1670 1661
1671static void 1662static void
1672qla2x00_free_device(scsi_qla_host_t *ha) 1663qla2x00_free_device(scsi_qla_host_t *ha)
1673{ 1664{
1674 /* Abort any outstanding IO descriptors. */
1675 if (!IS_QLA2100(ha) && !IS_QLA2200(ha))
1676 qla2x00_cancel_io_descriptors(ha);
1677
1678 /* Disable timer */ 1665 /* Disable timer */
1679 if (ha->timer_active) 1666 if (ha->timer_active)
1680 qla2x00_stop_timer(ha); 1667 qla2x00_stop_timer(ha);
@@ -1884,19 +1871,8 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
1884 continue; 1871 continue;
1885 } 1872 }
1886 1873
1887 ha->rlc_rsp = dma_alloc_coherent(&ha->pdev->dev, 1874 snprintf(name, sizeof(name), "%s_%ld", QLA2XXX_DRIVER_NAME,
1888 sizeof(rpt_lun_cmd_rsp_t), &ha->rlc_rsp_dma, GFP_KERNEL); 1875 ha->host_no);
1889 if (ha->rlc_rsp == NULL) {
1890 qla_printk(KERN_WARNING, ha,
1891 "Memory Allocation failed - rlc");
1892
1893 qla2x00_mem_free(ha);
1894 msleep(100);
1895
1896 continue;
1897 }
1898
1899 snprintf(name, sizeof(name), "qla2xxx_%ld", ha->host_no);
1900 ha->s_dma_pool = dma_pool_create(name, &ha->pdev->dev, 1876 ha->s_dma_pool = dma_pool_create(name, &ha->pdev->dev,
1901 DMA_POOL_SIZE, 8, 0); 1877 DMA_POOL_SIZE, 8, 0);
1902 if (ha->s_dma_pool == NULL) { 1878 if (ha->s_dma_pool == NULL) {
@@ -1923,21 +1899,6 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
1923 } 1899 }
1924 memset(ha->init_cb, 0, ha->init_cb_size); 1900 memset(ha->init_cb, 0, ha->init_cb_size);
1925 1901
1926 /* Get consistent memory allocated for Get Port Database cmd */
1927 ha->iodesc_pd = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL,
1928 &ha->iodesc_pd_dma);
1929 if (ha->iodesc_pd == NULL) {
1930 /* error */
1931 qla_printk(KERN_WARNING, ha,
1932 "Memory Allocation failed - iodesc_pd\n");
1933
1934 qla2x00_mem_free(ha);
1935 msleep(100);
1936
1937 continue;
1938 }
1939 memset(ha->iodesc_pd, 0, PORT_DATABASE_SIZE);
1940
1941 /* Allocate ioctl related memory. */ 1902 /* Allocate ioctl related memory. */
1942 if (qla2x00_alloc_ioctl_mem(ha)) { 1903 if (qla2x00_alloc_ioctl_mem(ha)) {
1943 qla_printk(KERN_WARNING, ha, 1904 qla_printk(KERN_WARNING, ha,
@@ -2062,20 +2023,12 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
2062 if (ha->ms_iocb) 2023 if (ha->ms_iocb)
2063 dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma); 2024 dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma);
2064 2025
2065 if (ha->iodesc_pd)
2066 dma_pool_free(ha->s_dma_pool, ha->iodesc_pd, ha->iodesc_pd_dma);
2067
2068 if (ha->init_cb) 2026 if (ha->init_cb)
2069 dma_pool_free(ha->s_dma_pool, ha->init_cb, ha->init_cb_dma); 2027 dma_pool_free(ha->s_dma_pool, ha->init_cb, ha->init_cb_dma);
2070 2028
2071 if (ha->s_dma_pool) 2029 if (ha->s_dma_pool)
2072 dma_pool_destroy(ha->s_dma_pool); 2030 dma_pool_destroy(ha->s_dma_pool);
2073 2031
2074 if (ha->rlc_rsp)
2075 dma_free_coherent(&ha->pdev->dev,
2076 sizeof(rpt_lun_cmd_rsp_t), ha->rlc_rsp,
2077 ha->rlc_rsp_dma);
2078
2079 if (ha->gid_list) 2032 if (ha->gid_list)
2080 dma_free_coherent(&ha->pdev->dev, GID_LIST_SIZE, ha->gid_list, 2033 dma_free_coherent(&ha->pdev->dev, GID_LIST_SIZE, ha->gid_list,
2081 ha->gid_list_dma); 2034 ha->gid_list_dma);
@@ -2096,15 +2049,11 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
2096 ha->ct_sns_dma = 0; 2049 ha->ct_sns_dma = 0;
2097 ha->ms_iocb = NULL; 2050 ha->ms_iocb = NULL;
2098 ha->ms_iocb_dma = 0; 2051 ha->ms_iocb_dma = 0;
2099 ha->iodesc_pd = NULL;
2100 ha->iodesc_pd_dma = 0;
2101 ha->init_cb = NULL; 2052 ha->init_cb = NULL;
2102 ha->init_cb_dma = 0; 2053 ha->init_cb_dma = 0;
2103 2054
2104 ha->s_dma_pool = NULL; 2055 ha->s_dma_pool = NULL;
2105 2056
2106 ha->rlc_rsp = NULL;
2107 ha->rlc_rsp_dma = 0;
2108 ha->gid_list = NULL; 2057 ha->gid_list = NULL;
2109 ha->gid_list_dma = 0; 2058 ha->gid_list_dma = 0;
2110 2059
@@ -2122,15 +2071,10 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
2122 } 2071 }
2123 INIT_LIST_HEAD(&ha->fcports); 2072 INIT_LIST_HEAD(&ha->fcports);
2124 2073
2125 if (ha->fw_dump) 2074 vfree(ha->fw_dump);
2126 free_pages((unsigned long)ha->fw_dump, ha->fw_dump_order);
2127
2128 vfree(ha->fw_dump24);
2129
2130 vfree(ha->fw_dump_buffer); 2075 vfree(ha->fw_dump_buffer);
2131 2076
2132 ha->fw_dump = NULL; 2077 ha->fw_dump = NULL;
2133 ha->fw_dump24 = NULL;
2134 ha->fw_dumped = 0; 2078 ha->fw_dumped = 0;
2135 ha->fw_dump_reading = 0; 2079 ha->fw_dump_reading = 0;
2136 ha->fw_dump_buffer = NULL; 2080 ha->fw_dump_buffer = NULL;
@@ -2148,8 +2092,6 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
2148 * 2092 *
2149 * Context: 2093 * Context:
2150 * Kernel context. 2094 * Kernel context.
2151 *
2152 * Note: Sets the ref_count for non Null sp to one.
2153 */ 2095 */
2154static int 2096static int
2155qla2x00_allocate_sp_pool(scsi_qla_host_t *ha) 2097qla2x00_allocate_sp_pool(scsi_qla_host_t *ha)
@@ -2593,14 +2535,6 @@ qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout)
2593 return -ETIMEDOUT; 2535 return -ETIMEDOUT;
2594} 2536}
2595 2537
2596#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
2597
2598#define qla2x00_release_firmware() do { } while (0)
2599#define qla2x00_pci_module_init() (0)
2600#define qla2x00_pci_module_exit() do { } while (0)
2601
2602#else /* !defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) */
2603
2604/* Firmware interface routines. */ 2538/* Firmware interface routines. */
2605 2539
2606#define FW_BLOBS 5 2540#define FW_BLOBS 5
@@ -2667,33 +2601,18 @@ qla2x00_release_firmware(void)
2667 up(&qla_fw_lock); 2601 up(&qla_fw_lock);
2668} 2602}
2669 2603
2670static struct qla_board_info qla_board_tbl = {
2671 .drv_name = "qla2xxx",
2672};
2673
2674static struct pci_device_id qla2xxx_pci_tbl[] = { 2604static struct pci_device_id qla2xxx_pci_tbl[] = {
2675 { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2100, 2605 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2100) },
2676 PCI_ANY_ID, PCI_ANY_ID, }, 2606 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2200) },
2677 { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2200, 2607 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2300) },
2678 PCI_ANY_ID, PCI_ANY_ID, }, 2608 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2312) },
2679 { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2300, 2609 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2322) },
2680 PCI_ANY_ID, PCI_ANY_ID, }, 2610 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6312) },
2681 { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2312, 2611 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6322) },
2682 PCI_ANY_ID, PCI_ANY_ID, }, 2612 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2422) },
2683 { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2322, 2613 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432) },
2684 PCI_ANY_ID, PCI_ANY_ID, }, 2614 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5422) },
2685 { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6312, 2615 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5432) },
2686 PCI_ANY_ID, PCI_ANY_ID, },
2687 { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6322,
2688 PCI_ANY_ID, PCI_ANY_ID, },
2689 { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2422,
2690 PCI_ANY_ID, PCI_ANY_ID, },
2691 { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432,
2692 PCI_ANY_ID, PCI_ANY_ID, },
2693 { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5422,
2694 PCI_ANY_ID, PCI_ANY_ID, },
2695 { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5432,
2696 PCI_ANY_ID, PCI_ANY_ID, },
2697 { 0 }, 2616 { 0 },
2698}; 2617};
2699MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl); 2618MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl);
@@ -2701,7 +2620,7 @@ MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl);
2701static int __devinit 2620static int __devinit
2702qla2xxx_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) 2621qla2xxx_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
2703{ 2622{
2704 return qla2x00_probe_one(pdev, &qla_board_tbl); 2623 return qla2x00_probe_one(pdev);
2705} 2624}
2706 2625
2707static void __devexit 2626static void __devexit
@@ -2711,7 +2630,7 @@ qla2xxx_remove_one(struct pci_dev *pdev)
2711} 2630}
2712 2631
2713static struct pci_driver qla2xxx_pci_driver = { 2632static struct pci_driver qla2xxx_pci_driver = {
2714 .name = "qla2xxx", 2633 .name = QLA2XXX_DRIVER_NAME,
2715 .driver = { 2634 .driver = {
2716 .owner = THIS_MODULE, 2635 .owner = THIS_MODULE,
2717 }, 2636 },
@@ -2732,8 +2651,6 @@ qla2x00_pci_module_exit(void)
2732 pci_unregister_driver(&qla2xxx_pci_driver); 2651 pci_unregister_driver(&qla2xxx_pci_driver);
2733} 2652}
2734 2653
2735#endif
2736
2737/** 2654/**
2738 * qla2x00_module_init - Module initialization. 2655 * qla2x00_module_init - Module initialization.
2739 **/ 2656 **/
@@ -2753,9 +2670,6 @@ qla2x00_module_init(void)
2753 2670
2754 /* Derive version string. */ 2671 /* Derive version string. */
2755 strcpy(qla2x00_version_str, QLA2XXX_VERSION); 2672 strcpy(qla2x00_version_str, QLA2XXX_VERSION);
2756#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
2757 strcat(qla2x00_version_str, "-fw");
2758#endif
2759#if DEBUG_QLA2100 2673#if DEBUG_QLA2100
2760 strcat(qla2x00_version_str, "-debug"); 2674 strcat(qla2x00_version_str, "-debug");
2761#endif 2675#endif