patch-2.4.22 linux-2.4.22/include/asm-sh/ide.h

Next file: linux-2.4.22/include/asm-sh/io.h
Previous file: linux-2.4.22/include/asm-sh/hw_irq.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/include/asm-sh/ide.h linux-2.4.22/include/asm-sh/ide.h
@@ -15,13 +15,24 @@
 #ifdef __KERNEL__
 
 #include <linux/config.h>
+#include <asm-generic/ide_iops.h>
 #include <asm/machvec.h>
 
 #ifndef MAX_HWIFS
-/* Should never have less than 2, ide-pci.c(ide_match_hwif) requires it */
-#define MAX_HWIFS	2
+/* Should never have fewer than 2, ide-pci.c(ide_match_hwif) requires it */
+#define MAX_HWIFS	4
 #endif
 
+static __inline__ int ide_default_irq_hs7729pci(ide_ioreg_t base)
+{
+	switch (base) {
+		case 0x01f0: return 9;
+		case 0x0170: return 14;
+		default:
+			return 0;
+	}
+}
+
 static __inline__ int ide_default_irq_hp600(ide_ioreg_t base)
 {
 	switch (base) {
@@ -37,6 +48,9 @@
 	if (MACH_HP600) {
 		return ide_default_irq_hp600(base);
 	}
+	if (MACH_HS7729PCI) {
+		return ide_default_irq_hs7729pci(base);
+	}
 	switch (base) {
 		case 0x01f0: return 14;
 		case 0x0170: return 15;
@@ -98,6 +112,7 @@
 	int index;
 
 	for(index = 0; index < MAX_HWIFS; index++) {
+		memset(&hw, 0, sizeof hw);
 		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);
@@ -105,8 +120,6 @@
 #endif /* CONFIG_BLK_DEV_IDEPCI */
 }
 
-#include <asm-generic/ide_iops.h>
-
 #endif /* __KERNEL__ */
 
 #endif /* __ASM_SH_IDE_H */

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