Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame^] | 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 | /* |
| 10 | * This file contains a shim driver for the IOC4 IDE and serial drivers. |
| 11 | */ |
| 12 | |
| 13 | #include <linux/errno.h> |
| 14 | #include <linux/module.h> |
| 15 | #include <linux/pci.h> |
| 16 | #include <linux/ioc4_common.h> |
| 17 | #include <linux/ide.h> |
| 18 | |
| 19 | |
| 20 | static int __devinit |
| 21 | ioc4_probe_one(struct pci_dev *pdev, const struct pci_device_id *pci_id) |
| 22 | { |
| 23 | int ret; |
| 24 | |
| 25 | if ((ret = pci_enable_device(pdev))) { |
| 26 | printk(KERN_WARNING |
| 27 | "%s: Failed to enable device with " |
| 28 | "pci_dev 0x%p... returning\n", |
| 29 | __FUNCTION__, (void *)pdev); |
| 30 | return ret; |
| 31 | } |
| 32 | pci_set_master(pdev); |
| 33 | |
| 34 | /* attach each sub-device */ |
| 35 | ret = ioc4_ide_attach_one(pdev, pci_id); |
| 36 | if (ret) |
| 37 | return ret; |
| 38 | return ioc4_serial_attach_one(pdev, pci_id); |
| 39 | } |
| 40 | |
| 41 | /* pci device struct */ |
| 42 | static struct pci_device_id ioc4_s_id_table[] = { |
| 43 | {PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4, PCI_ANY_ID, |
| 44 | PCI_ANY_ID, 0x0b4000, 0xFFFFFF}, |
| 45 | {0} |
| 46 | }; |
| 47 | MODULE_DEVICE_TABLE(pci, ioc4_s_id_table); |
| 48 | |
| 49 | static struct pci_driver __devinitdata ioc4_s_driver = { |
| 50 | .name = "IOC4", |
| 51 | .id_table = ioc4_s_id_table, |
| 52 | .probe = ioc4_probe_one, |
| 53 | }; |
| 54 | |
| 55 | static int __devinit ioc4_detect(void) |
| 56 | { |
| 57 | ioc4_serial_init(); |
| 58 | |
| 59 | return pci_register_driver(&ioc4_s_driver); |
| 60 | } |
| 61 | module_init(ioc4_detect); |
| 62 | |
| 63 | MODULE_AUTHOR("Pat Gefre - Silicon Graphics Inc. (SGI) <pfg@sgi.com>"); |
| 64 | MODULE_DESCRIPTION("PCI driver module for SGI IOC4 Base-IO Card"); |
| 65 | MODULE_LICENSE("GPL"); |