2 * pata_netcell.c - Netcell PATA driver
4 * (c) 2006 Red Hat <alan@redhat.com>
7 #include <linux/kernel.h>
8 #include <linux/module.h>
10 #include <linux/init.h>
11 #include <linux/blkdev.h>
12 #include <linux/delay.h>
13 #include <linux/device.h>
14 #include <scsi/scsi_host.h>
15 #include <linux/libata.h>
16 #include <linux/ata.h>
18 #define DRV_NAME "pata_netcell"
19 #define DRV_VERSION "0.1.7"
21 /* No PIO or DMA methods needed for this device */
23 static struct scsi_host_template netcell_sht = {
24 ATA_BMDMA_SHT(DRV_NAME),
27 static struct ata_port_operations netcell_ops = {
28 .inherits = &ata_bmdma_port_ops,
29 .cable_detect = ata_cable_80wire,
34 * netcell_init_one - Register Netcell ATA PCI device with kernel services
35 * @pdev: PCI device to register
36 * @ent: Entry in netcell_pci_tbl matching with @pdev
38 * Called from kernel PCI layer.
41 * Inherited from PCI layer (may sleep).
44 * Zero on success, or -ERRNO value.
47 static int netcell_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
49 static int printed_version;
50 static const struct ata_port_info info = {
52 .flags = ATA_FLAG_SLAVE_POSS,
53 /* Actually we don't really care about these as the
54 firmware deals with it */
55 .pio_mask = 0x1f, /* pio0-4 */
56 .mwdma_mask = 0x07, /* mwdma0-2 */
57 .udma_mask = ATA_UDMA5, /* UDMA 133 */
58 .port_ops = &netcell_ops,
60 const struct ata_port_info *port_info[] = { &info, NULL };
63 if (!printed_version++)
64 dev_printk(KERN_DEBUG, &pdev->dev,
65 "version " DRV_VERSION "\n");
67 rc = pcim_enable_device(pdev);
71 /* Any chip specific setup/optimisation/messages here */
72 ata_pci_clear_simplex(pdev);
74 /* And let the library code do the work */
75 return ata_pci_init_one(pdev, port_info);
78 static const struct pci_device_id netcell_pci_tbl[] = {
79 { PCI_VDEVICE(NETCELL, PCI_DEVICE_ID_REVOLUTION), },
81 { } /* terminate list */
84 static struct pci_driver netcell_pci_driver = {
86 .id_table = netcell_pci_tbl,
87 .probe = netcell_init_one,
88 .remove = ata_pci_remove_one,
90 .suspend = ata_pci_device_suspend,
91 .resume = ata_pci_device_resume,
95 static int __init netcell_init(void)
97 return pci_register_driver(&netcell_pci_driver);
100 static void __exit netcell_exit(void)
102 pci_unregister_driver(&netcell_pci_driver);
105 module_init(netcell_init);
106 module_exit(netcell_exit);
108 MODULE_AUTHOR("Alan Cox");
109 MODULE_DESCRIPTION("SCSI low-level driver for Netcell PATA RAID");
110 MODULE_LICENSE("GPL");
111 MODULE_DEVICE_TABLE(pci, netcell_pci_tbl);
112 MODULE_VERSION(DRV_VERSION);