ioc4.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved.
  7. */
  8. /*
  9. * This file contains a shim driver for the IOC4 IDE and serial drivers.
  10. */
  11. #include <linux/errno.h>
  12. #include <linux/module.h>
  13. #include <linux/pci.h>
  14. #include <linux/ioc4_common.h>
  15. #include <linux/ide.h>
  16. static int __devinit
  17. ioc4_probe_one(struct pci_dev *pdev, const struct pci_device_id *pci_id)
  18. {
  19. int ret;
  20. if ((ret = pci_enable_device(pdev))) {
  21. printk(KERN_WARNING
  22. "%s: Failed to enable device with "
  23. "pci_dev 0x%p... returning\n",
  24. __FUNCTION__, (void *)pdev);
  25. return ret;
  26. }
  27. pci_set_master(pdev);
  28. /* attach each sub-device */
  29. ret = ioc4_ide_attach_one(pdev, pci_id);
  30. if (ret)
  31. return ret;
  32. return ioc4_serial_attach_one(pdev, pci_id);
  33. }
  34. /* pci device struct */
  35. static struct pci_device_id ioc4_s_id_table[] = {
  36. {PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4, PCI_ANY_ID,
  37. PCI_ANY_ID, 0x0b4000, 0xFFFFFF},
  38. {0}
  39. };
  40. MODULE_DEVICE_TABLE(pci, ioc4_s_id_table);
  41. static struct pci_driver __devinitdata ioc4_s_driver = {
  42. .name = "IOC4",
  43. .id_table = ioc4_s_id_table,
  44. .probe = ioc4_probe_one,
  45. };
  46. static int __devinit ioc4_detect(void)
  47. {
  48. ioc4_serial_init();
  49. return pci_register_driver(&ioc4_s_driver);
  50. }
  51. module_init(ioc4_detect);
  52. MODULE_AUTHOR("Pat Gefre - Silicon Graphics Inc. (SGI) <pfg@sgi.com>");
  53. MODULE_DESCRIPTION("PCI driver module for SGI IOC4 Base-IO Card");
  54. MODULE_LICENSE("GPL");