ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / scsi / qla2xxx / ql2200.c
1 /*
2  * QLogic ISP2200 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[] = "qla2200";
17
18 extern unsigned char  fw2200tp_version[];
19 extern unsigned char  fw2200tp_version_str[];
20 extern unsigned short fw2200tp_addr01;
21 extern unsigned short fw2200tp_code01[];
22 extern unsigned short fw2200tp_length01;
23
24 static struct qla_fw_info qla_fw_tbl[] = {
25         {
26                 .addressing     = FW_INFO_ADDR_NORMAL,
27                 .fwcode         = &fw2200tp_code01[0],
28                 .fwlen          = &fw2200tp_length01,
29                 .fwstart        = &fw2200tp_addr01,
30         },
31
32         { FW_INFO_ADDR_NOMORE, },
33 };
34
35 static struct qla_board_info qla_board_tbl = {
36         .drv_name       = qla_driver_name,
37
38         .isp_name       = "ISP2200",
39         .fw_info        = qla_fw_tbl,
40 };
41
42 static struct pci_device_id qla2200_pci_tbl[] = {
43         {
44                 .vendor         = PCI_VENDOR_ID_QLOGIC,
45                 .device         = PCI_DEVICE_ID_QLOGIC_ISP2200,
46                 .subvendor      = PCI_ANY_ID,
47                 .subdevice      = PCI_ANY_ID,
48                 .driver_data    = (unsigned long)&qla_board_tbl,
49         },
50
51         {0, 0},
52 };
53 MODULE_DEVICE_TABLE(pci, qla2200_pci_tbl);
54
55 static int __devinit
56 qla2200_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
57 {
58         return qla2x00_probe_one(pdev,
59             (struct qla_board_info *)id->driver_data);
60 }
61
62 static void __devexit
63 qla2200_remove_one(struct pci_dev *pdev)
64 {
65         qla2x00_remove_one(pdev);
66 }
67
68 static struct pci_driver qla2200_pci_driver = {
69         .name           = "qla2200",
70         .id_table       = qla2200_pci_tbl,
71         .probe          = qla2200_probe_one,
72         .remove         = __devexit_p(qla2200_remove_one),
73 };
74
75 static int __init
76 qla2200_init(void)
77 {
78         return pci_module_init(&qla2200_pci_driver);
79 }
80
81 static void __exit
82 qla2200_exit(void)
83 {
84         pci_unregister_driver(&qla2200_pci_driver);
85 }
86
87 module_init(qla2200_init);
88 module_exit(qla2200_exit);
89
90 MODULE_AUTHOR("QLogic Corporation");
91 MODULE_DESCRIPTION("QLogic ISP22xx FC-SCSI Host Bus Adapter driver");
92 MODULE_LICENSE("GPL");