aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2005-11-09 18:49:19 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2005-12-13 20:11:19 -0500
commit331e34768657ead5a5b169337351e045305cafcb (patch)
tree952cb2dc4cb8ba3966d2de18e9830f3ca99f1464 /drivers/scsi/qla2xxx/qla_os.c
parent5433383ef33ed40c9c8a86a4355da344234af2a5 (diff)
[SCSI] qla2xxx: Add support for embedded ISP24xx firmware.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c82
1 files changed, 28 insertions, 54 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 47db029b2fce..41d2aeee0963 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -54,6 +54,13 @@ 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
57static void qla2x00_free_device(scsi_qla_host_t *); 64static void qla2x00_free_device(scsi_qla_host_t *);
58 65
59static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha); 66static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha);
@@ -1367,10 +1374,10 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1367 ha->isp_ops.reset_adapter = qla24xx_reset_adapter; 1374 ha->isp_ops.reset_adapter = qla24xx_reset_adapter;
1368 ha->isp_ops.nvram_config = qla24xx_nvram_config; 1375 ha->isp_ops.nvram_config = qla24xx_nvram_config;
1369 ha->isp_ops.update_fw_options = qla24xx_update_fw_options; 1376 ha->isp_ops.update_fw_options = qla24xx_update_fw_options;
1370#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
1371 ha->isp_ops.load_risc = qla24xx_load_risc_flash;
1372#else
1373 ha->isp_ops.load_risc = qla24xx_load_risc; 1377 ha->isp_ops.load_risc = qla24xx_load_risc;
1378#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
1379 if (ql2xfwloadflash)
1380 ha->isp_ops.load_risc = qla24xx_load_risc_flash;
1374#endif 1381#endif
1375 ha->isp_ops.pci_info_str = qla24xx_pci_info_str; 1382 ha->isp_ops.pci_info_str = qla24xx_pci_info_str;
1376 ha->isp_ops.fw_version_str = qla24xx_fw_version_str; 1383 ha->isp_ops.fw_version_str = qla24xx_fw_version_str;
@@ -2488,53 +2495,8 @@ qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout)
2488#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) 2495#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
2489 2496
2490#define qla2x00_release_firmware() do { } while (0) 2497#define qla2x00_release_firmware() do { } while (0)
2491 2498#define qla2x00_pci_module_init() (0)
2492static struct qla_board_info qla_board_tbl[] = { 2499#define qla2x00_pci_module_exit() do { } while (0)
2493 {
2494 .drv_name = "qla2400",
2495 .isp_name = "ISP2422",
2496 .fw_fname = "ql2400_fw.bin",
2497 .sht = &qla24xx_driver_template,
2498 },
2499 {
2500 .drv_name = "qla2400",
2501 .isp_name = "ISP2432",
2502 .fw_fname = "ql2400_fw.bin",
2503 .sht = &qla24xx_driver_template,
2504 },
2505};
2506
2507static struct pci_device_id qla2xxx_pci_tbl[] = {
2508 {
2509 .vendor = PCI_VENDOR_ID_QLOGIC,
2510 .device = PCI_DEVICE_ID_QLOGIC_ISP2422,
2511 .subvendor = PCI_ANY_ID,
2512 .subdevice = PCI_ANY_ID,
2513 .driver_data = (unsigned long)&qla_board_tbl[0],
2514 },
2515 {
2516 .vendor = PCI_VENDOR_ID_QLOGIC,
2517 .device = PCI_DEVICE_ID_QLOGIC_ISP2432,
2518 .subvendor = PCI_ANY_ID,
2519 .subdevice = PCI_ANY_ID,
2520 .driver_data = (unsigned long)&qla_board_tbl[1],
2521 },
2522 {0, 0},
2523};
2524MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl);
2525
2526static int __devinit
2527qla2xxx_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
2528{
2529 return qla2x00_probe_one(pdev,
2530 (struct qla_board_info *)id->driver_data);
2531}
2532
2533static void __devexit
2534qla2xxx_remove_one(struct pci_dev *pdev)
2535{
2536 qla2x00_remove_one(pdev);
2537}
2538 2500
2539#else /* !defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) */ 2501#else /* !defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) */
2540 2502
@@ -2647,8 +2609,6 @@ qla2xxx_remove_one(struct pci_dev *pdev)
2647 qla2x00_remove_one(pdev); 2609 qla2x00_remove_one(pdev);
2648} 2610}
2649 2611
2650#endif
2651
2652static struct pci_driver qla2xxx_pci_driver = { 2612static struct pci_driver qla2xxx_pci_driver = {
2653 .name = "qla2xxx", 2613 .name = "qla2xxx",
2654 .owner = THIS_MODULE, 2614 .owner = THIS_MODULE,
@@ -2657,6 +2617,20 @@ static struct pci_driver qla2xxx_pci_driver = {
2657 .remove = __devexit_p(qla2xxx_remove_one), 2617 .remove = __devexit_p(qla2xxx_remove_one),
2658}; 2618};
2659 2619
2620static inline int
2621qla2x00_pci_module_init(void)
2622{
2623 return pci_module_init(&qla2xxx_pci_driver);
2624}
2625
2626static inline void
2627qla2x00_pci_module_exit(void)
2628{
2629 pci_unregister_driver(&qla2xxx_pci_driver);
2630}
2631
2632#endif
2633
2660/** 2634/**
2661 * qla2x00_module_init - Module initialization. 2635 * qla2x00_module_init - Module initialization.
2662 **/ 2636 **/
@@ -2688,7 +2662,7 @@ qla2x00_module_init(void)
2688 return -ENODEV; 2662 return -ENODEV;
2689 2663
2690 printk(KERN_INFO "QLogic Fibre Channel HBA Driver\n"); 2664 printk(KERN_INFO "QLogic Fibre Channel HBA Driver\n");
2691 ret = pci_module_init(&qla2xxx_pci_driver); 2665 ret = qla2x00_pci_module_init();
2692 if (ret) { 2666 if (ret) {
2693 kmem_cache_destroy(srb_cachep); 2667 kmem_cache_destroy(srb_cachep);
2694 fc_release_transport(qla2xxx_transport_template); 2668 fc_release_transport(qla2xxx_transport_template);
@@ -2702,7 +2676,7 @@ qla2x00_module_init(void)
2702static void __exit 2676static void __exit
2703qla2x00_module_exit(void) 2677qla2x00_module_exit(void)
2704{ 2678{
2705 pci_unregister_driver(&qla2xxx_pci_driver); 2679 qla2x00_pci_module_exit();
2706 qla2x00_release_firmware(); 2680 qla2x00_release_firmware();
2707 kmem_cache_destroy(srb_cachep); 2681 kmem_cache_destroy(srb_cachep);
2708 fc_release_transport(qla2xxx_transport_template); 2682 fc_release_transport(qla2xxx_transport_template);