ql2300.c 2.3 KB

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