ql2322.c 2.8 KB

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