ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / scsi / qla2xxx / ql6312.c
1 /*
2  * QLogic ISP6312 device driver for Linux 2.6.x
3  * Copyright (C) 2003-2004 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_os.h"
13 #include "qla_def.h"
14
15 static char qla_driver_name[] = "qla6312";
16
17 extern unsigned char  fw2300flx_version[];
18 extern unsigned char  fw2300flx_version_str[];
19 extern unsigned short fw2300flx_addr01;
20 extern unsigned short fw2300flx_code01[];
21 extern unsigned short fw2300flx_length01;
22
23 static struct qla_fw_info qla_fw_tbl[] = {
24         {
25                 .addressing     = FW_INFO_ADDR_NORMAL,
26                 .fwcode         = &fw2300flx_code01[0],
27                 .fwlen          = &fw2300flx_length01,
28                 .fwstart        = &fw2300flx_addr01,
29         },
30         { FW_INFO_ADDR_NOMORE, },
31 };
32
33 static struct qla_board_info qla_board_tbl[] = {
34         {
35                 .drv_name       = qla_driver_name,
36                 .isp_name       = "ISP6312",
37                 .fw_info        = qla_fw_tbl,
38         },
39 };
40
41 static struct pci_device_id qla6312_pci_tbl[] = {
42         {
43                 .vendor         = PCI_VENDOR_ID_QLOGIC,
44                 .device         = PCI_DEVICE_ID_QLOGIC_ISP6312,
45                 .subvendor      = PCI_ANY_ID,
46                 .subdevice      = PCI_ANY_ID,
47                 .driver_data    = (unsigned long)&qla_board_tbl[0],
48         },
49         {0, 0},
50 };
51 MODULE_DEVICE_TABLE(pci, qla6312_pci_tbl);
52
53 static int __devinit
54 qla6312_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
55 {
56         return qla2x00_probe_one(pdev,
57             (struct qla_board_info *)id->driver_data);
58 }
59
60 static void __devexit
61 qla6312_remove_one(struct pci_dev *pdev)
62 {
63         qla2x00_remove_one(pdev);
64 }
65
66 static struct pci_driver qla6312_pci_driver = {
67         .name           = "qla6312",
68         .id_table       = qla6312_pci_tbl,
69         .probe          = qla6312_probe_one,
70         .remove         = __devexit_p(qla6312_remove_one),
71 };
72
73 static int __init
74 qla6312_init(void)
75 {
76         return pci_module_init(&qla6312_pci_driver);
77 }
78
79 static void __exit
80 qla6312_exit(void)
81 {
82         pci_unregister_driver(&qla6312_pci_driver);
83 }
84
85 module_init(qla6312_init);
86 module_exit(qla6312_exit);
87
88 MODULE_AUTHOR("QLogic Corporation");
89 MODULE_DESCRIPTION("QLogic ISP6312 FC-SCSI Host Bus Adapter driver");
90 MODULE_LICENSE("GPL");