Commit aa509d0d authored by Jens Axboe's avatar Jens Axboe

New IDE pci low level driver setup scheme

parent a40bed1d
...@@ -38,8 +38,6 @@ static int aec62xx_get_info (char *buffer, char **addr, off_t offset, int count) ...@@ -38,8 +38,6 @@ static int aec62xx_get_info (char *buffer, char **addr, off_t offset, int count)
char *chipset_nums[] = {"error", "error", "error", "error", char *chipset_nums[] = {"error", "error", "error", "error",
"error", "error", "850UF", "860", "error", "error", "850UF", "860",
"860R", "865", "865R", "error" }; "860R", "865", "865R", "error" };
// char *modes_33[] = {};
// char *modes_34[] = {};
int i; int i;
for (i = 0; i < n_aec_devs; i++) { for (i = 0; i < n_aec_devs; i++) {
...@@ -516,22 +514,69 @@ static void __init init_setup_aec6x80 (struct pci_dev *dev, ide_pci_device_t *d) ...@@ -516,22 +514,69 @@ static void __init init_setup_aec6x80 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
int __init aec62xx_scan_pcidev (struct pci_dev *dev) /**
* aec62xx_init_one - called when a AEC is found
* @dev: the aec62xx device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d; ide_pci_device_t *d = &aec62xx_chipsets[id->driver_data];
if (dev->vendor != PCI_VENDOR_ID_ARTOP) if (dev->device != d->device)
return 0; BUG();
d->init_setup(dev, d);
for (d = aec62xx_chipsets;
d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0; return 0;
} }
/**
* aec62xx_remove_one - called when an AEC is unplugged
* @dev: the device that was removed
*
* Disconnect an AEC device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void aec62xx_remove_one(struct pci_dev *dev)
{
panic("AEC62xx removal not yet supported");
}
static struct pci_device_id aec62xx_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP850UF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860R, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865R, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
{ 0, },
};
static struct pci_driver driver = {
name: "AEC62xx IDE",
id_table: aec62xx_pci_tbl,
probe: aec62xx_init_one,
remove: __devexit_p(aec62xx_remove_one),
};
static int aec62xx_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void aec62xx_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(aec62xx_ide_init);
module_exit(aec62xx_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for ARTOP AEC62xx IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -99,7 +99,7 @@ static void init_hwif_aec62xx(ide_hwif_t *); ...@@ -99,7 +99,7 @@ static void init_hwif_aec62xx(ide_hwif_t *);
static void init_dma_aec62xx(ide_hwif_t *, unsigned long); static void init_dma_aec62xx(ide_hwif_t *, unsigned long);
static ide_pci_device_t aec62xx_chipsets[] __initdata = { static ide_pci_device_t aec62xx_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_ARTOP, vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP850UF, device: PCI_DEVICE_ID_ARTOP_ATP850UF,
name: "AEC6210", name: "AEC6210",
...@@ -113,7 +113,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = { ...@@ -113,7 +113,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
bootable: OFF_BOARD, bootable: OFF_BOARD,
extra: 0, extra: 0,
},{ },{ /* 1 */
vendor: PCI_VENDOR_ID_ARTOP, vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP860, device: PCI_DEVICE_ID_ARTOP_ATP860,
name: "AEC6260", name: "AEC6260",
...@@ -127,7 +127,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = { ...@@ -127,7 +127,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD, bootable: OFF_BOARD,
extra: 0, extra: 0,
},{ },{ /* 2 */
vendor: PCI_VENDOR_ID_ARTOP, vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP860R, device: PCI_DEVICE_ID_ARTOP_ATP860R,
name: "AEC6260R", name: "AEC6260R",
...@@ -141,7 +141,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = { ...@@ -141,7 +141,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
bootable: NEVER_BOARD, bootable: NEVER_BOARD,
extra: 0, extra: 0,
},{ },{ /* 3 */
vendor: PCI_VENDOR_ID_ARTOP, vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP865, device: PCI_DEVICE_ID_ARTOP_ATP865,
name: "AEC6X80", name: "AEC6X80",
...@@ -155,7 +155,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = { ...@@ -155,7 +155,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD, bootable: OFF_BOARD,
extra: 0, extra: 0,
},{ },{ /* 4 */
vendor: PCI_VENDOR_ID_ARTOP, vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP865R, device: PCI_DEVICE_ID_ARTOP_ATP865R,
name: "AEC6X80R", name: "AEC6X80R",
...@@ -169,11 +169,6 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = { ...@@ -169,11 +169,6 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
bootable: OFF_BOARD, bootable: OFF_BOARD,
extra: 0, extra: 0,
},{
vendor: 0,
device: 0,
channels: 0,
bootable: EOL,
} }
}; };
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -623,9 +624,11 @@ static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char ...@@ -623,9 +624,11 @@ static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char
/* /*
* We should only tune the 1533 enable if we are using an ALi * We should only tune the 1533 enable if we are using an ALi
* North bridge * North bridge. We might have no north found on some zany
* box without a device at 0:0.0. The ALi bridge will be at
* 0:0.0 so if we didn't find one we know what is cooking.
*/ */
if (north->vendor != PCI_VENDOR_ID_AL) { if (north && north->vendor != PCI_VENDOR_ID_AL) {
local_irq_restore(flags); local_irq_restore(flags);
return 0; return 0;
} }
...@@ -841,45 +844,64 @@ extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); ...@@ -841,45 +844,64 @@ extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
/** /**
* init_setup_ali15x3 - set up an ALi15x3 IDE controller * alim15x3_init_one - set up an ALi15x3 IDE controller
* @dev: PCI device to set up * @dev: PCI device to set up
* @d: IDE PCI structures
* *
* Perform the actual set up for the ALi15x3. * Perform the actual set up for an ALi15x3 that has been found by the
* hot plug layer.
*/ */
static void __init init_setup_ali15x3 (struct pci_dev *dev, ide_pci_device_t *d) static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &ali15x3_chipsets[id->driver_data];
#if defined(CONFIG_SPARC64) #if defined(CONFIG_SPARC64)
d->init_hwif = init_hwif_common_ali15x3; d->init_hwif = init_hwif_common_ali15x3;
#endif /* CONFIG_SPARC64 */ #endif /* CONFIG_SPARC64 */
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
/** /**
* ali15x3_scan_pcidev - check for ali pci ide * ali15x3_remove_one - called with an ALi is unplugged
* @dev: device found by IDE ordered scan * @dev: the device that was removed
* *
* If the device is a known ALi IDE controller we set it up and * Disconnect an ALi device that has been unplugged either by hotplug
* then return 1. If we do not know it, or set up fails we return 0 * or by a more civilized notification scheme. Not yet supported.
* and it will be offered to other drivers or taken generic
*/ */
int __init ali15x3_scan_pcidev (struct pci_dev *dev) static void ali15x3_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("ALi removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_AL) static struct pci_device_id alim15x3_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5229, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0, },
};
for (d = ali15x3_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "ALI15x3 IDE",
(d->device == dev->device)) && id_table: alim15x3_pci_tbl,
(d->init_setup)) { probe: alim15x3_init_one,
d->init_setup(dev, d); remove: __devexit_p(ali15x3_remove_one),
return 1; };
}
} static int ali15x3_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
}
static void ali15x3_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
} }
module_init(ali15x3_ide_init);
module_exit(ali15x3_ide_exit);
MODULE_AUTHOR("Michael Aubry, Andrzej Krzysztofowicz, CJ, Andre Hedrick, Alan Cox");
MODULE_DESCRIPTION("PCI driver module for ALi 15x3 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -25,18 +25,16 @@ static ide_pci_host_proc_t ali_procs[] __initdata = { ...@@ -25,18 +25,16 @@ static ide_pci_host_proc_t ali_procs[] __initdata = {
}; };
#endif /* DISPLAY_ALI_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_ALI_TIMINGS && CONFIG_PROC_FS */
static void init_setup_ali15x3(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_ali15x3(struct pci_dev *, const char *); static unsigned int init_chipset_ali15x3(struct pci_dev *, const char *);
static void init_hwif_common_ali15x3(ide_hwif_t *); static void init_hwif_common_ali15x3(ide_hwif_t *);
static void init_hwif_ali15x3(ide_hwif_t *); static void init_hwif_ali15x3(ide_hwif_t *);
static void init_dma_ali15x3(ide_hwif_t *, unsigned long); static void init_dma_ali15x3(ide_hwif_t *, unsigned long);
static ide_pci_device_t ali15x3_chipsets[] __initdata = { static ide_pci_device_t ali15x3_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_AL, vendor: PCI_VENDOR_ID_AL,
device: PCI_DEVICE_ID_AL_M5229, device: PCI_DEVICE_ID_AL_M5229,
name: "ALI15X3", name: "ALI15X3",
init_setup: init_setup_ali15x3,
init_chipset: init_chipset_ali15x3, init_chipset: init_chipset_ali15x3,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_ali15x3, init_hwif: init_hwif_ali15x3,
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -392,26 +393,60 @@ static void __init init_dma_amd74xx (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -392,26 +393,60 @@ static void __init init_dma_amd74xx (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_amd74xx (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit amd74xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &amd74xx_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
int __init amd74xx_scan_pcidev (struct pci_dev *dev) /**
* amd74xx_remove_one - called with an AMD IDE is unplugged
* @dev: the device that was removed
*
* Disconnect an AMD IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void amd74xx_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("AMD IDE removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_AMD) static struct pci_device_id amd74xx_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_COBRA_7401, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7409, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7411, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_OPUS_7441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ 0, },
};
static struct pci_driver driver = {
name: "AMD IDE",
id_table: amd74xx_pci_tbl,
probe: amd74xx_init_one,
remove: __devexit_p(amd74xx_remove_one),
};
static int amd74xx_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
for (d = amd74xx_chipsets; d && d->vendor && d->device; ++d) { static void amd74xx_ide_exit(void)
if (((d->vendor == dev->vendor) && {
(d->device == dev->device)) && ide_pci_unregister_driver(&driver);
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
} }
module_init(amd74xx_ide_init);
module_exit(amd74xx_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for AMD IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -25,17 +25,15 @@ static ide_pci_host_proc_t amd74xx_procs[] __initdata = { ...@@ -25,17 +25,15 @@ static ide_pci_host_proc_t amd74xx_procs[] __initdata = {
}; };
#endif /* defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) */ #endif /* defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_amd74xx(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_amd74xx(struct pci_dev *, const char *); static unsigned int init_chipset_amd74xx(struct pci_dev *, const char *);
static void init_hwif_amd74xx(ide_hwif_t *); static void init_hwif_amd74xx(ide_hwif_t *);
static void init_dma_amd74xx(ide_hwif_t *, unsigned long); static void init_dma_amd74xx(ide_hwif_t *, unsigned long);
static ide_pci_device_t amd74xx_chipsets[] __initdata = { static ide_pci_device_t amd74xx_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_AMD, vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_COBRA_7401, device: PCI_DEVICE_ID_AMD_COBRA_7401,
name: "AMD7401", name: "AMD7401",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx, init_chipset: init_chipset_amd74xx,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_amd74xx, init_hwif: init_hwif_amd74xx,
...@@ -45,11 +43,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = { ...@@ -45,11 +43,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0 extra: 0
},{ },{ /* 1 */
vendor: PCI_VENDOR_ID_AMD, vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_VIPER_7409, device: PCI_DEVICE_ID_AMD_VIPER_7409,
name: "AMD7409", name: "AMD7409",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx, init_chipset: init_chipset_amd74xx,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_amd74xx, init_hwif: init_hwif_amd74xx,
...@@ -59,11 +56,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = { ...@@ -59,11 +56,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0 extra: 0
},{ },{ /* 2 */
vendor: PCI_VENDOR_ID_AMD, vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_VIPER_7411, device: PCI_DEVICE_ID_AMD_VIPER_7411,
name: "AMD7411", name: "AMD7411",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx, init_chipset: init_chipset_amd74xx,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_amd74xx, init_hwif: init_hwif_amd74xx,
...@@ -73,11 +69,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = { ...@@ -73,11 +69,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0 extra: 0
},{ },{ /* 3 */
vendor: PCI_VENDOR_ID_AMD, vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_OPUS_7441, device: PCI_DEVICE_ID_AMD_OPUS_7441,
name: "AMD7441", name: "AMD7441",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx, init_chipset: init_chipset_amd74xx,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_amd74xx, init_hwif: init_hwif_amd74xx,
...@@ -87,11 +82,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = { ...@@ -87,11 +82,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0 extra: 0
},{ },{ /* 4 */
vendor: PCI_VENDOR_ID_AMD, vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_8111_IDE, device: PCI_DEVICE_ID_AMD_8111_IDE,
name: "AMD8111", name: "AMD8111",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx, init_chipset: init_chipset_amd74xx,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_amd74xx, init_hwif: init_hwif_amd74xx,
......
/* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 /* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16
* *
* linux/drivers/ide/cmd64x.c Version 1.22 June 9, 2000 * linux/drivers/ide/cmd64x.c Version 1.30 Sept 10, 2002
* *
* cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
* Note, this driver is not used at all on other systems because * Note, this driver is not used at all on other systems because
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -727,10 +728,12 @@ static void __init init_hwif_cmd64x (ide_hwif_t *hwif) ...@@ -727,10 +728,12 @@ static void __init init_hwif_cmd64x (ide_hwif_t *hwif)
if (dev->device == PCI_DEVICE_ID_CMD_643) if (dev->device == PCI_DEVICE_ID_CMD_643)
hwif->ultra_mask = 0x80; hwif->ultra_mask = 0x80;
if (dev->device == PCI_DEVICE_ID_CMD_646) if (dev->device == PCI_DEVICE_ID_CMD_646)
{
if (class_rev > 0x04) if (class_rev > 0x04)
hwif->ultra_mask = 0x07; hwif->ultra_mask = 0x07;
else else
hwif->ultra_mask = 0x80; hwif->ultra_mask = 0x80;
}
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
hwif->ide_dma_check = &cmd64x_config_drive_for_dma; hwif->ide_dma_check = &cmd64x_config_drive_for_dma;
...@@ -758,10 +761,6 @@ static void __init init_hwif_cmd64x (ide_hwif_t *hwif) ...@@ -758,10 +761,6 @@ static void __init init_hwif_cmd64x (ide_hwif_t *hwif)
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
} }
/**
* FIXME: not required ?
*/
static void __init init_dma_cmd64x (ide_hwif_t *hwif, unsigned long dmabase) static void __init init_dma_cmd64x (ide_hwif_t *hwif, unsigned long dmabase)
{ {
ide_setup_dma(hwif, dmabase, 8); ide_setup_dma(hwif, dmabase, 8);
...@@ -769,30 +768,59 @@ static void __init init_dma_cmd64x (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -769,30 +768,59 @@ static void __init init_dma_cmd64x (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static int __devinit cmd64x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &cmd64x_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
/** /**
* FIXME: not required either ? * cmd64x_remove_one - called with an CMD64x is unplugged
* @dev: the device that was removed
*
* Disconnect a CMD64x device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/ */
static void __init init_setup_cmd64x (struct pci_dev *dev, ide_pci_device_t *d) static void cmd64x_remove_one(struct pci_dev *dev)
{ {
ide_setup_pci_device(dev, d); panic("CMD64x removal not yet supported");
} }
int __init cmd64x_scan_pcidev (struct pci_dev *dev) static struct pci_device_id cmd64x_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_643, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ 0, },
};
static struct pci_driver driver = {
name: "CMD64x IDE",
id_table: cmd64x_pci_tbl,
probe: cmd64x_init_one,
remove: __devexit_p(cmd64x_remove_one),
};
static int cmd64x_ide_init(void)
{ {
ide_pci_device_t *d; return ide_pci_register_driver(&driver);
}
if (dev->vendor != PCI_VENDOR_ID_CMD)
return 0;
for (d = cmd64x_chipsets; d && d->vendor && d->device; ++d) { static void cmd64x_ide_exit(void)
if (((d->vendor == dev->vendor) && {
(d->device == dev->device)) && ide_pci_unregister_driver(&driver);
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
} }
module_init(cmd64x_ide_init);
module_exit(cmd64x_ide_exit);
MODULE_AUTHOR("Eddie Dost, David Miller, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for CMD64x IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -79,17 +79,15 @@ static ide_pci_host_proc_t cmd64x_procs[] __initdata = { ...@@ -79,17 +79,15 @@ static ide_pci_host_proc_t cmd64x_procs[] __initdata = {
}; };
#endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */ #endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_cmd64x(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_cmd64x(struct pci_dev *, const char *); static unsigned int init_chipset_cmd64x(struct pci_dev *, const char *);
static void init_hwif_cmd64x(ide_hwif_t *); static void init_hwif_cmd64x(ide_hwif_t *);
static void init_dma_cmd64x(ide_hwif_t *, unsigned long); static void init_dma_cmd64x(ide_hwif_t *, unsigned long);
static ide_pci_device_t cmd64x_chipsets[] __initdata = { static ide_pci_device_t cmd64x_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_CMD, vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_643, device: PCI_DEVICE_ID_CMD_643,
name: "CMD643", name: "CMD643",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x, init_chipset: init_chipset_cmd64x,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_cmd64x, init_hwif: init_hwif_cmd64x,
...@@ -99,11 +97,10 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = { ...@@ -99,11 +97,10 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 1 */
vendor: PCI_VENDOR_ID_CMD, vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_646, device: PCI_DEVICE_ID_CMD_646,
name: "CMD646", name: "CMD646",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x, init_chipset: init_chipset_cmd64x,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_cmd64x, init_hwif: init_hwif_cmd64x,
...@@ -113,11 +110,10 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = { ...@@ -113,11 +110,10 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x51,0x80,0x80}}, enablebits: {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 2 */
vendor: PCI_VENDOR_ID_CMD, vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_648, device: PCI_DEVICE_ID_CMD_648,
name: "CMD648", name: "CMD648",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x, init_chipset: init_chipset_cmd64x,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_cmd64x, init_hwif: init_hwif_cmd64x,
...@@ -131,7 +127,6 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = { ...@@ -131,7 +127,6 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = {
vendor: PCI_VENDOR_ID_CMD, vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_649, device: PCI_DEVICE_ID_CMD_649,
name: "CMD649", name: "CMD649",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x, init_chipset: init_chipset_cmd64x,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_cmd64x, init_hwif: init_hwif_cmd64x,
......
/* /*
* linux/drivers/ide/cs5530.c Version 0.6 Mar. 18, 2000 * linux/drivers/ide/cs5530.c Version 0.7 Sept 10, 2002
* *
* Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org> * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org>
* Ditto of GNU General Public License. * Ditto of GNU General Public License.
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -419,44 +420,56 @@ static void __init init_dma_cs5530 (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -419,44 +420,56 @@ static void __init init_dma_cs5530 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
/**
* init_setup_cs5530 - set up a CS5530 IDE static int __devinit cs5530_init_one(struct pci_dev *dev, const struct pci_device_id *id)
* @dev: PCI device
* @d: PCI ide device info
*
* FIXME: this function can go away too
*/
static void __init init_setup_cs5530 (struct pci_dev *dev, ide_pci_device_t *d)
{ {
ide_pci_device_t *d = &cs5530_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
/** /**
* cs5530_scan_pcidev - set up any CS5530 device * cs5530_remove_one - called when a CS5530 is unplugged
* @dev: pci device to check * @dev: the device that was removed
* *
* Check if the device is a 5530 IDE controller. If it is then * Disconnect an Cyrix device that has been unplugged either by hotplug
* claim and set up the interface. Return 1 if we claimed the * or by a more civilized notification scheme. Not yet supported.
* interface or zero if it is not ours
*/ */
int __init cs5530_scan_pcidev (struct pci_dev *dev) static void cs5530_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("Cyrix removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_CYRIX) static struct pci_device_id cs5530_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = cs5530_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "CS5530 IDE",
(d->device == dev->device)) && id_table: cs5530_pci_tbl,
(d->init_setup)) { probe: cs5530_init_one,
d->init_setup(dev, d); remove: __devexit_p(cs5530_remove_one),
return 1; };
}
} static int cs5530_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
} }
static void cs5530_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(cs5530_ide_init);
module_exit(cs5530_ide_exit);
MODULE_AUTHOR("Mark Lord");
MODULE_DESCRIPTION("PCI driver module for Cyrix/NS 5530 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -25,17 +25,15 @@ static ide_pci_host_proc_t cs5530_procs[] __initdata = { ...@@ -25,17 +25,15 @@ static ide_pci_host_proc_t cs5530_procs[] __initdata = {
}; };
#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */
static void init_setup_cs5530(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_cs5530(struct pci_dev *, const char *); static unsigned int init_chipset_cs5530(struct pci_dev *, const char *);
static void init_hwif_cs5530(ide_hwif_t *); static void init_hwif_cs5530(ide_hwif_t *);
static void init_dma_cs5530(ide_hwif_t *, unsigned long); static void init_dma_cs5530(ide_hwif_t *, unsigned long);
static ide_pci_device_t cs5530_chipsets[] __initdata = { static ide_pci_device_t cs5530_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_CYRIX, vendor: PCI_VENDOR_ID_CYRIX,
device: PCI_DEVICE_ID_CYRIX_5530_IDE, device: PCI_DEVICE_ID_CYRIX_5530_IDE,
name: "CS5530", name: "CS5530",
init_setup: init_setup_cs5530,
init_chipset: init_chipset_cs5530, init_chipset: init_chipset_cs5530,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_cs5530, init_hwif: init_hwif_cs5530,
......
/* /*
* linux/drivers/ide/cy82c693.c Version 0.34 Dec. 13, 1999 * linux/drivers/ide/cy82c693.c Version 0.40 Sep. 10, 2002
* *
* Copyright (C) 1998-2000 Andreas S. Krebs (akrebs@altavista.net), Maintainer * Copyright (C) 1998-2000 Andreas S. Krebs (akrebs@altavista.net), Maintainer
* Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>, Integrater * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>, Integrater
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
* - first tests with DMA look okay, they seem to work, but there is a * - first tests with DMA look okay, they seem to work, but there is a
* problem with sound - the BusMaster IDE TimeOut should fixed this * problem with sound - the BusMaster IDE TimeOut should fixed this
* *
* * Ancient History:
* History:
* AMH@1999-08-24: v0.34 init_cy82c693_chip moved to pci_init_cy82c693 * AMH@1999-08-24: v0.34 init_cy82c693_chip moved to pci_init_cy82c693
* ASK@1999-01-23: v0.33 made a few minor code clean ups * ASK@1999-01-23: v0.33 made a few minor code clean ups
* removed DMA clock speed setting by default * removed DMA clock speed setting by default
...@@ -46,6 +45,7 @@ ...@@ -46,6 +45,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -418,29 +418,56 @@ void __init init_dma_cy82c693 (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -418,29 +418,56 @@ void __init init_dma_cy82c693 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
void __init init_setup_cy82c693 (struct pci_dev *dev, ide_pci_device_t *d) static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &cy82c693_chipsets[id->driver_data];
if ((!(PCI_FUNC(dev->devfn) & 1) || if ((!(PCI_FUNC(dev->devfn) & 1) ||
(!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE)))) (!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE))))
return; /* CY82C693 is more than only a IDE controller */ return 0; /* CY82C693 is more than only a IDE controller */
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
int __init cy82c693_scan_pcidev (struct pci_dev *dev) /**
* cy82c693_remove_one - called with an Cypress is unplugged
* @dev: the device that was removed
*
* Disconnect an Cypress device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void cy82c693_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("Cypress removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_CONTAQ) static struct pci_device_id cy82c693_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = cy82c693_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "Cypress IDE",
(d->device == dev->device)) && id_table: cy82c693_pci_tbl,
(d->init_setup)) { probe: cy82c693_init_one,
d->init_setup(dev, d); remove: __devexit_p(cy82c693_remove_one),
return 1; };
}
} static int cy82c693_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
} }
static void cy82c693_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(cy82c693_ide_init);
module_exit(cy82c693_ide_exit);
MODULE_AUTHOR("Andreas Krebs, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for the Cypress CY82C693 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -64,17 +64,15 @@ typedef struct pio_clocks_s { ...@@ -64,17 +64,15 @@ typedef struct pio_clocks_s {
u8 time_8; /* clocks for 8bit (0xF0=Active/data, 0x0F=Recovery) */ u8 time_8; /* clocks for 8bit (0xF0=Active/data, 0x0F=Recovery) */
} pio_clocks_t; } pio_clocks_t;
extern void init_setup_cy82c693(struct pci_dev *, ide_pci_device_t *);
extern unsigned int init_chipset_cy82c693(struct pci_dev *, const char *); extern unsigned int init_chipset_cy82c693(struct pci_dev *, const char *);
extern void init_hwif_cy82c693(ide_hwif_t *); extern void init_hwif_cy82c693(ide_hwif_t *);
extern void init_dma_cy82c693(ide_hwif_t *, unsigned long); extern void init_dma_cy82c693(ide_hwif_t *, unsigned long);
static ide_pci_device_t cy82c693_chipsets[] __initdata = { static ide_pci_device_t cy82c693_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_CONTAQ, vendor: PCI_VENDOR_ID_CONTAQ,
device: PCI_DEVICE_ID_CONTAQ_82C693, device: PCI_DEVICE_ID_CONTAQ_82C693,
name: "CY82C693", name: "CY82C693",
init_setup: init_setup_cy82c693,
init_chipset: init_chipset_cy82c693, init_chipset: init_chipset_cy82c693,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_cy82c693, init_hwif: init_hwif_cy82c693,
......
/* /*
* linux/drivers/ide/pci-orphan.c Version 0.01 December 8, 1997 * linux/drivers/ide/generic.c Version 0.10 Sept 11, 2002
* *
* Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org>
*/ */
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */ #include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */
#include <linux/types.h> #include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/timer.h> #include <linux/timer.h>
...@@ -84,19 +85,10 @@ static void __init init_setup_unknown (struct pci_dev *dev, ide_pci_device_t *d) ...@@ -84,19 +85,10 @@ static void __init init_setup_unknown (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
int __init generic_scan_pcidev (struct pci_dev *dev) #if 0
{
ide_pci_device_t *d;
for (d = generic_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
/* Logic to add back later on */
if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) { if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
ide_pci_device_t *unknown = unknown_chipset; ide_pci_device_t *unknown = unknown_chipset;
// unknown->vendor = dev->vendor; // unknown->vendor = dev->vendor;
...@@ -105,5 +97,75 @@ int __init generic_scan_pcidev (struct pci_dev *dev) ...@@ -105,5 +97,75 @@ int __init generic_scan_pcidev (struct pci_dev *dev)
return 1; return 1;
} }
return 0; return 0;
#endif
/**
* generic_init_one - called when a PIIX is found
* @dev: the generic device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &generic_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
} }
/**
* generic_remove_one - called when PCI IDE is unplugged
* @dev: the device that was removed
*
* Disconnect an IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void generic_remove_one(struct pci_dev *dev)
{
panic("PCI IDE removal not yet supported");
}
static struct pci_device_id generic_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_HOLTEK, PCI_DEVICE_ID_HOLTEK_6565, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8673F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
{ PCI_VENDOR_ID_HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7},
{ PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C558, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8},
{ 0, },
};
static struct pci_driver driver = {
name: "PCI IDE",
id_table: generic_pci_tbl,
probe: generic_init_one,
remove: __devexit_p(generic_remove_one),
};
static int generic_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void generic_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(generic_ide_init);
module_exit(generic_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for generic PCI IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -11,7 +11,7 @@ static void init_hwif_generic(ide_hwif_t *); ...@@ -11,7 +11,7 @@ static void init_hwif_generic(ide_hwif_t *);
static void init_dma_generic(ide_hwif_t *, unsigned long); static void init_dma_generic(ide_hwif_t *, unsigned long);
static ide_pci_device_t generic_chipsets[] __initdata = { static ide_pci_device_t generic_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_NS, vendor: PCI_VENDOR_ID_NS,
device: PCI_DEVICE_ID_NS_87410, device: PCI_DEVICE_ID_NS_87410,
name: "NS87410", name: "NS87410",
...@@ -25,7 +25,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = { ...@@ -25,7 +25,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, enablebits: {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 1 */
vendor: PCI_VENDOR_ID_PCTECH, vendor: PCI_VENDOR_ID_PCTECH,
device: PCI_DEVICE_ID_PCTECH_SAMURAI_IDE, device: PCI_DEVICE_ID_PCTECH_SAMURAI_IDE,
name: "SAMURAI", name: "SAMURAI",
...@@ -39,7 +39,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = { ...@@ -39,7 +39,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 2 */
vendor: PCI_VENDOR_ID_HOLTEK, vendor: PCI_VENDOR_ID_HOLTEK,
device: PCI_DEVICE_ID_HOLTEK_6565, device: PCI_DEVICE_ID_HOLTEK_6565,
name: "HT6565", name: "HT6565",
...@@ -53,7 +53,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = { ...@@ -53,7 +53,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 3 */
vendor: PCI_VENDOR_ID_UMC, vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8673F, device: PCI_DEVICE_ID_UMC_UM8673F,
name: "UM8673F", name: "UM8673F",
...@@ -67,7 +67,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = { ...@@ -67,7 +67,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 4 */
vendor: PCI_VENDOR_ID_UMC, vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8886A, device: PCI_DEVICE_ID_UMC_UM8886A,
name: "UM8886A", name: "UM8886A",
...@@ -81,7 +81,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = { ...@@ -81,7 +81,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 5 */
vendor: PCI_VENDOR_ID_UMC, vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8886BF, device: PCI_DEVICE_ID_UMC_UM8886BF,
name: "UM8886BF", name: "UM8886BF",
...@@ -95,7 +95,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = { ...@@ -95,7 +95,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 6 */
vendor: PCI_VENDOR_ID_HINT, vendor: PCI_VENDOR_ID_HINT,
device: PCI_DEVICE_ID_HINT_VXPROII_IDE, device: PCI_DEVICE_ID_HINT_VXPROII_IDE,
name: "HINT_IDE", name: "HINT_IDE",
...@@ -109,7 +109,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = { ...@@ -109,7 +109,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 7 */
vendor: PCI_VENDOR_ID_VIA, vendor: PCI_VENDOR_ID_VIA,
device: PCI_DEVICE_ID_VIA_82C561, device: PCI_DEVICE_ID_VIA_82C561,
name: "VIA_IDE", name: "VIA_IDE",
...@@ -123,7 +123,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = { ...@@ -123,7 +123,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 8 */
vendor: PCI_VENDOR_ID_OPTI, vendor: PCI_VENDOR_ID_OPTI,
device: PCI_DEVICE_ID_OPTI_82C558, device: PCI_DEVICE_ID_OPTI_82C558,
name: "OPTI621V", name: "OPTI621V",
...@@ -146,7 +146,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = { ...@@ -146,7 +146,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
}; };
static ide_pci_device_t unknown_chipset[] __initdata = { static ide_pci_device_t unknown_chipset[] __initdata = {
{ { /* 0 */
vendor: 0, vendor: 0,
device: 0, device: 0,
name: "PCI_IDE", name: "PCI_IDE",
......
/* /*
* linux/drivers/ide/hpt34x.c Version 0.31 June. 9, 2000 * linux/drivers/ide/hpt34x.c Version 0.40 Sept 10, 2002
* *
* Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org>
* May be copied or modified under the terms of the GNU General Public License * May be copied or modified under the terms of the GNU General Public License
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -321,34 +322,61 @@ static void __init init_dma_hpt34x (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -321,34 +322,61 @@ static void __init init_dma_hpt34x (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_hpt34x (struct pci_dev *dev, ide_pci_device_t *d) static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
char *chipset_names[] = {"HPT343", "HPT345"}; ide_pci_device_t *d = &hpt34x_chipsets[id->driver_data];
static char *chipset_names[] = {"HPT343", "HPT345"};
u16 pcicmd = 0; u16 pcicmd = 0;
pci_read_config_word(dev, PCI_COMMAND, &pcicmd); pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
strcpy(d->name, chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0]); d->name = chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0];
d->bootable = (pcicmd & PCI_COMMAND_MEMORY) ? OFF_BOARD : NEVER_BOARD; d->bootable = (pcicmd & PCI_COMMAND_MEMORY) ? OFF_BOARD : NEVER_BOARD;
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
int __init hpt34x_scan_pcidev (struct pci_dev *dev) /**
* hpt34x_remove_one - called with an hpt34x is unplugged
* @dev: the device that was removed
*
* Disconnect an hpt34x device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void hpt34x_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("hpt34x removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_TTI) static struct pci_device_id hpt34x_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT343, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = hpt34x_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "HPT34x IDE",
(d->device == dev->device)) && id_table: hpt34x_pci_tbl,
(d->init_setup)) { probe: hpt34x_init_one,
d->init_setup(dev, d); remove: __devexit_p(hpt34x_remove_one),
return 1; };
}
} static int hpt34x_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
} }
static void hpt34x_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(hpt34x_ide_init);
module_exit(hpt34x_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for Highpoint 34x IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -31,17 +31,15 @@ static ide_pci_host_proc_t hpt34x_procs[] __initdata = { ...@@ -31,17 +31,15 @@ static ide_pci_host_proc_t hpt34x_procs[] __initdata = {
}; };
#endif /* defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) */ #endif /* defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_hpt34x(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_hpt34x(struct pci_dev *, const char *); static unsigned int init_chipset_hpt34x(struct pci_dev *, const char *);
static void init_hwif_hpt34x(ide_hwif_t *); static void init_hwif_hpt34x(ide_hwif_t *);
static void init_dma_hpt34x(ide_hwif_t *, unsigned long); static void init_dma_hpt34x(ide_hwif_t *, unsigned long);
static ide_pci_device_t hpt34x_chipsets[] __initdata = { static ide_pci_device_t hpt34x_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_TTI, vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT343, device: PCI_DEVICE_ID_TTI_HPT343,
name: "HPT34X", name: "HPT34X",
init_setup: init_setup_hpt34x,
init_chipset: init_chipset_hpt34x, init_chipset: init_chipset_hpt34x,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_hpt34x, init_hwif: init_hwif_hpt34x,
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/timer.h> #include <linux/timer.h>
...@@ -1167,23 +1168,70 @@ static void __init init_setup_hpt366 (struct pci_dev *dev, ide_pci_device_t *d) ...@@ -1167,23 +1168,70 @@ static void __init init_setup_hpt366 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
int __init hpt366_scan_pcidev (struct pci_dev *dev)
{
ide_pci_device_t *d;
if (dev->vendor != PCI_VENDOR_ID_TTI) /**
return 0; * hpt366_init_one - called when an HPT366 is found
if (dev->device == PCI_DEVICE_ID_TTI_HPT343) * @dev: the hpt366 device
return 0; * @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &hpt366_chipsets[id->driver_data];
for (d = hpt366_chipsets; d && d->vendor && d->device; ++d) { if (dev->device != d->device)
if (((d->vendor == dev->vendor) && BUG();
(d->device == dev->device)) && d->init_setup(dev, d);
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0; return 0;
} }
/**
* hpt366_remove_one - called when an HPT366 is unplugged
* @dev: the device that was removed
*
* Disconnect a HPT366 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void hpt366_remove_one(struct pci_dev *dev)
{
panic("HPT366 removal not yet supported");
}
static struct pci_device_id hpt366_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT302, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT374, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
{ 0, },
};
static struct pci_driver driver = {
name: "HPT366 IDE",
id_table: hpt366_pci_tbl,
probe: hpt366_init_one,
remove: __devexit_p(hpt366_remove_one),
};
static int hpt366_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void hpt366_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(hpt366_ide_init);
module_exit(hpt366_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for Highpoint HPT366 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -442,7 +442,7 @@ static void init_hwif_hpt366(ide_hwif_t *); ...@@ -442,7 +442,7 @@ static void init_hwif_hpt366(ide_hwif_t *);
static void init_dma_hpt366(ide_hwif_t *, unsigned long); static void init_dma_hpt366(ide_hwif_t *, unsigned long);
static ide_pci_device_t hpt366_chipsets[] __initdata = { static ide_pci_device_t hpt366_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_TTI, vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT366, device: PCI_DEVICE_ID_TTI_HPT366,
name: "HPT366", name: "HPT366",
...@@ -456,7 +456,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = { ...@@ -456,7 +456,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD, bootable: OFF_BOARD,
extra: 240 extra: 240
},{ },{ /* 1 */
vendor: PCI_VENDOR_ID_TTI, vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT372, device: PCI_DEVICE_ID_TTI_HPT372,
name: "HPT372A", name: "HPT372A",
...@@ -470,7 +470,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = { ...@@ -470,7 +470,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD, bootable: OFF_BOARD,
extra: 0 extra: 0
},{ },{ /* 2 */
vendor: PCI_VENDOR_ID_TTI, vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT302, device: PCI_DEVICE_ID_TTI_HPT302,
name: "HPT302", name: "HPT302",
...@@ -484,7 +484,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = { ...@@ -484,7 +484,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD, bootable: OFF_BOARD,
extra: 0 extra: 0
},{ },{ /* 3 */
vendor: PCI_VENDOR_ID_TTI, vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT371, device: PCI_DEVICE_ID_TTI_HPT371,
name: "HPT371", name: "HPT371",
...@@ -498,7 +498,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = { ...@@ -498,7 +498,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD, bootable: OFF_BOARD,
extra: 0 extra: 0
},{ },{ /* 4 */
vendor: PCI_VENDOR_ID_TTI, vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT374, device: PCI_DEVICE_ID_TTI_HPT374,
name: "HPT374", name: "HPT374",
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/ioport.h> #include <linux/ioport.h>
...@@ -297,29 +298,56 @@ static void __init init_dma_it8172 (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -297,29 +298,56 @@ static void __init init_dma_it8172 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_it8172 (struct pci_dev *dev, ide_pci_device_t *d) static int __devinit it8172_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &it8172_chipsets[id->driver_data];
if ((!(PCI_FUNC(dev->devfn) & 1) || if ((!(PCI_FUNC(dev->devfn) & 1) ||
(!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE)))) (!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE))))
return; /* IT8172 is more than only a IDE controller */ return 0; /* IT8172 is more than only a IDE controller */
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
static int __init it8172_scan_pcidev (struct pci_dev *dev) /**
* it8172_remove_one - called with an IT8172 is unplugged
* @dev: the device that was removed
*
* Disconnect an IT8172 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void it8172_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("IT8172 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_ITE) static struct pci_device_id it8172_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_IT8172G, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = it8172_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "IT8172IDE",
(d->device == dev->device)) && id_table: it8172_pci_tbl,
(d->init_setup)) { probe: it8172_init_one,
d->init_setup(dev, d); remove: __devexit_p(it8172_remove_one),
return 1; };
}
} static int it8172_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
} }
static void it8172_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(it8172_ide_init);
module_exit(it8172_ide_exit);
MODULE_AUTHOR("SteveL@mvista.com");
MODULE_DESCRIPTION("PCI driver module for ITE 8172 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -20,7 +20,7 @@ static void init_hwif_it8172(ide_hwif_t *); ...@@ -20,7 +20,7 @@ static void init_hwif_it8172(ide_hwif_t *);
static void init_dma_it8172(ide_hwif_t *, unsigned long); static void init_dma_it8172(ide_hwif_t *, unsigned long);
static ide_pci_device_t it8172_chipsets[] __initdata = { static ide_pci_device_t it8172_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_ITE, vendor: PCI_VENDOR_ID_ITE,
device: PCI_DEVICE_ID_ITE_IT8172G, device: PCI_DEVICE_ID_ITE_IT8172G,
name: "IT8172G", name: "IT8172G",
......
/* /*
* linux/drivers/ide/ns87415.c Version 1.01 Mar. 18, 2000 * linux/drivers/ide/ns87415.c Version 2.00 Sep. 10, 2002
* *
* Copyright (C) 1997-1998 Mark Lord <mlord@pobox.com> * Copyright (C) 1997-1998 Mark Lord <mlord@pobox.com>
* Copyright (C) 1998 Eddie C. Dost <ecd@skynet.be> * Copyright (C) 1998 Eddie C. Dost <ecd@skynet.be>
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/timer.h> #include <linux/timer.h>
...@@ -229,26 +230,55 @@ static void __init init_dma_ns87415 (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -229,26 +230,55 @@ static void __init init_dma_ns87415 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_ns87415 (struct pci_dev *dev, ide_pci_device_t *d) static int __devinit ns87415_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &ns87415_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
int __init ns87415_scan_pcidev (struct pci_dev *dev) /**
* ns87415_remove_one - called with an NS87415 is unplugged
* @dev: the device that was removed
*
* Disconnect an NS87415 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void ns87415_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("NS87415 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_NS) static struct pci_device_id ns87415_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = ns87415_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "NS87415IDE",
(d->device == dev->device)) && id_table: ns87415_pci_tbl,
(d->init_setup)) { probe: ns87415_init_one,
d->init_setup(dev, d); remove: __devexit_p(ns87415_remove_one),
return 1; };
}
} static int ns87415_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
} }
static void ns87415_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(ns87415_ide_init);
module_exit(ns87415_ide_exit);
MODULE_AUTHOR("Mark Lord, Eddie Dost, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for NS87415 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -5,16 +5,14 @@ ...@@ -5,16 +5,14 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ide.h> #include <linux/ide.h>
static void init_setup_ns87415(struct pci_dev *, ide_pci_device_t *);
static void init_hwif_ns87415(ide_hwif_t *); static void init_hwif_ns87415(ide_hwif_t *);
static void init_dma_ns87415(ide_hwif_t *, unsigned long); static void init_dma_ns87415(ide_hwif_t *, unsigned long);
static ide_pci_device_t ns87415_chipsets[] __initdata = { static ide_pci_device_t ns87415_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_NS, vendor: PCI_VENDOR_ID_NS,
device: PCI_DEVICE_ID_NS_87415, device: PCI_DEVICE_ID_NS_87415,
name: "NS87415", name: "NS87415",
init_setup: init_setup_ns87415,
init_chipset: NULL, init_chipset: NULL,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_ns87415, init_hwif: init_hwif_ns87415,
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -91,8 +92,8 @@ static u8 nforce_ratemask (ide_drive_t *drive) ...@@ -91,8 +92,8 @@ static u8 nforce_ratemask (ide_drive_t *drive)
*/ */
static int nforce_tune_chipset (ide_drive_t *drive, u8 xferspeed) static int nforce_tune_chipset (ide_drive_t *drive, u8 xferspeed)
{ {
u8 drive_pci[] = { 0x63, 0x62, 0x61, 0x60 }; static const u8 drive_pci[] = { 0x63, 0x62, 0x61, 0x60 };
u8 drive_pci2[] = { 0x5b, 0x5a, 0x59, 0x58 }; static const u8 drive_pci2[] = { 0x5b, 0x5a, 0x59, 0x58 };
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
...@@ -336,27 +337,55 @@ static void __init init_dma_nforce (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -336,27 +337,55 @@ static void __init init_dma_nforce (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
/* FIXME - not needed */ static int __devinit nforce_init_one(struct pci_dev *dev, const struct pci_device_id *id)
static void __init init_setup_nforce (struct pci_dev *dev, ide_pci_device_t *d)
{ {
ide_pci_device_t *d = &nvidia_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
int __init nforce_scan_pcidev (struct pci_dev *dev) /**
* nforce_remove_one - called with an nForce is unplugged
* @dev: the device that was removed
*
* Disconnect an nForce device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void nforce_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("nForce removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_NVIDIA) static struct pci_device_id nforce_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = nvidia_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "nForce IDE",
(d->device == dev->device)) && id_table: nforce_pci_tbl,
(d->init_setup)) { probe: nforce_init_one,
d->init_setup(dev, d); remove: __devexit_p(nforce_remove_one),
return 1; };
}
} static int nforce_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
}
static void nforce_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
} }
module_init(nforce_ide_init);
module_exit(nforce_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for nVidia nForce IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -25,7 +25,6 @@ static ide_pci_host_proc_t nforce_procs[] __initdata = { ...@@ -25,7 +25,6 @@ static ide_pci_host_proc_t nforce_procs[] __initdata = {
}; };
#endif /* defined(DISPLAY_NFORCE_TIMINGS) && defined(CONFIG_PROC_FS) */ #endif /* defined(DISPLAY_NFORCE_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_nforce(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_nforce(struct pci_dev *, const char *); static unsigned int init_chipset_nforce(struct pci_dev *, const char *);
static void init_hwif_nforce(ide_hwif_t *); static void init_hwif_nforce(ide_hwif_t *);
static void init_dma_nforce(ide_hwif_t *, unsigned long); static void init_dma_nforce(ide_hwif_t *, unsigned long);
...@@ -35,7 +34,6 @@ static ide_pci_device_t nvidia_chipsets[] __initdata = { ...@@ -35,7 +34,6 @@ static ide_pci_device_t nvidia_chipsets[] __initdata = {
vendor: PCI_VENDOR_ID_NVIDIA, vendor: PCI_VENDOR_ID_NVIDIA,
device: PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, device: PCI_DEVICE_ID_NVIDIA_NFORCE_IDE,
name: "NFORCE", name: "NFORCE",
init_setup: init_setup_nforce,
init_chipset: init_chipset_nforce, init_chipset: init_chipset_nforce,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_nforce, init_hwif: init_hwif_nforce,
...@@ -45,12 +43,8 @@ static ide_pci_device_t nvidia_chipsets[] __initdata = { ...@@ -45,12 +43,8 @@ static ide_pci_device_t nvidia_chipsets[] __initdata = {
enablebits: {{0x50,0x01,0x01}, {0x50,0x02,0x02}}, enablebits: {{0x50,0x01,0x01}, {0x50,0x02,0x02}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{
vendor: 0,
device: 0,
channels: 0,
bootable: EOL,
} }
}; };
#endif /* NFORCE_H */ #endif /* NFORCE_H */
/* /*
* linux/drivers/ide/opti621.c Version 0.6 Jan 02, 1999 * linux/drivers/ide/opti621.c Version 0.7 Sept 10, 2002
* *
* Copyright (C) 1996-1998 Linus Torvalds & authors (see below) * Copyright (C) 1996-1998 Linus Torvalds & authors (see below)
*/ */
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
#define OPTI621_DEBUG /* define for debug messages */ #define OPTI621_DEBUG /* define for debug messages */
#include <linux/types.h> #include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/timer.h> #include <linux/timer.h>
...@@ -363,21 +364,56 @@ static void __init init_setup_opti621 (struct pci_dev *dev, ide_pci_device_t *d) ...@@ -363,21 +364,56 @@ static void __init init_setup_opti621 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
int __init opti621_scan_pcidev (struct pci_dev *dev) static int __devinit opti621_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d; ide_pci_device_t *d = &opti621_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
if (dev->vendor != PCI_VENDOR_ID_OPTI) /**
return 0; * opti621_remove_one - called with an Opti621 is unplugged
* @dev: the device that was removed
*
* Disconnect an Opti621 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void opti621_remove_one(struct pci_dev *dev)
{
panic("Opti621 removal not yet supported");
}
for (d = opti621_chipsets; d && d->vendor && d->device; ++d) { static struct pci_device_id opti621_pci_tbl[] __devinitdata = {
if (((d->vendor == dev->vendor) && { PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
(d->device == dev->device)) && { PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
(d->init_setup)) { { 0, },
d->init_setup(dev, d); };
return 1;
} static struct pci_driver driver = {
} name: "Opti621 IDE",
return 0; id_table: opti621_pci_tbl,
probe: opti621_init_one,
remove: __devexit_p(opti621_remove_one),
};
static int opti621_ide_init(void)
{
return ide_pci_register_driver(&driver);
} }
static void opti621_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(opti621_ide_init);
module_exit(opti621_ide_exit);
MODULE_AUTHOR("Jaromir Koutek, Jan Harkes, Mark Lord");
MODULE_DESCRIPTION("PCI driver module for Opti621 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -10,7 +10,7 @@ static void init_hwif_opti621(ide_hwif_t *); ...@@ -10,7 +10,7 @@ static void init_hwif_opti621(ide_hwif_t *);
static void init_dma_opti621(ide_hwif_t *, unsigned long); static void init_dma_opti621(ide_hwif_t *, unsigned long);
static ide_pci_device_t opti621_chipsets[] __initdata = { static ide_pci_device_t opti621_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_OPTI, vendor: PCI_VENDOR_ID_OPTI,
device: PCI_DEVICE_ID_OPTI_82C621, device: PCI_DEVICE_ID_OPTI_82C621,
name: "OPTI621", name: "OPTI621",
...@@ -24,7 +24,7 @@ static ide_pci_device_t opti621_chipsets[] __initdata = { ...@@ -24,7 +24,7 @@ static ide_pci_device_t opti621_chipsets[] __initdata = {
enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 1 */
vendor: PCI_VENDOR_ID_OPTI, vendor: PCI_VENDOR_ID_OPTI,
device: PCI_DEVICE_ID_OPTI_82C825, device: PCI_DEVICE_ID_OPTI_82C825,
name: "OPTI621X", name: "OPTI621X",
......
/* /*
* linux/drivers/ide/pdcadma.c Version 0.01 June 21, 2001 * linux/drivers/ide/pdcadma.c Version 0.05 Sept 10, 2002
* *
* Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org> * Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org>
* May be copied or modified under the terms of the GNU General Public License * May be copied or modified under the terms of the GNU General Public License
...@@ -127,26 +127,55 @@ static void __init init_dma_pdcadma (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -127,26 +127,55 @@ static void __init init_dma_pdcadma (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_pdcadma (struct pci_dev *dev, ide_pci_device_t *d) static int __devinit pdcadma_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &pdcadma_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 1;
} }
int __init pdcadma_scan_pcidev (struct pci_dev *dev) /**
* pdcadma_remove_one - called when a PDCADMA is unplugged
* @dev: the device that was removed
*
* Disconnect a PDCADMA device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void pdcadma_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("PDCADMA removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_PDC)
return 0; static struct pci_device_id pdcadma_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_PDC, PCI_DEVICE_ID_PDC_1841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
for (d = pdcadma_chipsets; d && d->vendor && d->device; ++d) { { 0, },
if (((d->vendor == dev->vendor) && };
(d->device == dev->device)) &&
(d->init_setup)) { static struct pci_driver driver = {
d->init_setup(dev, d); name: "PDCADMA-IDE",
return 1; id_table: pdcadma_pci_tbl,
} probe: pdcadma_init_one,
} remove: __devexit_p(pdcadma_remove_one),
return 0; };
static int pdcadma_ide_init(void)
{
return ide_pci_register_driver(&driver);
} }
static void pdcadma_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(pdcadma_ide_init);
module_exit(pdcadma_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for PDCADMA IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -31,7 +31,7 @@ static void init_hwif_pdcadma(ide_hwif_t *); ...@@ -31,7 +31,7 @@ static void init_hwif_pdcadma(ide_hwif_t *);
static void init_dma_pdcadma(ide_hwif_t *, unsigned long); static void init_dma_pdcadma(ide_hwif_t *, unsigned long);
static ide_pci_device_t pdcadma_chipsets[] __initdata = { static ide_pci_device_t pdcadma_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_PDC, vendor: PCI_VENDOR_ID_PDC,
device: PCI_DEVICE_ID_PDC_1841, device: PCI_DEVICE_ID_PDC_1841,
name: "PDCADMA", name: "PDCADMA",
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -664,29 +665,79 @@ static void __init init_setup_piix (struct pci_dev *dev, ide_pci_device_t *d) ...@@ -664,29 +665,79 @@ static void __init init_setup_piix (struct pci_dev *dev, ide_pci_device_t *d)
} }
/** /**
* piix_scan_pcidev - Check for and initialize PIIX IDE * piix_init_one - called when a PIIX is found
* @dev: PCI device to check * @dev: the piix device
* @id: the matching pci id
* *
* Checks if the passed device is an Intel PIIX device. If so the * Called when the PCI registration layer (or the IDE initialization)
* hardware is initialized and we return 1 to claim the device. If not * finds a device matching our IDE device tables.
* we return 0.
*/ */
int __init piix_scan_pcidev (struct pci_dev *dev) static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d; ide_pci_device_t *d = &piix_pci_info[id->driver_data];
if (dev->vendor != PCI_VENDOR_ID_INTEL) if (dev->device != d->device)
return 0; BUG();
d->init_setup(dev, d);
for (d = piix_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0; return 0;
} }
/**
* piix_remove_one - called with a PIIX is unplugged
* @dev: the device that was removed
*
* Disconnect a PIIX device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void piix_remove_one(struct pci_dev *dev)
{
panic("PIIX removal not yet supported");
}
static struct pci_device_id piix_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371MX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82372FB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_11,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_11,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_11, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
{ 0, },
};
static struct pci_driver driver = {
name: "PIIX IDE",
id_table: piix_pci_tbl,
probe: piix_init_one,
remove: __devexit_p(piix_remove_one),
};
static int piix_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void piix_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(piix_ide_init);
module_exit(piix_ide_exit);
MODULE_AUTHOR("Andre Hedrick, Andrzej Krzysztofowicz");
MODULE_DESCRIPTION("PCI driver module for Intel PIIX IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -28,12 +28,18 @@ static ide_pci_host_proc_t piix_procs[] __initdata = { ...@@ -28,12 +28,18 @@ static ide_pci_host_proc_t piix_procs[] __initdata = {
#endif /* defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) */ #endif /* defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_piix(struct pci_dev *, ide_pci_device_t *); static void init_setup_piix(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_piix(struct pci_dev *, const char *); static unsigned int __init init_chipset_piix(struct pci_dev *, const char *);
static void init_hwif_piix(ide_hwif_t *); static void init_hwif_piix(ide_hwif_t *);
static void init_dma_piix(ide_hwif_t *, unsigned long); static void init_dma_piix(ide_hwif_t *, unsigned long);
static ide_pci_device_t piix_chipsets[] __initdata = {
{ /*
* Table of the various PIIX capability blocks
*
*/
static ide_pci_device_t piix_pci_info[] __devinit = {
{ /* 0 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371FB_0, device: PCI_DEVICE_ID_INTEL_82371FB_0,
name: "PIIXa", name: "PIIXa",
...@@ -47,7 +53,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -47,7 +53,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 1 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371FB_1, device: PCI_DEVICE_ID_INTEL_82371FB_1,
name: "PIIXb", name: "PIIXb",
...@@ -61,7 +67,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -61,7 +67,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 2 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371MX, device: PCI_DEVICE_ID_INTEL_82371MX,
name: "MPIIX", name: "MPIIX",
...@@ -75,7 +81,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -75,7 +81,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x6D,0x80,0x80}, {0x6F,0x80,0x80}}, enablebits: {{0x6D,0x80,0x80}, {0x6F,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 3 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371SB_1, device: PCI_DEVICE_ID_INTEL_82371SB_1,
name: "PIIX3", name: "PIIX3",
...@@ -89,7 +95,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -89,7 +95,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 4 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371AB, device: PCI_DEVICE_ID_INTEL_82371AB,
name: "PIIX4", name: "PIIX4",
...@@ -103,7 +109,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -103,7 +109,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 5 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801AB_1, device: PCI_DEVICE_ID_INTEL_82801AB_1,
name: "ICH0", name: "ICH0",
...@@ -117,7 +123,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -117,7 +123,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 6 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82443MX_1, device: PCI_DEVICE_ID_INTEL_82443MX_1,
name: "PIIX4", name: "PIIX4",
...@@ -131,7 +137,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -131,7 +137,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 7 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801AA_1, device: PCI_DEVICE_ID_INTEL_82801AA_1,
name: "ICH", name: "ICH",
...@@ -145,7 +151,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -145,7 +151,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 8 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82372FB_1, device: PCI_DEVICE_ID_INTEL_82372FB_1,
name: "PIIX4", name: "PIIX4",
...@@ -159,7 +165,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -159,7 +165,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 9 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82451NX, device: PCI_DEVICE_ID_INTEL_82451NX,
name: "PIIX4", name: "PIIX4",
...@@ -173,7 +179,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -173,7 +179,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 10 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801BA_9, device: PCI_DEVICE_ID_INTEL_82801BA_9,
name: "ICH2", name: "ICH2",
...@@ -187,7 +193,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -187,7 +193,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 11 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801BA_8, device: PCI_DEVICE_ID_INTEL_82801BA_8,
name: "ICH2M", name: "ICH2M",
...@@ -201,7 +207,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -201,7 +207,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 12 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801CA_10, device: PCI_DEVICE_ID_INTEL_82801CA_10,
name: "ICH3M", name: "ICH3M",
...@@ -215,7 +221,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -215,7 +221,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 13 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801CA_11, device: PCI_DEVICE_ID_INTEL_82801CA_11,
name: "ICH3", name: "ICH3",
...@@ -229,7 +235,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -229,7 +235,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 14 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801DB_11, device: PCI_DEVICE_ID_INTEL_82801DB_11,
name: "ICH4", name: "ICH4",
...@@ -243,7 +249,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = { ...@@ -243,7 +249,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 15 */
vendor: PCI_VENDOR_ID_INTEL, vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801E_11, device: PCI_DEVICE_ID_INTEL_82801E_11,
name: "C-ICH", name: "C-ICH",
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */ #include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */
#include <linux/types.h> #include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/timer.h> #include <linux/timer.h>
...@@ -55,26 +56,57 @@ static void __init init_hwif_rz1000 (ide_hwif_t *hwif) ...@@ -55,26 +56,57 @@ static void __init init_hwif_rz1000 (ide_hwif_t *hwif)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_rz1000 (struct pci_dev *dev, ide_pci_device_t *d) static int __devinit rz1000_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &rz1000_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
int __init rz1000_scan_pcidev (struct pci_dev *dev) /**
* rz1000_remove_one - called with an RZ1000 is unplugged
* @dev: the device that was removed
*
* Disconnect an RZ1000 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void rz1000_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("RZ1000 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_PCTECH)
return 0; static struct pci_device_id rz1000_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
for (d = rz1000_chipsets; d && d->vendor && d->device; ++d) { { PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
if (((d->vendor == dev->vendor) && { 0, },
(d->device == dev->device)) && };
(d->init_setup)) {
d->init_setup(dev, d); static struct pci_driver driver = {
return 1; name: "RZ1000 IDE",
} id_table: rz1000_pci_tbl,
} probe: rz1000_init_one,
return 0; remove: __devexit_p(rz1000_remove_one),
};
static int rz1000_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void rz1000_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
} }
module_init(rz1000_ide_init);
module_exit(rz1000_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for RZ1000 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ide.h> #include <linux/ide.h>
static void init_setup_rz1000(struct pci_dev *, ide_pci_device_t *);
static void init_hwif_rz1000(ide_hwif_t *); static void init_hwif_rz1000(ide_hwif_t *);
static ide_pci_device_t rz1000_chipsets[] __initdata = { static ide_pci_device_t rz1000_chipsets[] __initdata = {
...@@ -13,7 +12,6 @@ static ide_pci_device_t rz1000_chipsets[] __initdata = { ...@@ -13,7 +12,6 @@ static ide_pci_device_t rz1000_chipsets[] __initdata = {
vendor: PCI_VENDOR_ID_PCTECH, vendor: PCI_VENDOR_ID_PCTECH,
device: PCI_DEVICE_ID_PCTECH_RZ1000, device: PCI_DEVICE_ID_PCTECH_RZ1000,
name: "RZ1000", name: "RZ1000",
init_setup: init_setup_rz1000,
init_chipset: NULL, init_chipset: NULL,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_rz1000, init_hwif: init_hwif_rz1000,
...@@ -27,7 +25,6 @@ static ide_pci_device_t rz1000_chipsets[] __initdata = { ...@@ -27,7 +25,6 @@ static ide_pci_device_t rz1000_chipsets[] __initdata = {
vendor: PCI_VENDOR_ID_PCTECH, vendor: PCI_VENDOR_ID_PCTECH,
device: PCI_DEVICE_ID_PCTECH_RZ1001, device: PCI_DEVICE_ID_PCTECH_RZ1001,
name: "RZ1001", name: "RZ1001",
init_setup: init_setup_rz1000,
init_chipset: NULL, init_chipset: NULL,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_rz1000, init_hwif: init_hwif_rz1000,
......
/* /*
* linux/drivers/ide/serverworks.c Version 0.6 05 April 2002 * linux/drivers/ide/serverworks.c Version 0.7 10 Sept 2002
* *
* Copyright (C) 1998-2000 Michel Aubry * Copyright (C) 1998-2000 Michel Aubry
* Copyright (C) 1998-2000 Andrzej Krzysztofowicz * Copyright (C) 1998-2000 Andrzej Krzysztofowicz
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -766,21 +767,73 @@ static void __init init_setup_csb6 (struct pci_dev *dev, ide_pci_device_t *d) ...@@ -766,21 +767,73 @@ static void __init init_setup_csb6 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
int __init serverworks_scan_pcidev (struct pci_dev *dev)
{
ide_pci_device_t *d;
if (dev->vendor != PCI_VENDOR_ID_SERVERWORKS) /**
return 0; * svwks_init_one - called when a OSB/CSB is found
* @dev: the svwks device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit svwks_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &serverworks_chipsets[id->driver_data];
for (d = serverworks_chipsets; d && d->vendor && d->device; ++d) { if (dev->device != d->device)
if (((d->vendor == dev->vendor) && BUG();
(d->device == dev->device)) && d->init_setup(dev, d);
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0; return 0;
} }
/**
* svwks_remove_one - called when an OSB/CSB is unplugged
* @dev: the device that was removed
*
* Disconnect a SVWKS device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void svwks_remove_one(struct pci_dev *dev)
{
panic("SVWKS removal not yet supported");
}
static struct pci_device_id svwks_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ 0, },
};
static struct pci_driver driver = {
name: "Serverworks IDE",
id_table: svwks_pci_tbl,
probe: svwks_init_one,
remove: __devexit_p(svwks_remove_one),
#if 0 /* FIXME: implement */
suspend: ,
resume: ,
#endif
};
static int svwks_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void svwks_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(svwks_ide_init);
module_exit(svwks_ide_exit);
MODULE_AUTHOR("Michael Aubry. Andrzej Krzysztofowicz, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for Serverworks OSB4/CSB5/CSB6 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -38,7 +38,7 @@ static void init_hwif_svwks(ide_hwif_t *); ...@@ -38,7 +38,7 @@ static void init_hwif_svwks(ide_hwif_t *);
static void init_dma_svwks(ide_hwif_t *, unsigned long); static void init_dma_svwks(ide_hwif_t *, unsigned long);
static ide_pci_device_t serverworks_chipsets[] __initdata = { static ide_pci_device_t serverworks_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_SERVERWORKS, vendor: PCI_VENDOR_ID_SERVERWORKS,
device: PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, device: PCI_DEVICE_ID_SERVERWORKS_OSB4IDE,
name: "SvrWks OSB4", name: "SvrWks OSB4",
...@@ -52,7 +52,7 @@ static ide_pci_device_t serverworks_chipsets[] __initdata = { ...@@ -52,7 +52,7 @@ static ide_pci_device_t serverworks_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 1 */
vendor: PCI_VENDOR_ID_SERVERWORKS, vendor: PCI_VENDOR_ID_SERVERWORKS,
device: PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, device: PCI_DEVICE_ID_SERVERWORKS_CSB5IDE,
name: "SvrWks CSB5", name: "SvrWks CSB5",
...@@ -66,7 +66,7 @@ static ide_pci_device_t serverworks_chipsets[] __initdata = { ...@@ -66,7 +66,7 @@ static ide_pci_device_t serverworks_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 2 */
vendor: PCI_VENDOR_ID_SERVERWORKS, vendor: PCI_VENDOR_ID_SERVERWORKS,
device: PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, device: PCI_DEVICE_ID_SERVERWORKS_CSB6IDE,
name: "SvrWks CSB6", name: "SvrWks CSB6",
...@@ -80,7 +80,7 @@ static ide_pci_device_t serverworks_chipsets[] __initdata = { ...@@ -80,7 +80,7 @@ static ide_pci_device_t serverworks_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 3 */
vendor: PCI_VENDOR_ID_SERVERWORKS, vendor: PCI_VENDOR_ID_SERVERWORKS,
device: PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, device: PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2,
name: "SvrWks CSB6", name: "SvrWks CSB6",
......
/* /*
* linux/drivers/ide/siimage.c Version 1.00 May 9, 2002 * linux/drivers/ide/siimage.c Version 1.01 Sept 11, 2002
* *
* Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org>
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/hdreg.h> #include <linux/hdreg.h>
...@@ -836,26 +837,57 @@ static void __init init_dma_siimage (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -836,26 +837,57 @@ static void __init init_dma_siimage (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_siimage (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit siimage_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &siimage_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
int __init siimage_scan_pcidev (struct pci_dev *dev) /**
* siimage_remove_one - called when an SI IDE is unplugged
* @dev: the device that was removed
*
* Disconnect an IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void siimage_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("SiImage IDE removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_CMD) static struct pci_device_id siimage_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
for (d = siimage_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "SiI IDE",
(d->device == dev->device)) && id_table: siimage_pci_tbl,
(d->init_setup)) { probe: siimage_init_one,
d->init_setup(dev, d); remove: __devexit_p(siimage_remove_one),
return 1; };
}
} static int siimage_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
}
static void siimage_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
} }
module_init(siimage_ide_init);
module_exit(siimage_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for SiI IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -107,18 +107,16 @@ static ide_pci_host_proc_t siimage_procs[] __initdata = { ...@@ -107,18 +107,16 @@ static ide_pci_host_proc_t siimage_procs[] __initdata = {
}; };
#endif /* DISPLAY_SIIMAGE_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_SIIMAGE_TIMINGS && CONFIG_PROC_FS */
static void init_setup_siimage(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_siimage(struct pci_dev *, const char *); static unsigned int init_chipset_siimage(struct pci_dev *, const char *);
static void init_iops_siimage(ide_hwif_t *); static void init_iops_siimage(ide_hwif_t *);
static void init_hwif_siimage(ide_hwif_t *); static void init_hwif_siimage(ide_hwif_t *);
static void init_dma_siimage(ide_hwif_t *, unsigned long); static void init_dma_siimage(ide_hwif_t *, unsigned long);
static ide_pci_device_t siimage_chipsets[] __initdata = { static ide_pci_device_t siimage_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_CMD, vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_SII_680, device: PCI_DEVICE_ID_SII_680,
name: "SiI680", name: "SiI680",
init_setup: init_setup_siimage,
init_chipset: init_chipset_siimage, init_chipset: init_chipset_siimage,
init_iops: init_iops_siimage, init_iops: init_iops_siimage,
init_hwif: init_hwif_siimage, init_hwif: init_hwif_siimage,
...@@ -128,11 +126,10 @@ static ide_pci_device_t siimage_chipsets[] __initdata = { ...@@ -128,11 +126,10 @@ static ide_pci_device_t siimage_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 1 */
vendor: PCI_VENDOR_ID_CMD, vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_SII_3112, device: PCI_DEVICE_ID_SII_3112,
name: "SiI3112 Serial ATA", name: "SiI3112 Serial ATA",
init_setup: init_setup_siimage,
init_chipset: init_chipset_siimage, init_chipset: init_chipset_siimage,
init_iops: init_iops_siimage, init_iops: init_iops_siimage,
init_hwif: init_hwif_siimage, init_hwif: init_hwif_siimage,
......
/* /*
* linux/drivers/ide/sis5513.c Version 0.14 July 24, 2002 * linux/drivers/ide/sis5513.c Version 0.14ac Sept 11, 2002
* *
* Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org> * Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org>
* Copyright (C) 2002 Lionel Bouton <Lionel.Bouton@inet6.fr>, Maintainer * Copyright (C) 2002 Lionel Bouton <Lionel.Bouton@inet6.fr>, Maintainer
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/timer.h> #include <linux/timer.h>
...@@ -1022,26 +1023,56 @@ static void __init init_dma_sis5513 (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -1022,26 +1023,56 @@ static void __init init_dma_sis5513 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_sis5513 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &sis5513_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
int __init sis5513_scan_pcidev (struct pci_dev *dev) /**
* sis5513_remove_one - called when SIS IDE is unplugged
* @dev: the device that was removed
*
* Disconnect a SIS IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void sis5513_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("SIS IDE removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_SI) static struct pci_device_id sis5513_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = sis5513_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "SIS IDE",
(d->device == dev->device)) && id_table: sis5513_pci_tbl,
(d->init_setup)) { probe: sis5513_init_one,
d->init_setup(dev, d); remove: __devexit_p(sis5513_remove_one),
return 1; };
}
} static int sis5513_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
} }
static void sis5513_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(sis5513_ide_init);
module_exit(sis5513_ide_exit);
MODULE_AUTHOR("Lionel Bouton, L C Chang, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for SIS IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -25,17 +25,15 @@ static ide_pci_host_proc_t sis_procs[] __initdata = { ...@@ -25,17 +25,15 @@ static ide_pci_host_proc_t sis_procs[] __initdata = {
}; };
#endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) */ #endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_sis5513(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_sis5513(struct pci_dev *, const char *); static unsigned int init_chipset_sis5513(struct pci_dev *, const char *);
static void init_hwif_sis5513(ide_hwif_t *); static void init_hwif_sis5513(ide_hwif_t *);
static void init_dma_sis5513(ide_hwif_t *, unsigned long); static void init_dma_sis5513(ide_hwif_t *, unsigned long);
static ide_pci_device_t sis5513_chipsets[] __initdata = { static ide_pci_device_t sis5513_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_SI, vendor: PCI_VENDOR_ID_SI,
device: PCI_DEVICE_ID_SI_5513, device: PCI_DEVICE_ID_SI_5513,
name: "SIS5513", name: "SIS5513",
init_setup: init_setup_sis5513,
init_chipset: init_chipset_sis5513, init_chipset: init_chipset_sis5513,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_sis5513, init_hwif: init_hwif_sis5513,
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linuyx/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -281,26 +282,54 @@ static void __init init_hwif_sl82c105(ide_hwif_t *hwif) ...@@ -281,26 +282,54 @@ static void __init init_hwif_sl82c105(ide_hwif_t *hwif)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_sl82c105 (struct pci_dev *dev, ide_pci_device_t *d) static int __devinit sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &slc82c105_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
int __init sl82c105_scan_pcidev (struct pci_dev *dev) /**
* sl82c105_remove_one - called with an SLC82c105 is unplugged
* @dev: the device that was removed
*
* Disconnect an W82C105 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void sl82c105_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("W82C105 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_WINBOND) static struct pci_device_id sl82c105_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = sl82c105_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "W82C105 IDE",
(d->device == dev->device)) && id_table: sl82c105_pci_tbl,
(d->init_setup)) { probe: sl82c105_init_one,
d->init_setup(dev, d); remove: __devexit_p(sl82c105_remove_one),
return 1; };
}
} static int sl82c105_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
} }
static void sl82c105_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(sl82c105_ide_init);
module_exit(sl82c105_ide_exit);
MODULE_DESCRIPTION("PCI driver module for W82C105 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -5,17 +5,15 @@ ...@@ -5,17 +5,15 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ide.h> #include <linux/ide.h>
static void init_setup_sl82c105(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_sl82c105(struct pci_dev *, const char *); static unsigned int init_chipset_sl82c105(struct pci_dev *, const char *);
static void init_hwif_sl82c105(ide_hwif_t *); static void init_hwif_sl82c105(ide_hwif_t *);
static void init_dma_sl82c105(ide_hwif_t *, unsigned long); static void init_dma_sl82c105(ide_hwif_t *, unsigned long);
static ide_pci_device_t sl82c105_chipsets[] __initdata = { static ide_pci_device_t sl82c105_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_WINBOND, vendor: PCI_VENDOR_ID_WINBOND,
device: PCI_DEVICE_ID_WINBOND_82C105, device: PCI_DEVICE_ID_WINBOND_82C105,
name: "W82C105", name: "W82C105",
init_setup: init_setup_sl82c105,
init_chipset: init_chipset_sl82c105, init_chipset: init_chipset_sl82c105,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_sl82c105, init_hwif: init_hwif_sl82c105,
......
/* /*
* linux/drivers/ide/slc90e66.c Version 0.10 October 4, 2000 * linux/drivers/ide/slc90e66.c Version 0.11 September 11, 2002
* *
* Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org>
* *
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -364,26 +365,56 @@ static void __init init_dma_slc90e66 (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -364,26 +365,56 @@ static void __init init_dma_slc90e66 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_slc90e66 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit slc90e66_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &slc90e66_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
int __init slc90e66_scan_pcidev (struct pci_dev *dev) /**
* slc90e66_remove_one - called with an slc90e66 is unplugged
* @dev: the device that was removed
*
* Disconnect an slc90e66 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void slc90e66_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("slc90e66 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_EFAR) static struct pci_device_id slc90e66_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = slc90e66_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "SLC90e66 IDE",
(d->device == dev->device)) && id_table: slc90e66_pci_tbl,
(d->init_setup)) { probe: slc90e66_init_one,
d->init_setup(dev, d); remove: __devexit_p(slc90e66_remove_one),
return 1; };
}
} static int slc90e66_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
} }
static void slc90e66_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(slc90e66_ide_init);
module_exit(slc90e66_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for SLC90E66 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -27,17 +27,15 @@ static ide_pci_host_proc_t slc90e66_procs[] __initdata = { ...@@ -27,17 +27,15 @@ static ide_pci_host_proc_t slc90e66_procs[] __initdata = {
}; };
#endif /* defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) */ #endif /* defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_slc90e66(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_slc90e66(struct pci_dev *, const char *); static unsigned int init_chipset_slc90e66(struct pci_dev *, const char *);
static void init_hwif_slc90e66(ide_hwif_t *); static void init_hwif_slc90e66(ide_hwif_t *);
static void init_dma_slc90e66(ide_hwif_t *, unsigned long); static void init_dma_slc90e66(ide_hwif_t *, unsigned long);
static ide_pci_device_t slc90e66_chipsets[] __initdata = { static ide_pci_device_t slc90e66_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_EFAR, vendor: PCI_VENDOR_ID_EFAR,
device: PCI_DEVICE_ID_EFAR_SLC90E66_1, device: PCI_DEVICE_ID_EFAR_SLC90E66_1,
name: "SLC90E66", name: "SLC90E66",
init_setup: init_setup_slc90e66,
init_chipset: init_chipset_slc90e66, init_chipset: init_chipset_slc90e66,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_slc90e66, init_hwif: init_hwif_slc90e66,
......
...@@ -126,6 +126,7 @@ ...@@ -126,6 +126,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ioport.h> #include <linux/ioport.h>
...@@ -191,7 +192,7 @@ static int trm290_ide_dma_write (ide_drive_t *drive /*, struct request *rq */) ...@@ -191,7 +192,7 @@ static int trm290_ide_dma_write (ide_drive_t *drive /*, struct request *rq */)
trm290_prepare_drive(drive, 0); /* select PIO xfer */ trm290_prepare_drive(drive, 0); /* select PIO xfer */
return 1; return 1;
#endif #endif
if (!(count = ide_build_dmatable(drive, rq))) { if (!(count = ide_build_dmatable(drive, rq, PCI_DMA_TODEVICE))) {
/* try PIO instead of DMA */ /* try PIO instead of DMA */
trm290_prepare_drive(drive, 0); /* select PIO xfer */ trm290_prepare_drive(drive, 0); /* select PIO xfer */
return 1; return 1;
...@@ -235,7 +236,7 @@ static int trm290_ide_dma_read (ide_drive_t *drive /*, struct request *rq */) ...@@ -235,7 +236,7 @@ static int trm290_ide_dma_read (ide_drive_t *drive /*, struct request *rq */)
task_ioreg_t command = WIN_NOP; task_ioreg_t command = WIN_NOP;
unsigned int count, reading = 2, writing = 0; unsigned int count, reading = 2, writing = 0;
if (!(count = ide_build_dmatable(drive, rq))) { if (!(count = ide_build_dmatable(drive, rq, PCI_DMA_FROMDEVICE))) {
/* try PIO instead of DMA */ /* try PIO instead of DMA */
trm290_prepare_drive(drive, 0); /* select PIO xfer */ trm290_prepare_drive(drive, 0); /* select PIO xfer */
return 1; return 1;
...@@ -396,26 +397,55 @@ void __init init_hwif_trm290 (ide_hwif_t *hwif) ...@@ -396,26 +397,55 @@ void __init init_hwif_trm290 (ide_hwif_t *hwif)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
void __init init_setup_trm290 (struct pci_dev *dev, ide_pci_device_t *d) static int __devinit trm290_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &trm290_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
int __init trm290_scan_pcidev (struct pci_dev *dev) /**
* trm290_remove_one - called when an trm290 is unplugged
* @dev: the device that was removed
*
* Disconnect a trm290 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void trm290_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("trm290 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_TEKRAM) static struct pci_device_id trm290_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_TEKRAM, PCI_DEVICE_ID_TEKRAM_DC290, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = trm290_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "TRM290 IDE",
(d->device == dev->device)) && id_table: trm290_pci_tbl,
(d->init_setup)) { probe: trm290_init_one,
d->init_setup(dev, d); remove: __devexit_p(trm290_remove_one),
return 1; };
}
} static int trm290_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
}
static void trm290_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
} }
module_init(trm290_ide_init);
module_exit(trm290_ide_exit);
MODULE_AUTHOR("Mark Lord");
MODULE_DESCRIPTION("PCI driver module for Tekram TRM290 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -5,15 +5,13 @@ ...@@ -5,15 +5,13 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ide.h> #include <linux/ide.h>
extern void init_setup_trm290(struct pci_dev *, ide_pci_device_t *);
extern void init_hwif_trm290(ide_hwif_t *); extern void init_hwif_trm290(ide_hwif_t *);
static ide_pci_device_t trm290_chipsets[] __initdata = { static ide_pci_device_t trm290_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_TEKRAM, vendor: PCI_VENDOR_ID_TEKRAM,
device: PCI_DEVICE_ID_TEKRAM_DC290, device: PCI_DEVICE_ID_TEKRAM_DC290,
name: "TRM290", name: "TRM290",
init_setup: init_setup_trm290,
init_chipset: NULL, init_chipset: NULL,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_trm290, init_hwif: init_hwif_trm290,
......
/* /*
* $Id: via82cxxx.c,v 3.35-ac1 2002/08/19 Alan Exp $ * $Id: via82cxxx.c,v 3.35-ac2 2002/09/111 Alan Exp $
* *
* Copyright (c) 2000-2001 Vojtech Pavlik * Copyright (c) 2000-2001 Vojtech Pavlik
* *
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
...@@ -161,7 +162,7 @@ static int via_get_info(char *buffer, char **addr, off_t offset, int count) ...@@ -161,7 +162,7 @@ static int via_get_info(char *buffer, char **addr, off_t offset, int count)
via_print("Highest DMA rate: %s", via_print("Highest DMA rate: %s",
via_dma[via_config->flags & VIA_UDMA]); via_dma[via_config->flags & VIA_UDMA]);
via_print("BM-DMA base: %#x", via_base); via_print("BM-DMA base: %#lx", via_base);
via_print("PCI clock: %d.%dMHz", via_print("PCI clock: %d.%dMHz",
via_clock / 1000, via_clock / 100 % 10); via_clock / 1000, via_clock / 100 % 10);
...@@ -634,38 +635,56 @@ static void __init init_dma_via82cxxx(ide_hwif_t *hwif, unsigned long dmabase) ...@@ -634,38 +635,56 @@ static void __init init_dma_via82cxxx(ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
/* static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id)
* FIXME: should not be needed
*/
static void __init init_setup_via82cxxx (struct pci_dev *dev, ide_pci_device_t *d)
{ {
ide_pci_device_t *d = &via82cxxx_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
return 0;
} }
/** /**
* via82cxxx_scan_pcidev - set up any via devices * via_remove_one - called with a VIA IDE interface is unplugged
* @dev: PCI device we are offered * @dev: the device that was removed
* *
* Any controller we are offered that we can configure we set up * Disconnect a VIA IDE device that has been unplugged either by hotplug
* and return 1. Anything we cannot drive we return 0 * or by a more civilized notification scheme. Not yet supported.
*/ */
int __init via82cxxx_scan_pcidev (struct pci_dev *dev) static void via_remove_one(struct pci_dev *dev)
{ {
ide_pci_device_t *d; panic("VIA IDE removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_VIA) static struct pci_device_id via_pci_tbl[] __devinitdata = {
return 0; { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
for (d = via82cxxx_chipsets; d && d->vendor && d->device; ++d) { static struct pci_driver driver = {
if (((d->vendor == dev->vendor) && name: "VIA IDE",
(d->device == dev->device)) && id_table: via_pci_tbl,
(d->init_setup)) { probe: via_init_one,
d->init_setup(dev, d); remove: __devexit_p(via_remove_one),
return 1; };
}
} static int via_ide_init(void)
return 0; {
return ide_pci_register_driver(&driver);
}
static void via_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
} }
module_init(via_ide_init);
module_exit(via_ide_exit);
MODULE_AUTHOR("Vojtech Pavlik, Michel Aubry, Jeff Garzik, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for VIA IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
...@@ -25,17 +25,15 @@ static ide_pci_host_proc_t via_procs[] __initdata = { ...@@ -25,17 +25,15 @@ static ide_pci_host_proc_t via_procs[] __initdata = {
}; };
#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */
static void init_setup_via82cxxx(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_via82cxxx(struct pci_dev *, const char *); static unsigned int init_chipset_via82cxxx(struct pci_dev *, const char *);
static void init_hwif_via82cxxx(ide_hwif_t *); static void init_hwif_via82cxxx(ide_hwif_t *);
static void init_dma_via82cxxx(ide_hwif_t *, unsigned long); static void init_dma_via82cxxx(ide_hwif_t *, unsigned long);
static ide_pci_device_t via82cxxx_chipsets[] __initdata = { static ide_pci_device_t via82cxxx_chipsets[] __initdata = {
{ { /* 0 */
vendor: PCI_VENDOR_ID_VIA, vendor: PCI_VENDOR_ID_VIA,
device: PCI_DEVICE_ID_VIA_82C576_1, device: PCI_DEVICE_ID_VIA_82C576_1,
name: "VP_IDE", name: "VP_IDE",
init_setup: init_setup_via82cxxx,
init_chipset: init_chipset_via82cxxx, init_chipset: init_chipset_via82cxxx,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_via82cxxx, init_hwif: init_hwif_via82cxxx,
...@@ -45,11 +43,10 @@ static ide_pci_device_t via82cxxx_chipsets[] __initdata = { ...@@ -45,11 +43,10 @@ static ide_pci_device_t via82cxxx_chipsets[] __initdata = {
enablebits: {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, enablebits: {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
bootable: ON_BOARD, bootable: ON_BOARD,
extra: 0, extra: 0,
},{ },{ /* 1 */
vendor: PCI_VENDOR_ID_VIA, vendor: PCI_VENDOR_ID_VIA,
device: PCI_DEVICE_ID_VIA_82C586_1, device: PCI_DEVICE_ID_VIA_82C586_1,
name: "VP_IDE", name: "VP_IDE",
init_setup: init_setup_via82cxxx,
init_chipset: init_chipset_via82cxxx, init_chipset: init_chipset_via82cxxx,
init_iops: NULL, init_iops: NULL,
init_hwif: init_hwif_via82cxxx, init_hwif: init_hwif_via82cxxx,
......
...@@ -712,6 +712,8 @@ void ide_setup_pci_device (struct pci_dev *dev, ide_pci_device_t *d) ...@@ -712,6 +712,8 @@ void ide_setup_pci_device (struct pci_dev *dev, ide_pci_device_t *d)
probe_hwif_init(&ide_hwifs[index_list.b.high]); probe_hwif_init(&ide_hwifs[index_list.b.high]);
} }
EXPORT_SYMBOL_GPL(ide_setup_pci_device);
void ide_setup_pci_devices (struct pci_dev *dev, struct pci_dev *dev2, ide_pci_device_t *d) void ide_setup_pci_devices (struct pci_dev *dev, struct pci_dev *dev2, ide_pci_device_t *d)
{ {
ata_index_t index_list = do_ide_setup_pci_device(dev, d, 1); ata_index_t index_list = do_ide_setup_pci_device(dev, d, 1);
...@@ -727,152 +729,10 @@ void ide_setup_pci_devices (struct pci_dev *dev, struct pci_dev *dev2, ide_pci_d ...@@ -727,152 +729,10 @@ void ide_setup_pci_devices (struct pci_dev *dev, struct pci_dev *dev2, ide_pci_d
probe_hwif_init(&ide_hwifs[index_list2.b.high]); probe_hwif_init(&ide_hwifs[index_list2.b.high]);
} }
/* EXPORT_SYMBOL_GPL(ide_setup_pci_devices);
* ide_scan_pcibus() gets invoked at boot time from ide.c.
* It finds all PCI IDE controllers and calls ide_setup_pci_device for them.
*/
void __init ide_scan_pcidev (struct pci_dev *dev)
{
#if 0
printk(" PCI slot %s, VID=%04x, DID=%04x\n",
dev->slot_name, dev->vendor, dev->device);
#endif
if ((dev->vendor == PCI_VENDOR_ID_CMD) &&
(dev->device == PCI_DEVICE_ID_CMD_640)) {
return;
#ifdef CONFIG_BLK_DEV_ALI15X3
}{
extern int ali15x3_scan_pcidev(struct pci_dev *dev);
if (ali15x3_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_ALI15X3 */
#ifdef CONFIG_BLK_DEV_AMD74XX
}{
extern int amd74xx_scan_pcidev(struct pci_dev *dev);
if (amd74xx_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_AMD74XX */
#ifdef CONFIG_BLK_DEV_CS5530
}{
extern int cs5530_scan_pcidev(struct pci_dev *dev);
if (cs5530_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_CS5530 */
#ifdef CONFIG_BLK_DEV_CY82C693
}{
extern int cy82c693_scan_pcidev(struct pci_dev *dev);
if (cy82c693_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_CY82C693 */
#ifdef CONFIG_BLK_DEV_IT8172
}{
extern int it8172_scan_pcidev(struct pci_dev *dev);
if (it8172_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_IT8172 */
#ifdef CONFIG_BLK_DEV_NFORCE
}{
extern int nforce_scan_pcidev(struct pci_dev *dev);
if (nforce_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_NFORCE */
#ifdef CONFIG_BLK_DEV_NS87415
}{
extern int ns87415_scan_pcidev(struct pci_dev *dev);
if (ns87415_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_NS87415 */
#ifdef CONFIG_BLK_DEV_OPTI621
}{
extern int opti621_scan_pcidev(struct pci_dev *dev);
if (opti621_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_OPTI621 */
#ifdef CONFIG_BLK_DEV_PIIX
}{
extern int piix_scan_pcidev(struct pci_dev *dev);
if (piix_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_PIIX */
#ifdef CONFIG_BLK_DEV_RZ1000
}{
extern int rz1000_scan_pcidev(struct pci_dev *dev);
if (rz1000_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_RZ1000 */
#ifdef CONFIG_BLK_DEV_SVWKS
}{
extern int serverworks_scan_pcidev(struct pci_dev *dev);
if (serverworks_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_SVWKS */
#ifdef CONFIG_BLK_DEV_SIS5513
}{
extern int sis5513_scan_pcidev(struct pci_dev *dev);
if (sis5513_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_SIS5513 */
#ifdef CONFIG_BLK_DEV_SLC90E66
}{
extern int slc90e66_scan_pcidev(struct pci_dev *dev);
if (slc90e66_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_SLC90E66 */
#ifdef CONFIG_BLK_DEV_VIA82CXXX
}{
extern int via82cxxx_scan_pcidev(struct pci_dev *dev);
if (via82cxxx_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_VIA82CXXX */
#ifdef CONFIG_BLK_DEV_AEC62XX
}{
extern int aec62xx_scan_pcidev(struct pci_dev *dev);
if (aec62xx_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_AEC62XX */
#ifdef CONFIG_BLK_DEV_CMD64X
}{
extern int cmd64x_scan_pcidev(struct pci_dev *dev);
if (cmd64x_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_CMD64X */
#ifdef CONFIG_BLK_DEV_HPT34X
}{
extern int hpt34x_scan_pcidev(struct pci_dev *dev);
if (hpt34x_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_HPT34X */
#ifdef CONFIG_BLK_DEV_HPT366
}{
extern int hpt366_scan_pcidev(struct pci_dev *dev);
if (hpt366_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_HPT366 */
#ifdef CONFIG_BLK_DEV_PDC202XX_OLD
}{
extern int pdc202xx_scan_pcidev(struct pci_dev *dev);
if (pdc202xx_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_PDC202XX_OLD */
#ifdef CONFIG_BLK_DEV_PDC202XX_NEW
}{
extern int pdcnew_scan_pcidev(struct pci_dev *dev);
if (pdcnew_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_PDC202XX_NEW */
#ifdef CONFIG_BLK_DEV_PDC_ADMA
}{
extern int pdcadma_scan_pcidev(struct pci_dev *dev);
if (pdcadma_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_PDC_ADMA */
#ifdef CONFIG_BLK_DEV_SIIMAGE
}{
extern int siimage_scan_pcidev(struct pci_dev *dev);
if (siimage_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_SIIMAGE */
#ifdef CONFIG_BLK_DEV_SL82C105
}{
extern int sl82c105_scan_pcidev(struct pci_dev *dev);
if (sl82c105_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_SL82C105 */
#ifdef CONFIG_BLK_DEV_TRM290
}{
extern int trm290_scan_pcidev(struct pci_dev *dev);
if (trm290_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_TRM290 */
#ifdef CONFIG_BLK_DEV_GENERIC
}{
extern int generic_scan_pcidev(struct pci_dev *dev);
if (generic_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_GENERIC */
}
}
/* /*
* Module interfaces - not yet functional. * Module interfaces
*/ */
static int pre_init = 1; /* Before first ordered IDE scan */ static int pre_init = 1; /* Before first ordered IDE scan */
...@@ -893,15 +753,15 @@ static LIST_HEAD(ide_pci_drivers); ...@@ -893,15 +753,15 @@ static LIST_HEAD(ide_pci_drivers);
* Returns are the same as for pci_register_driver * Returns are the same as for pci_register_driver
*/ */
int ide_register_pci_driver(struct pci_driver *driver) int ide_pci_register_driver(struct pci_driver *driver)
{ {
if(!pre_init) if(!pre_init)
return pci_register_driver(driver); return pci_module_init(driver);
list_add_tail(&driver->node, &ide_pci_drivers); list_add_tail(&driver->node, &ide_pci_drivers);
return 0; return 0;
} }
EXPORT_SYMBOL(ide_register_pci_driver); EXPORT_SYMBOL_GPL(ide_pci_register_driver);
/** /**
* ide_unregister_pci_driver - unregister an IDE driver * ide_unregister_pci_driver - unregister an IDE driver
...@@ -911,7 +771,7 @@ EXPORT_SYMBOL(ide_register_pci_driver); ...@@ -911,7 +771,7 @@ EXPORT_SYMBOL(ide_register_pci_driver);
* as for pci_unregister_driver * as for pci_unregister_driver
*/ */
void ide_unregister_pci_driver(struct pci_driver *driver) void ide_pci_unregister_driver(struct pci_driver *driver)
{ {
if(!pre_init) if(!pre_init)
pci_unregister_driver(driver); pci_unregister_driver(driver);
...@@ -919,7 +779,40 @@ void ide_unregister_pci_driver(struct pci_driver *driver) ...@@ -919,7 +779,40 @@ void ide_unregister_pci_driver(struct pci_driver *driver)
list_del(&driver->node); list_del(&driver->node);
} }
EXPORT_SYMBOL(ide_unregister_pci_driver); EXPORT_SYMBOL_GPL(ide_pci_unregister_driver);
/**
* ide_scan_pcidev - find an IDE driver for a device
* @dev: PCI device to check
*
* Look for an IDE driver to handle the device we are considering.
* This is only used during boot up to get the ordering correct. After
* boot up the pci layer takes over the job.
*/
static int __init ide_scan_pcidev(struct pci_dev *dev)
{
struct list_head *l;
struct pci_driver *d;
list_for_each(l, &ide_pci_drivers)
{
d = list_entry(l, struct pci_driver, node);
if(d->id_table)
{
const struct pci_device_id *id = pci_match_device(d->id_table, dev);
if(id != NULL)
{
if(d->probe(dev, id) >= 0)
{
dev->driver = d;
return 1;
}
}
}
}
return 0;
}
/** /**
* ide_scan_pcibus - perform the initial IDE driver scan * ide_scan_pcibus - perform the initial IDE driver scan
...@@ -933,6 +826,8 @@ EXPORT_SYMBOL(ide_unregister_pci_driver); ...@@ -933,6 +826,8 @@ EXPORT_SYMBOL(ide_unregister_pci_driver);
void __init ide_scan_pcibus (int scan_direction) void __init ide_scan_pcibus (int scan_direction)
{ {
struct pci_dev *dev; struct pci_dev *dev;
struct pci_driver *d;
struct list_head *l, *n;
pre_init = 0; pre_init = 0;
if (!scan_direction) { if (!scan_direction) {
...@@ -944,5 +839,16 @@ void __init ide_scan_pcibus (int scan_direction) ...@@ -944,5 +839,16 @@ void __init ide_scan_pcibus (int scan_direction)
ide_scan_pcidev(dev); ide_scan_pcidev(dev);
} }
} }
/* FIXME: now add the drivers list to the real pci probe list */
/*
* Hand the drivers over to the PCI layer now we
* are post init.
*/
list_for_each_safe(l, n, &ide_pci_drivers)
{
list_del(l);
d = list_entry(l, struct pci_driver, node);
pci_register_driver(d);
}
} }
...@@ -904,9 +904,7 @@ extern inline void ide_unmap_buffer(struct request *rq, char *buffer, unsigned l ...@@ -904,9 +904,7 @@ extern inline void ide_unmap_buffer(struct request *rq, char *buffer, unsigned l
((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx))
#define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1)
#ifdef CONFIG_BLK_DEV_IDEPCI
struct ide_pci_device_s; struct ide_pci_device_s;
#endif /* CONFIG_BLK_DEV_IDEPCI */
typedef struct hwif_s { typedef struct hwif_s {
struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
...@@ -937,10 +935,8 @@ typedef struct hwif_s { ...@@ -937,10 +935,8 @@ typedef struct hwif_s {
hwif_chipset_t chipset; /* sub-module for tuning.. */ hwif_chipset_t chipset; /* sub-module for tuning.. */
#ifdef CONFIG_BLK_DEV_IDEPCI
struct pci_dev *pci_dev; /* for pci chipsets */ struct pci_dev *pci_dev; /* for pci chipsets */
struct ide_pci_device_s *cds; /* chipset device struct */ struct ide_pci_device_s *cds; /* chipset device struct */
#endif /* CONFIG_BLK_DEV_IDEPCI */
#if 0 #if 0
ide_hwif_ops_t *hwifops; ide_hwif_ops_t *hwifops;
...@@ -1108,12 +1104,10 @@ typedef struct hwgroup_s { ...@@ -1108,12 +1104,10 @@ typedef struct hwgroup_s {
/* ptr to current hwif in linked-list */ /* ptr to current hwif in linked-list */
ide_hwif_t *hwif; ide_hwif_t *hwif;
#ifdef CONFIG_BLK_DEV_IDEPCI
/* for pci chipsets */ /* for pci chipsets */
struct pci_dev *pci_dev; struct pci_dev *pci_dev;
/* chipset device struct */ /* chipset device struct */
struct ide_pci_device_s *cds; struct ide_pci_device_s *cds;
#endif /* CONFIG_BLK_DEV_IDEPCI */
/* current request */ /* current request */
struct request *rq; struct request *rq;
...@@ -1637,23 +1631,16 @@ extern void ide_intr(int irq, void *dev_id, struct pt_regs *regs); ...@@ -1637,23 +1631,16 @@ extern void ide_intr(int irq, void *dev_id, struct pt_regs *regs);
extern void do_ide_request(request_queue_t *); extern void do_ide_request(request_queue_t *);
extern void ide_init_subdrivers(void); extern void ide_init_subdrivers(void);
#ifndef _IDE_C
extern struct block_device_operations ide_fops[]; extern struct block_device_operations ide_fops[];
extern ide_proc_entry_t generic_subdriver_entries[]; extern ide_proc_entry_t generic_subdriver_entries[];
#endif
extern int ata_attach(ide_drive_t *); extern int ata_attach(ide_drive_t *);
#ifdef _IDE_C
#ifdef CONFIG_BLK_DEV_IDE
extern int ideprobe_init(void); extern int ideprobe_init(void);
#ifdef CONFIG_BLK_DEV_IDEPCI
extern void ide_scan_pcibus(int scan_direction) __init; extern void ide_scan_pcibus(int scan_direction) __init;
#endif /* CONFIG_BLK_DEV_IDEPCI */ extern int ide_pci_register_driver(struct pci_driver *driver);
extern void ide_pci_unregister_driver(struct pci_driver *driver);
#endif /* CONFIG_BLK_DEV_IDE */
#endif /* _IDE_C */
extern void default_hwif_iops(ide_hwif_t *); extern void default_hwif_iops(ide_hwif_t *);
extern void default_hwif_mmiops(ide_hwif_t *); extern void default_hwif_mmiops(ide_hwif_t *);
...@@ -1665,8 +1652,6 @@ int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int versio ...@@ -1665,8 +1652,6 @@ int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int versio
int ide_unregister_subdriver (ide_drive_t *drive); int ide_unregister_subdriver (ide_drive_t *drive);
int ide_replace_subdriver(ide_drive_t *drive, const char *driver); int ide_replace_subdriver(ide_drive_t *drive, const char *driver);
#ifdef CONFIG_BLK_DEV_IDEPCI
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
typedef struct ide_pci_host_proc_s { typedef struct ide_pci_host_proc_s {
char *name; char *name;
...@@ -1716,14 +1701,9 @@ typedef struct ide_pci_device_s { ...@@ -1716,14 +1701,9 @@ typedef struct ide_pci_device_s {
struct ide_pci_device_s *next; struct ide_pci_device_s *next;
} ide_pci_device_t; } ide_pci_device_t;
#ifdef LINUX_PCI_H
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
extern void ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, ide_pci_device_t *);
#endif /* LINUX_PCI_H */
#endif /* CONFIG_BLK_DEV_IDEPCI */
#ifdef CONFIG_BLK_DEV_IDEDMA
#define BAD_DMA_DRIVE 0 #define BAD_DMA_DRIVE 0
#define GOOD_DMA_DRIVE 1 #define GOOD_DMA_DRIVE 1
extern int ide_build_dmatable(ide_drive_t *, struct request *); extern int ide_build_dmatable(ide_drive_t *, struct request *);
...@@ -1750,7 +1730,6 @@ extern int __ide_dma_verbose(ide_drive_t *); ...@@ -1750,7 +1730,6 @@ extern int __ide_dma_verbose(ide_drive_t *);
extern int __ide_dma_retune(ide_drive_t *); extern int __ide_dma_retune(ide_drive_t *);
extern int __ide_dma_lostirq(ide_drive_t *); extern int __ide_dma_lostirq(ide_drive_t *);
extern int __ide_dma_timeout(ide_drive_t *); extern int __ide_dma_timeout(ide_drive_t *);
#endif /* CONFIG_BLK_DEV_IDEDMA */
extern void hwif_unregister(ide_hwif_t *); extern void hwif_unregister(ide_hwif_t *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment