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
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.61/include/asm-i386/ide.h linux-2.5.61-ac2/include/asm-i386/ide.h
--- linux-2.5.61/include/asm-i386/ide.h 2003-02-10 18:37:58.000000000 +0000
+++ linux-2.5.61-ac2/include/asm-i386/ide.h 2003-02-18 15:27:32.000000000 +0000
@@ -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__ 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_default_hwifs(void)
{
-#ifndef CONFIG_PCI
+#ifndef CONFIG_BLK_DEV_IDEPCI
hw_regs_t hw;
int index;
@@ -75,9 +83,11 @@
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 */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sun Feb 23 2003 - 22:00:22 EST