11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *  Copyright (C) 2001-2002	Andre Hedrick <andre@linux-ide.org>
3ccd32e221c3e3797ac56305c554ad8b07c13c815Alan Cox *  Portions (C) Copyright 2002  Red Hat Inc
41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * This program is free software; you can redistribute it and/or modify it
61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * under the terms of the GNU General Public License as published by the
71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Free Software Foundation; either version 2, or (at your option) any
81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * later version.
91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * This program is distributed in the hope that it will be useful, but
111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * WITHOUT ANY WARRANTY; without even the implied warranty of
121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * General Public License for more details.
141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * For the avoidance of doubt the "preferred form" of this code is one which
161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * is in an open non patent encumbered format. Where cryptographic key signing
171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * forms part of the process of creating an executable the information
181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * including keys needed to generate an equivalently functional executable
191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * are deemed to be part of the source code.
201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/types.h>
231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/module.h>
241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/kernel.h>
251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/pci.h>
261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/ide.h>
271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/init.h>
281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
29ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz#define DRV_NAME "ide_pci_generic"
30ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz
3190ab5ee94171b3e28de6bb42ee30b527014e0be7Rusty Russellstatic bool ide_generic_all;		/* Set to claim all devices */
32b189346cd10e28fa080347591066f0688405faeeAlan Cox
33a4bea10eca68152e84ffc4eaeb9d20ec2ac34664Patrick Jeffersonmodule_param_named(all_generic_ide, ide_generic_all, bool, 0444);
34a4bea10eca68152e84ffc4eaeb9d20ec2ac34664Patrick JeffersonMODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers.");
35b189346cd10e28fa080347591066f0688405faeeAlan Cox
36c339dfdd65b52bfd947ab29d1210314a2f6d622dBartlomiej Zolnierkiewiczstatic void netcell_quirkproc(ide_drive_t *drive)
37c339dfdd65b52bfd947ab29d1210314a2f6d622dBartlomiej Zolnierkiewicz{
38c339dfdd65b52bfd947ab29d1210314a2f6d622dBartlomiej Zolnierkiewicz	/* mark words 85-87 as valid */
39c339dfdd65b52bfd947ab29d1210314a2f6d622dBartlomiej Zolnierkiewicz	drive->id[ATA_ID_CSF_DEFAULT] |= 0x4000;
40c339dfdd65b52bfd947ab29d1210314a2f6d622dBartlomiej Zolnierkiewicz}
41c339dfdd65b52bfd947ab29d1210314a2f6d622dBartlomiej Zolnierkiewicz
42c339dfdd65b52bfd947ab29d1210314a2f6d622dBartlomiej Zolnierkiewiczstatic const struct ide_port_ops netcell_port_ops = {
43c339dfdd65b52bfd947ab29d1210314a2f6d622dBartlomiej Zolnierkiewicz	.quirkproc		= netcell_quirkproc,
44c339dfdd65b52bfd947ab29d1210314a2f6d622dBartlomiej Zolnierkiewicz};
45c339dfdd65b52bfd947ab29d1210314a2f6d622dBartlomiej Zolnierkiewicz
46ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz#define DECLARE_GENERIC_PCI_DEV(extra_flags) \
471c3dd326ad790934fd88ec086e75a9d61ddaef8aBartlomiej Zolnierkiewicz	{ \
48ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz		.name		= DRV_NAME, \
497cab14a79973893392111b8f887856a54621f759Bartlomiej Zolnierkiewicz		.host_flags	= IDE_HFLAG_TRUST_BIOS_FOR_DMA | \
505e71d9c5a50b92b33d35061d42ac39166db9578eBartlomiej Zolnierkiewicz				  extra_flags, \
515f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.swdma_mask	= ATA_SWDMA2, \
525f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.mwdma_mask	= ATA_MWDMA2, \
535f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.udma_mask	= ATA_UDMA6, \
541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	}
551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
568562043606430185cad26d085d46adcc7ad67fd1Bartlomiej Zolnierkiewiczstatic const struct ide_port_info generic_chipsets[] __devinitdata = {
57ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	/*  0: Unknown */
58ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	DECLARE_GENERIC_PCI_DEV(0),
591c3dd326ad790934fd88ec086e75a9d61ddaef8aBartlomiej Zolnierkiewicz
60ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{	/* 1: NS87410 */
61ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz		.name		= DRV_NAME,
6217deabdcded322c04c5ec2baf8cf38c58017f08ePaolo Ciarrocchi		.enablebits	= { {0x43, 0x08, 0x08}, {0x47, 0x08, 0x08} },
635e71d9c5a50b92b33d35061d42ac39166db9578eBartlomiej Zolnierkiewicz		.host_flags	= IDE_HFLAG_TRUST_BIOS_FOR_DMA,
645f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.swdma_mask	= ATA_SWDMA2,
655f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.mwdma_mask	= ATA_MWDMA2,
665f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.udma_mask	= ATA_UDMA6,
671c3dd326ad790934fd88ec086e75a9d61ddaef8aBartlomiej Zolnierkiewicz	},
681c3dd326ad790934fd88ec086e75a9d61ddaef8aBartlomiej Zolnierkiewicz
69ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	/*  2: SAMURAI / HT6565 / HINT_IDE */
70ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	DECLARE_GENERIC_PCI_DEV(0),
71ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	/*  3: UM8673F / UM8886A / UM8886BF */
722467922a560bb7e6eb4635435760ad0a2197ffccBartlomiej Zolnierkiewicz	DECLARE_GENERIC_PCI_DEV(IDE_HFLAG_NO_DMA),
73ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	/*  4: VIA_IDE / OPTI621V / Piccolo010{2,3,5} */
74ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	DECLARE_GENERIC_PCI_DEV(IDE_HFLAG_NO_AUTODMA),
75ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz
76ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{	/* 5: VIA8237SATA */
77ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz		.name		= DRV_NAME,
787cab14a79973893392111b8f887856a54621f759Bartlomiej Zolnierkiewicz		.host_flags	= IDE_HFLAG_TRUST_BIOS_FOR_DMA |
797cab14a79973893392111b8f887856a54621f759Bartlomiej Zolnierkiewicz				  IDE_HFLAG_OFF_BOARD,
805f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.swdma_mask	= ATA_SWDMA2,
815f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.mwdma_mask	= ATA_MWDMA2,
825f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.udma_mask	= ATA_UDMA6,
831c3dd326ad790934fd88ec086e75a9d61ddaef8aBartlomiej Zolnierkiewicz	},
841c3dd326ad790934fd88ec086e75a9d61ddaef8aBartlomiej Zolnierkiewicz
85ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{	/* 6: Revolution */
86ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz		.name		= DRV_NAME,
87c339dfdd65b52bfd947ab29d1210314a2f6d622dBartlomiej Zolnierkiewicz		.port_ops	= &netcell_port_ops,
888ac2b42a45896641ed292deaf038a1d2703d85a6Bartlomiej Zolnierkiewicz		.host_flags	= IDE_HFLAG_CLEAR_SIMPLEX |
898ac2b42a45896641ed292deaf038a1d2703d85a6Bartlomiej Zolnierkiewicz				  IDE_HFLAG_TRUST_BIOS_FOR_DMA |
907cab14a79973893392111b8f887856a54621f759Bartlomiej Zolnierkiewicz				  IDE_HFLAG_OFF_BOARD,
915f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.swdma_mask	= ATA_SWDMA2,
925f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.mwdma_mask	= ATA_MWDMA2,
935f8b6c34854a966fe5eb7241fde0419d47d5d408Bartlomiej Zolnierkiewicz		.udma_mask	= ATA_UDMA6,
941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	}
951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/**
981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	generic_init_one	-	called when a PIIX is found
991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	@dev: the generic device
1001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	@id: the matching pci id
1011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
1021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	Called when the PCI registration layer (or the IDE initialization)
1031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *	finds a device matching our IDE device tables.
1041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
10517deabdcded322c04c5ec2baf8cf38c58017f08ePaolo Ciarrocchi
1061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstatic int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{
1088562043606430185cad26d085d46adcc7ad67fd1Bartlomiej Zolnierkiewicz	const struct ide_port_info *d = &generic_chipsets[id->driver_data];
1091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int ret = -ENODEV;
1101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
111b189346cd10e28fa080347591066f0688405faeeAlan Cox	/* Don't use the generic entry unless instructed to do so */
112b189346cd10e28fa080347591066f0688405faeeAlan Cox	if (id->driver_data == 0 && ide_generic_all == 0)
113b189346cd10e28fa080347591066f0688405faeeAlan Cox			goto out;
114b189346cd10e28fa080347591066f0688405faeeAlan Cox
115ea30759643b423933ced48acdd78e5299f05295bJiri Slaby	switch (dev->vendor) {
116ea30759643b423933ced48acdd78e5299f05295bJiri Slaby	case PCI_VENDOR_ID_UMC:
117ea30759643b423933ced48acdd78e5299f05295bJiri Slaby		if (dev->device == PCI_DEVICE_ID_UMC_UM8886A &&
118ea30759643b423933ced48acdd78e5299f05295bJiri Slaby				!(PCI_FUNC(dev->devfn) & 1))
119ea30759643b423933ced48acdd78e5299f05295bJiri Slaby			goto out; /* UM8886A/BF pair */
120ea30759643b423933ced48acdd78e5299f05295bJiri Slaby		break;
121ea30759643b423933ced48acdd78e5299f05295bJiri Slaby	case PCI_VENDOR_ID_OPTI:
122ea30759643b423933ced48acdd78e5299f05295bJiri Slaby		if (dev->device == PCI_DEVICE_ID_OPTI_82C558 &&
123ea30759643b423933ced48acdd78e5299f05295bJiri Slaby				!(PCI_FUNC(dev->devfn) & 1))
124ea30759643b423933ced48acdd78e5299f05295bJiri Slaby			goto out;
125ea30759643b423933ced48acdd78e5299f05295bJiri Slaby		break;
126ea30759643b423933ced48acdd78e5299f05295bJiri Slaby	case PCI_VENDOR_ID_JMICRON:
127ea30759643b423933ced48acdd78e5299f05295bJiri Slaby		if (dev->device != PCI_DEVICE_ID_JMICRON_JMB368 &&
128ea30759643b423933ced48acdd78e5299f05295bJiri Slaby				PCI_FUNC(dev->devfn) != 1)
129ea30759643b423933ced48acdd78e5299f05295bJiri Slaby			goto out;
130ea30759643b423933ced48acdd78e5299f05295bJiri Slaby		break;
131ea30759643b423933ced48acdd78e5299f05295bJiri Slaby	case PCI_VENDOR_ID_NS:
132ea30759643b423933ced48acdd78e5299f05295bJiri Slaby		if (dev->device == PCI_DEVICE_ID_NS_87410 &&
133ea30759643b423933ced48acdd78e5299f05295bJiri Slaby				(dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
134c333526f489044be2b93085720eb898f0037b346Alan Cox			goto out;
135ea30759643b423933ced48acdd78e5299f05295bJiri Slaby		break;
136c333526f489044be2b93085720eb898f0037b346Alan Cox	}
13715e0c694367332d7e7114c7c73044bc5fed9ee48Alan Cox
1383719bc5c22c9025bf1c909fe8b527ebf1de9a153Alan Cox	if (dev->vendor != PCI_VENDOR_ID_JMICRON) {
139ea30759643b423933ced48acdd78e5299f05295bJiri Slaby		u16 command;
1403719bc5c22c9025bf1c909fe8b527ebf1de9a153Alan Cox		pci_read_config_word(dev, PCI_COMMAND, &command);
1413719bc5c22c9025bf1c909fe8b527ebf1de9a153Alan Cox		if (!(command & PCI_COMMAND_IO)) {
14228cfd8af52a9ed4e5bd1751ea6bc0b8c870f68ecBartlomiej Zolnierkiewicz			printk(KERN_INFO "%s %s: skipping disabled "
14328cfd8af52a9ed4e5bd1751ea6bc0b8c870f68ecBartlomiej Zolnierkiewicz				"controller\n", d->name, pci_name(dev));
1443719bc5c22c9025bf1c909fe8b527ebf1de9a153Alan Cox			goto out;
1453719bc5c22c9025bf1c909fe8b527ebf1de9a153Alan Cox		}
1461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	}
1476cdf6eb357c2681596b7b1672b92396ba82333d4Bartlomiej Zolnierkiewicz	ret = ide_pci_init_one(dev, d, NULL);
1481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsout:
1491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	return ret;
1501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}
1511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1529cbcc5e3c5d2d0355fed22d00762fd764c81a383Bartlomiej Zolnierkiewiczstatic const struct pci_device_id generic_pci_tbl[] = {
1539cbcc5e3c5d2d0355fed22d00762fd764c81a383Bartlomiej Zolnierkiewicz	{ PCI_VDEVICE(NS,	PCI_DEVICE_ID_NS_87410),		 1 },
1549cbcc5e3c5d2d0355fed22d00762fd764c81a383Bartlomiej Zolnierkiewicz	{ PCI_VDEVICE(PCTECH,	PCI_DEVICE_ID_PCTECH_SAMURAI_IDE),	 2 },
155ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{ PCI_VDEVICE(HOLTEK,	PCI_DEVICE_ID_HOLTEK_6565),		 2 },
156ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{ PCI_VDEVICE(UMC,	PCI_DEVICE_ID_UMC_UM8673F),		 3 },
157ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{ PCI_VDEVICE(UMC,	PCI_DEVICE_ID_UMC_UM8886A),		 3 },
158ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{ PCI_VDEVICE(UMC,	PCI_DEVICE_ID_UMC_UM8886BF),		 3 },
159ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{ PCI_VDEVICE(HINT,	PCI_DEVICE_ID_HINT_VXPROII_IDE),	 2 },
160ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{ PCI_VDEVICE(VIA,	PCI_DEVICE_ID_VIA_82C561),		 4 },
161ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{ PCI_VDEVICE(OPTI,	PCI_DEVICE_ID_OPTI_82C558),		 4 },
1621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifdef CONFIG_BLK_DEV_IDE_SATA
163ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{ PCI_VDEVICE(VIA,	PCI_DEVICE_ID_VIA_8237_SATA),		 5 },
1641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif
165ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{ PCI_VDEVICE(TOSHIBA,	PCI_DEVICE_ID_TOSHIBA_PICCOLO_1),	 4 },
166ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{ PCI_VDEVICE(TOSHIBA,	PCI_DEVICE_ID_TOSHIBA_PICCOLO_2),	 4 },
1678e182a90f91456335756d2ce304ad470795d98e1Alan Cox	{ PCI_VDEVICE(TOSHIBA,	PCI_DEVICE_ID_TOSHIBA_PICCOLO_3),	 4 },
1688e182a90f91456335756d2ce304ad470795d98e1Alan Cox	{ PCI_VDEVICE(TOSHIBA,	PCI_DEVICE_ID_TOSHIBA_PICCOLO_5),	 4 },
169ced3ec8aa7d0fa3300187ee47c144a22ccfc974eBartlomiej Zolnierkiewicz	{ PCI_VDEVICE(NETCELL,	PCI_DEVICE_ID_REVOLUTION),		 6 },
1709cbcc5e3c5d2d0355fed22d00762fd764c81a383Bartlomiej Zolnierkiewicz	/*
1719cbcc5e3c5d2d0355fed22d00762fd764c81a383Bartlomiej Zolnierkiewicz	 * Must come last.  If you add entries adjust
1729cbcc5e3c5d2d0355fed22d00762fd764c81a383Bartlomiej Zolnierkiewicz	 * this table and generic_chipsets[] appropriately.
1739cbcc5e3c5d2d0355fed22d00762fd764c81a383Bartlomiej Zolnierkiewicz	 */
1749cbcc5e3c5d2d0355fed22d00762fd764c81a383Bartlomiej Zolnierkiewicz	{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0 },
1751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	{ 0, },
1761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
1771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsMODULE_DEVICE_TABLE(pci, generic_pci_tbl);
1781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
179a9ab09e26055a76295548ca36ec00de2f4367d32Bartlomiej Zolnierkiewiczstatic struct pci_driver generic_pci_driver = {
1801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	.name		= "PCI_IDE",
1811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	.id_table	= generic_pci_tbl,
1821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	.probe		= generic_init_one,
183f566bcae9fb39b108e39a2f31594c028d6ee2e77Bartlomiej Zolnierkiewicz	.remove		= ide_pci_remove,
184feb22b7f8e62b1b987a3a1dbad95af767a1df832Bartlomiej Zolnierkiewicz	.suspend	= ide_pci_suspend,
185feb22b7f8e62b1b987a3a1dbad95af767a1df832Bartlomiej Zolnierkiewicz	.resume		= ide_pci_resume,
1861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
1871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
18882ab1eeceba6705cd5a8815c48eb03af1dada744Bartlomiej Zolnierkiewiczstatic int __init generic_ide_init(void)
1891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{
190a9ab09e26055a76295548ca36ec00de2f4367d32Bartlomiej Zolnierkiewicz	return ide_pci_register_driver(&generic_pci_driver);
1911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}
1921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
193f566bcae9fb39b108e39a2f31594c028d6ee2e77Bartlomiej Zolnierkiewiczstatic void __exit generic_ide_exit(void)
194f566bcae9fb39b108e39a2f31594c028d6ee2e77Bartlomiej Zolnierkiewicz{
195a9ab09e26055a76295548ca36ec00de2f4367d32Bartlomiej Zolnierkiewicz	pci_unregister_driver(&generic_pci_driver);
196f566bcae9fb39b108e39a2f31594c028d6ee2e77Bartlomiej Zolnierkiewicz}
197f566bcae9fb39b108e39a2f31594c028d6ee2e77Bartlomiej Zolnierkiewicz
1981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsmodule_init(generic_ide_init);
199f566bcae9fb39b108e39a2f31594c028d6ee2e77Bartlomiej Zolnierkiewiczmodule_exit(generic_ide_exit);
2001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsMODULE_AUTHOR("Andre Hedrick");
2021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsMODULE_DESCRIPTION("PCI driver module for generic PCI IDE");
2031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsMODULE_LICENSE("GPL");
204