ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / scsi / qla2xxx / ql2300.c
1 /*
2  * QLogic ISP2300 device driver for Linux 2.6.x
3  * Copyright (C) 2003 Christoph Hellwig.
4  * Copyright (C) 2003-2004 QLogic Corporation (www.qlogic.com)
5  *
6  * Released under GPL v2.
7  */
8
9 #include <linux/init.h>
10 #include <linux/module.h>
11 #include <linux/pci.h>
12
13 #include "qla_os.h"
14 #include "qla_def.h"
15
16 static char qla_driver_name[] = "qla2300";
17
18 extern unsigned char  fw2300ipx_version[];
19 extern unsigned char  fw2300ipx_version_str[];
20 extern unsigned short fw2300ipx_addr01;
21 extern unsigned short fw2300ipx_code01[];
22 extern unsigned short fw2300ipx_length01;
23
24 static struct qla_fw_info qla_fw_tbl[] = {
25         {
26                 .addressing     = FW_INFO_ADDR_NORMAL,
27                 .fwcode         = &fw2300ipx_code01[0],
28                 .fwlen          = &fw2300ipx_length01,
29                 .fwstart        = &fw2300ipx_addr01,
30         },
31         { FW_INFO_ADDR_NOMORE, },
32 };
33
34 static struct qla_board_info qla_board_tbl[] = {
35         {
36                 .drv_name       = qla_driver_name,
37                 .isp_name       = "ISP2300",
38                 .fw_info        = qla_fw_tbl,
39         },
40         {
41                 .drv_name       = qla_driver_name,
42                 .isp_name       = "ISP2312",
43                 .fw_info        = qla_fw_tbl,
44         },
45 };
46
47 static struct pci_device_id qla2300_pci_tbl[] = {
48         {
49                 .vendor         = PCI_VENDOR_ID_QLOGIC,
50                 .device         = PCI_DEVICE_ID_QLOGIC_ISP2300,
51                 .subvendor      = PCI_ANY_ID,
52                 .subdevice      = PCI_ANY_ID,
53                 .driver_data    = (unsigned long)&qla_board_tbl[0],
54         },
55         {
56                 .vendor         = PCI_VENDOR_ID_QLOGIC,
57                 .device         = PCI_DEVICE_ID_QLOGIC_ISP2312,
58                 .subvendor      = PCI_ANY_ID,
59                 .subdevice      = PCI_ANY_ID,
60                 .driver_data    = (unsigned long)&qla_board_tbl[1],
61         },
62         {0, 0},
63 };
64 MODULE_DEVICE_TABLE(pci, qla2300_pci_tbl);
65
66 static int __devinit
67 qla2300_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
68 {
69         return qla2x00_probe_one(pdev,
70             (struct qla_board_info *)id->driver_data);
71 }
72
73 static void __devexit
74 qla2300_remove_one(struct pci_dev *pdev)
75 {
76         qla2x00_remove_one(pdev);
77 }
78
79 static struct pci_driver qla2300_pci_driver = {
80         .name           = "qla2300",
81         .id_table       = qla2300_pci_tbl,
82         .probe          = qla2300_probe_one,
83         .remove         = __devexit_p(qla2300_remove_one),
84 };
85
86 static int __init
87 qla2300_init(void)
88 {
89         return pci_module_init(&qla2300_pci_driver);
90 }
91
92 static void __exit
93 qla2300_exit(void)
94 {
95         pci_unregister_driver(&qla2300_pci_driver);
96 }
97
98 module_init(qla2300_init);
99 module_exit(qla2300_exit);
100
101 MODULE_AUTHOR("QLogic Corporation");
102 MODULE_DESCRIPTION("QLogic ISP2300 FC-SCSI Host Bus Adapter driver");
103 MODULE_LICENSE("GPL");