Commit e04b2579 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] ide resync

Ok this first piece eliminates some of the use of ide_ioreg_t, which
actually only works as a ulong anyway. Its a dysfunctional abstraction.

We also need the ide pci stuff if we have IDE PCI not if we have PCI but
only legacy mode IDE support
parent 7944c220
......@@ -16,14 +16,14 @@
#include <linux/config.h>
#ifndef MAX_HWIFS
# ifdef CONFIG_PCI
# ifdef CONFIG_BLK_DEV_IDEPCI
#define MAX_HWIFS 10
# else
#define MAX_HWIFS 6
# endif
#endif
static __inline__ int ide_default_irq(ide_ioreg_t base)
static __inline__ int ide_default_irq(unsigned long base)
{
switch (base) {
case 0x1f0: return 14;
......@@ -37,16 +37,24 @@ static __inline__ int ide_default_irq(ide_ioreg_t base)
}
}
static __inline__ ide_ioreg_t ide_default_io_base(int index)
static __inline__ unsigned long ide_default_io_base(int index)
{
static unsigned long ata_io_base[MAX_HWIFS] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 };
return ata_io_base[index];
switch (index) {
case 0: return 0x1f0;
case 1: return 0x170;
case 2: return 0x1e8;
case 3: return 0x168;
case 4: return 0x1e0;
case 5: return 0x160;
default:
return 0;
}
}
static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
unsigned long ctrl_port, int *irq)
{
ide_ioreg_t reg = data_port;
unsigned long reg = data_port;
int i;
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
......@@ -65,7 +73,7 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
static __inline__ void ide_init_default_hwifs(void)
{
#ifndef CONFIG_PCI
#ifndef CONFIG_BLK_DEV_IDEPCI
hw_regs_t hw;
int index;
......@@ -75,9 +83,11 @@ static __inline__ void ide_init_default_hwifs(void)
hw.irq = ide_default_irq(ide_default_io_base(index));
ide_register_hw(&hw, NULL);
}
#endif
#endif /* CONFIG_BLK_DEV_IDEPCI */
}
#include <asm-generic/ide_iops.h>
#endif /* __KERNEL__ */
#endif /* __ASMi386_IDE_H */
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