Merge branch 'master'
[linux-2.6] / drivers / scsi / qla2xxx / ql2322.c
1 /*
2  * QLogic Fibre Channel HBA Driver
3  * Copyright (c)  2003-2005 QLogic Corporation
4  *
5  * See LICENSE.qla2xxx for copyright and licensing details.
6  */
7 #include <linux/init.h>
8 #include <linux/module.h>
9 #include <linux/pci.h>
10
11 #include "qla_def.h"
12
13 static char qla_driver_name[] = "qla2322";
14
15 extern unsigned char  fw2322ipx_version[];
16 extern unsigned char  fw2322ipx_version_str[];
17 extern unsigned short fw2322ipx_addr01;
18 extern unsigned short fw2322ipx_code01[];
19 extern unsigned short fw2322ipx_length01;
20 extern unsigned long rseqipx_code_addr01;
21 extern unsigned short rseqipx_code01[];
22 extern unsigned short rseqipx_code_length01;
23 extern unsigned long xseqipx_code_addr01;
24 extern unsigned short xseqipx_code01[];
25 extern unsigned short xseqipx_code_length01;
26
27 static struct qla_fw_info qla_fw_tbl[] = {
28         {
29                 .addressing     = FW_INFO_ADDR_NORMAL,
30                 .fwcode         = &fw2322ipx_code01[0],
31                 .fwlen          = &fw2322ipx_length01,
32                 .fwstart        = &fw2322ipx_addr01,
33         },
34         {
35                 .addressing     = FW_INFO_ADDR_EXTENDED,
36                 .fwcode         = &rseqipx_code01[0],
37                 .fwlen          = &rseqipx_code_length01,
38                 .lfwstart       = &rseqipx_code_addr01,
39         },
40         {
41                 .addressing     = FW_INFO_ADDR_EXTENDED,
42                 .fwcode         = &xseqipx_code01[0],
43                 .fwlen          = &xseqipx_code_length01,
44                 .lfwstart       = &xseqipx_code_addr01,
45         },
46         { FW_INFO_ADDR_NOMORE, },
47 };
48
49 static struct qla_board_info qla_board_tbl[] = {
50         {
51                 .drv_name       = qla_driver_name,
52                 .isp_name       = "ISP2322",
53                 .fw_info        = qla_fw_tbl,
54         },
55 };
56
57 static struct pci_device_id qla2322_pci_tbl[] = {
58         {
59                 .vendor         = PCI_VENDOR_ID_QLOGIC,
60                 .device         = PCI_DEVICE_ID_QLOGIC_ISP2322,
61                 .subvendor      = PCI_ANY_ID,
62                 .subdevice      = PCI_ANY_ID,
63                 .driver_data    = (unsigned long)&qla_board_tbl[0],
64         },
65         {0, 0},
66 };
67 MODULE_DEVICE_TABLE(pci, qla2322_pci_tbl);
68
69 static int __devinit
70 qla2322_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
71 {
72         return qla2x00_probe_one(pdev,
73             (struct qla_board_info *)id->driver_data);
74 }
75
76 static void __devexit
77 qla2322_remove_one(struct pci_dev *pdev)
78 {
79         qla2x00_remove_one(pdev);
80 }
81
82 static struct pci_driver qla2322_pci_driver = {
83         .name           = "qla2322",
84         .id_table       = qla2322_pci_tbl,
85         .probe          = qla2322_probe_one,
86         .remove         = __devexit_p(qla2322_remove_one),
87 };
88
89 static int __init
90 qla2322_init(void)
91 {
92         return pci_module_init(&qla2322_pci_driver);
93 }
94
95 static void __exit
96 qla2322_exit(void)
97 {
98         pci_unregister_driver(&qla2322_pci_driver);
99 }
100
101 module_init(qla2322_init);
102 module_exit(qla2322_exit);
103
104 MODULE_AUTHOR("QLogic Corporation");
105 MODULE_DESCRIPTION("QLogic ISP2322 FC-SCSI Host Bus Adapter driver");
106 MODULE_LICENSE("GPL");
107 MODULE_VERSION(QLA2XXX_VERSION);