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