patch-2.4.0-test3 linux/include/asm-mips/ide.h

Next file: linux/include/asm-mips/keyboard.h
Previous file: linux/include/asm-mips/highmem.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/include/asm-mips/ide.h linux/include/asm-mips/ide.h
@@ -1,16 +1,19 @@
-/* $Id: ide.h,v 1.6 1999/10/09 00:01:42 ralf Exp $
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
  *
- *  linux/include/asm-mips/ide.h
+ * This file contains the MIPS architecture specific IDE code.
  *
- *  Copyright (C) 1994-1996  Linus Torvalds & authors
+ * Copyright (C) 1994-1996  Linus Torvalds & authors
  */
 
 /*
  *  This file contains the MIPS architecture specific IDE code.
  */
 
-#ifndef __ASM_MIPS_IDE_H
-#define __ASM_MIPS_IDE_H
+#ifndef __ASM_IDE_H
+#define __ASM_IDE_H
 
 #ifdef __KERNEL__
 
@@ -53,27 +56,34 @@
 	return ide_ops->ide_default_io_base(index);
 }
 
-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, ide_ioreg_t data_port,
+                                       ide_ioreg_t ctrl_port, int *irq)
 {
-	ide_ops->ide_init_hwif_ports(hw, data_port, ctrl_port, &hw->irq);
+	ide_ioreg_t reg = data_port;
+	int i;
 
-	hw->irq = ide_ops->ide_default_irq(data_port);
+	for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+		hw->io_ports[i] = reg;
+		reg += 1;
+	}
+	if (ctrl_port) {
+		hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
+	} else {
+		hw->io_ports[IDE_CONTROL_OFFSET] = hw->io_ports[IDE_DATA_OFFSET] + 0x206;
+	}
+	if (irq != NULL)
+		*irq = 0;
+	hw->io_ports[IDE_IRQ_OFFSET] = 0;
 }
 
-/*
- * This registers the standard ports for this architecture with the IDE
- * driver.
- */
 static __inline__ void ide_init_default_hwifs(void)
 {
 #ifndef CONFIG_BLK_DEV_IDEPCI
 	hw_regs_t hw;
 	int index;
 
-	for (index = 0; index < MAX_HWIFS; index++) {
-		ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, 0);
+	for(index = 0; index < MAX_HWIFS; index++) {
+		ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
 		hw.irq = ide_default_irq(ide_default_io_base(index));
 		ide_register_hw(&hw, NULL);
 	}
@@ -129,4 +139,4 @@
 
 #endif /* __KERNEL__ */
 
-#endif /* __ASM_MIPS_IDE_H */
+#endif /* __ASM_IDE_H */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)