## Automatically generated incremental diff
## From:   linux-2.5.73-bk4
## To:     linux-2.5.73-bk5
## Robot:  $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $

diff -urN linux-2.5.73-bk4/Makefile linux-2.5.73-bk5/Makefile
--- linux-2.5.73-bk4/Makefile	2003-06-27 04:49:29.000000000 -0700
+++ linux-2.5.73-bk5/Makefile	2003-06-27 04:49:33.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 5
 SUBLEVEL = 73
-EXTRAVERSION = -bk4
+EXTRAVERSION = -bk5
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
diff -urN linux-2.5.73-bk4/arch/alpha/Kconfig linux-2.5.73-bk5/arch/alpha/Kconfig
--- linux-2.5.73-bk4/arch/alpha/Kconfig	2003-06-22 11:33:06.000000000 -0700
+++ linux-2.5.73-bk5/arch/alpha/Kconfig	2003-06-27 04:49:33.000000000 -0700
@@ -665,33 +665,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI support"
-
-config SCSI
-	tristate "SCSI support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 if PCI
 source "drivers/message/fusion/Kconfig"
 endif
diff -urN linux-2.5.73-bk4/arch/arm/Kconfig linux-2.5.73-bk5/arch/arm/Kconfig
--- linux-2.5.73-bk4/arch/arm/Kconfig	2003-06-22 11:32:55.000000000 -0700
+++ linux-2.5.73-bk5/arch/arm/Kconfig	2003-06-27 04:49:33.000000000 -0700
@@ -898,33 +898,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI support"
-
-config SCSI
-	tristate "SCSI support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 source "drivers/ieee1394/Kconfig"
 
 source "drivers/message/i2o/Kconfig"
diff -urN linux-2.5.73-bk4/arch/arm26/Kconfig linux-2.5.73-bk5/arch/arm26/Kconfig
--- linux-2.5.73-bk4/arch/arm26/Kconfig	2003-06-22 11:32:56.000000000 -0700
+++ linux-2.5.73-bk5/arch/arm26/Kconfig	2003-06-27 04:49:33.000000000 -0700
@@ -364,32 +364,8 @@
 endmenu
 
 
-menu "SCSI support"
-
-config SCSI
-	tristate "SCSI support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 source "drivers/isdn/Kconfig"
 
 #
diff -urN linux-2.5.73-bk4/arch/cris/Kconfig linux-2.5.73-bk5/arch/cris/Kconfig
--- linux-2.5.73-bk4/arch/cris/Kconfig	2003-06-22 11:33:17.000000000 -0700
+++ linux-2.5.73-bk5/arch/cris/Kconfig	2003-06-27 04:49:33.000000000 -0700
@@ -533,33 +533,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI support"
-
-config SCSI
-	tristate "SCSI support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 source "drivers/ieee1394/Kconfig"
 
 source "drivers/message/i2o/Kconfig"
diff -urN linux-2.5.73-bk4/arch/i386/Kconfig linux-2.5.73-bk5/arch/i386/Kconfig
--- linux-2.5.73-bk4/arch/i386/Kconfig	2003-06-22 11:32:34.000000000 -0700
+++ linux-2.5.73-bk5/arch/i386/Kconfig	2003-06-27 04:49:33.000000000 -0700
@@ -1206,33 +1206,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI device support"
-
-config SCSI
-	tristate "SCSI device support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 
 menu "Old CD-ROM drivers (not SCSI, not IDE)"
 	depends on ISA
diff -urN linux-2.5.73-bk4/arch/i386/pci/direct.c linux-2.5.73-bk5/arch/i386/pci/direct.c
--- linux-2.5.73-bk4/arch/i386/pci/direct.c	2003-06-27 04:49:29.000000000 -0700
+++ linux-2.5.73-bk5/arch/i386/pci/direct.c	2003-06-27 04:49:33.000000000 -0700
@@ -201,54 +201,84 @@
 	return 0;
 }
 
-static int __init pci_direct_init(void)
+static int __init pci_check_type1(void)
 {
-	unsigned int tmp;
 	unsigned long flags;
+	unsigned int tmp;
+	int works = 0;
 
 	local_irq_save(flags);
 
-	/*
-	 * Check if configuration type 1 works.
-	 */
-	if (pci_probe & PCI_PROBE_CONF1) {
-		outb (0x01, 0xCFB);
-		tmp = inl (0xCF8);
-		outl (0x80000000, 0xCF8);
-		if (inl (0xCF8) == 0x80000000 &&
-		    pci_sanity_check(&pci_direct_conf1)) {
-			outl (tmp, 0xCF8);
-			local_irq_restore(flags);
-			printk(KERN_INFO "PCI: Using configuration type 1\n");
-			if (!request_region(0xCF8, 8, "PCI conf1"))
-				raw_pci_ops = NULL;
-			else
-				raw_pci_ops = &pci_direct_conf1;
-			return 0;
-		}
-		outl (tmp, 0xCF8);
+	outb(0x01, 0xCFB);
+	tmp = inl(0xCF8);
+	outl(0x80000000, 0xCF8);
+	if (inl(0xCF8) == 0x80000000 && pci_sanity_check(&pci_direct_conf1)) {
+		works = 1;
 	}
+	outl(tmp, 0xCF8);
+	local_irq_restore(flags);
+
+	return works;
+}
+
+static int __init pci_check_type2(void)
+{
+	unsigned long flags;
+	int works = 0;
+
+	local_irq_save(flags);
 
-	/*
-	 * Check if configuration type 2 works.
-	 */
-	if (pci_probe & PCI_PROBE_CONF2) {
-		outb (0x00, 0xCFB);
-		outb (0x00, 0xCF8);
-		outb (0x00, 0xCFA);
-		if (inb (0xCF8) == 0x00 && inb (0xCFA) == 0x00 &&
-		    pci_sanity_check(&pci_direct_conf2)) {
-			local_irq_restore(flags);
-			printk(KERN_INFO "PCI: Using configuration type 2\n");
-			if (!request_region(0xCF8, 4, "PCI conf2"))
-				raw_pci_ops = NULL;
-			else
-				raw_pci_ops = &pci_direct_conf2;
-			return 0;
-		}
+	outb(0x00, 0xCFB);
+	outb(0x00, 0xCF8);
+	outb(0x00, 0xCFA);
+	if (inb(0xCF8) == 0x00 && inb(0xCFA) == 0x00 &&
+	    pci_sanity_check(&pci_direct_conf2)) {
+		works = 1;
 	}
 
 	local_irq_restore(flags);
+
+	return works;
+}
+
+static int __init pci_direct_init(void)
+{
+	struct resource *region, *region2;
+
+	if ((pci_probe & PCI_PROBE_CONF1) == 0)
+		goto type2;
+	region = request_region(0xCF8, 8, "PCI conf1");
+	if (!region)
+		goto type2;
+
+	if (pci_check_type1()) {
+		printk(KERN_INFO "PCI: Using configuration type 1\n");
+		raw_pci_ops = &pci_direct_conf1;
+		return 0;
+	}
+	release_resource(region);
+
+ type2:
+	if ((!pci_probe & PCI_PROBE_CONF2) == 0)
+		goto out;
+	region = request_region(0xCF8, 4, "PCI conf2");
+	if (!region)
+		goto out;
+	region2 = request_region(0xC000, 0x1000, "PCI conf2");
+	if (!region2)
+		goto fail2;
+
+	if (pci_check_type2()) {
+		printk(KERN_INFO "PCI: Using configuration type 2\n");
+		raw_pci_ops = &pci_direct_conf2;
+		return 0;
+	}
+
+	release_resource(region2);
+ fail2:
+	release_resource(region);
+
+ out:
 	return 0;
 }
 
diff -urN linux-2.5.73-bk4/arch/ia64/Kconfig linux-2.5.73-bk5/arch/ia64/Kconfig
--- linux-2.5.73-bk4/arch/ia64/Kconfig	2003-06-27 04:49:29.000000000 -0700
+++ linux-2.5.73-bk5/arch/ia64/Kconfig	2003-06-27 04:49:33.000000000 -0700
@@ -557,32 +557,8 @@
 endif
 
 
-menu "SCSI support"
-
-config SCSI
-	tristate "SCSI support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 source "net/Kconfig"
 
 
diff -urN linux-2.5.73-bk4/arch/m68k/Kconfig linux-2.5.73-bk5/arch/m68k/Kconfig
--- linux-2.5.73-bk4/arch/m68k/Kconfig	2003-06-22 11:32:56.000000000 -0700
+++ linux-2.5.73-bk5/arch/m68k/Kconfig	2003-06-27 04:49:33.000000000 -0700
@@ -585,33 +585,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI device support"
-
-config SCSI
-	tristate "SCSI device support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 source "net/Kconfig"
 
 
diff -urN linux-2.5.73-bk4/arch/m68knommu/Kconfig linux-2.5.73-bk5/arch/m68knommu/Kconfig
--- linux-2.5.73-bk4/arch/m68knommu/Kconfig	2003-06-22 11:32:58.000000000 -0700
+++ linux-2.5.73-bk5/arch/m68knommu/Kconfig	2003-06-27 04:49:33.000000000 -0700
@@ -499,6 +499,7 @@
 	default y
 
 config KCORE_ELF
+	bool
 	default y
 
 source "fs/Kconfig.binfmt"
@@ -527,22 +528,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI device support"
-
-config SCSI
-	tristate "SCSI device support"
-	help
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 
 menu "Old CD-ROM drivers (not SCSI, not IDE)"
 	depends on ISA
diff -urN linux-2.5.73-bk4/arch/m68knommu/kernel/time.c linux-2.5.73-bk5/arch/m68knommu/kernel/time.c
--- linux-2.5.73-bk4/arch/m68knommu/kernel/time.c	2003-06-22 11:32:58.000000000 -0700
+++ linux-2.5.73-bk5/arch/m68knommu/kernel/time.c	2003-06-27 04:49:33.000000000 -0700
@@ -162,28 +162,33 @@
 	tv->tv_usec = usec;
 }
 
-void do_settimeofday(struct timeval *tv)
+int do_settimeofday(struct timespec *tv)
 {
+	if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
+		return -EINVAL;
+
 	write_seqlock_irq(&xtime_lock);
-	/* This is revolting. We need to set the xtime.tv_usec
+	/*
+	 * This is revolting. We need to set the xtime.tv_usec
 	 * correctly. However, the value in this location is
 	 * is value at the last tick.
 	 * Discover what correction gettimeofday
 	 * would have done, and then undo it!
 	 */
 	if (mach_gettimeoffset)
-		tv->tv_usec -= mach_gettimeoffset();
+		tv->tv_nsec -= (mach_gettimeoffset() * 1000);
 
-	while (tv->tv_usec < 0) {
-		tv->tv_usec += 1000000;
+	while (tv->tv_nsec < 0) {
+		tv->tv_nsec += NSEC_PER_SEC;
 		tv->tv_sec--;
 	}
 
 	xtime.tv_sec = tv->tv_sec;
-	xtime.tv_nsec = (tv->tv_usec * 1000);
+	xtime.tv_nsec = tv->tv_nsec;
 	time_adjust = 0;		/* stop active adjtime() */
 	time_status |= STA_UNSYNC;
 	time_maxerror = NTP_PHASE_LIMIT;
 	time_esterror = NTP_PHASE_LIMIT;
 	write_sequnlock_irq(&xtime_lock);
+	return 0;
 }
diff -urN linux-2.5.73-bk4/arch/mips/Kconfig-shared linux-2.5.73-bk5/arch/mips/Kconfig-shared
--- linux-2.5.73-bk4/arch/mips/Kconfig-shared	2003-06-27 04:49:29.000000000 -0700
+++ linux-2.5.73-bk5/arch/mips/Kconfig-shared	2003-06-27 04:49:33.000000000 -0700
@@ -1216,33 +1216,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI device support"
-
-config SCSI
-	tristate "SCSI device support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 
 menu "Old CD-ROM drivers (not SCSI, not IDE)"
 	depends on ISA
diff -urN linux-2.5.73-bk4/arch/parisc/Kconfig linux-2.5.73-bk5/arch/parisc/Kconfig
--- linux-2.5.73-bk4/arch/parisc/Kconfig	2003-06-22 11:32:56.000000000 -0700
+++ linux-2.5.73-bk5/arch/parisc/Kconfig	2003-06-27 04:49:34.000000000 -0700
@@ -182,33 +182,7 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI support"
-
-config SCSI
-	tristate "SCSI support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
-source drivers/scsi/Kconfig
-
-
-endmenu
+source "drivers/scsi/Kconfig"
 
 source "drivers/md/Kconfig"
 
diff -urN linux-2.5.73-bk4/arch/ppc/Kconfig linux-2.5.73-bk5/arch/ppc/Kconfig
--- linux-2.5.73-bk4/arch/ppc/Kconfig	2003-06-22 11:33:34.000000000 -0700
+++ linux-2.5.73-bk5/arch/ppc/Kconfig	2003-06-27 04:49:34.000000000 -0700
@@ -1175,33 +1175,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI support"
-
-config SCSI
-	tristate "SCSI support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 source "drivers/message/fusion/Kconfig"
 
 source "drivers/ieee1394/Kconfig"
diff -urN linux-2.5.73-bk4/arch/ppc64/Kconfig linux-2.5.73-bk5/arch/ppc64/Kconfig
--- linux-2.5.73-bk4/arch/ppc64/Kconfig	2003-06-22 11:32:55.000000000 -0700
+++ linux-2.5.73-bk5/arch/ppc64/Kconfig	2003-06-27 04:49:34.000000000 -0700
@@ -253,33 +253,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI device support"
-
-config SCSI
-	tristate "SCSI device support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 source "drivers/md/Kconfig"
 
 source "drivers/message/fusion/Kconfig"
diff -urN linux-2.5.73-bk4/arch/s390/Kconfig linux-2.5.73-bk5/arch/s390/Kconfig
--- linux-2.5.73-bk4/arch/s390/Kconfig	2003-06-22 11:32:42.000000000 -0700
+++ linux-2.5.73-bk5/arch/s390/Kconfig	2003-06-27 04:49:34.000000000 -0700
@@ -231,15 +231,8 @@
 
 source "drivers/base/Kconfig"
 
-menu "SCSI support"
-
-config SCSI
-	tristate "SCSI support"
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 source "drivers/s390/Kconfig"
 
 source "net/Kconfig"
diff -urN linux-2.5.73-bk4/arch/sh/Kconfig linux-2.5.73-bk5/arch/sh/Kconfig
--- linux-2.5.73-bk4/arch/sh/Kconfig	2003-06-22 11:33:34.000000000 -0700
+++ linux-2.5.73-bk5/arch/sh/Kconfig	2003-06-27 04:49:34.000000000 -0700
@@ -777,33 +777,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI device support"
-
-config SCSI
-	tristate "SCSI device support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 
 menu "Old CD-ROM drivers (not SCSI, not IDE)"
 
diff -urN linux-2.5.73-bk4/arch/sparc/Kconfig linux-2.5.73-bk5/arch/sparc/Kconfig
--- linux-2.5.73-bk4/arch/sparc/Kconfig	2003-06-22 11:32:27.000000000 -0700
+++ linux-2.5.73-bk5/arch/sparc/Kconfig	2003-06-27 04:49:34.000000000 -0700
@@ -481,33 +481,8 @@
 
 source "drivers/isdn/Kconfig"
 
-
-menu "SCSI support"
-
-config SCSI
-	tristate "SCSI support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 source "drivers/fc4/Kconfig"
 
 source "net/Kconfig"
diff -urN linux-2.5.73-bk4/arch/sparc/Makefile linux-2.5.73-bk5/arch/sparc/Makefile
--- linux-2.5.73-bk4/arch/sparc/Makefile	2003-06-22 11:32:33.000000000 -0700
+++ linux-2.5.73-bk5/arch/sparc/Makefile	2003-06-27 04:49:34.000000000 -0700
@@ -52,7 +52,9 @@
 CORE_Y		:= $(patsubst %/, %/built-in.o, $(CORE_Y))
 DRIVERS_Y	:= $(patsubst %/, %/built-in.o, $(drivers-y))
 NET_Y		:= $(patsubst %/, %/built-in.o, $(net-y))
-LIBS_Y		:= $(patsubst %/, %/lib.a, $(libs-y))
+LIBS_Y1		:= $(patsubst %/, %/lib.a, $(libs-y))
+LIBS_Y2		:= $(patsubst %/, %/built-in.o, $(libs-y))
+LIBS_Y		:= $(LIBS_Y1) $(LIBS_Y2)
 export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD_Y
 
 # Default target
diff -urN linux-2.5.73-bk4/arch/sparc64/Kconfig linux-2.5.73-bk5/arch/sparc64/Kconfig
--- linux-2.5.73-bk4/arch/sparc64/Kconfig	2003-06-22 11:33:15.000000000 -0700
+++ linux-2.5.73-bk5/arch/sparc64/Kconfig	2003-06-27 04:49:34.000000000 -0700
@@ -675,33 +675,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI support"
-
-config SCSI
-	tristate "SCSI support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 source "drivers/fc4/Kconfig"
 
 if PCI
diff -urN linux-2.5.73-bk4/arch/v850/Kconfig linux-2.5.73-bk5/arch/v850/Kconfig
--- linux-2.5.73-bk4/arch/v850/Kconfig	2003-06-22 11:32:43.000000000 -0700
+++ linux-2.5.73-bk5/arch/v850/Kconfig	2003-06-27 04:49:34.000000000 -0700
@@ -265,15 +265,6 @@
 
 source "drivers/ide/Kconfig"
 
-config SCSI
-	tristate "SCSI device support"
-	help
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
 source "drivers/scsi/Kconfig"
 
 endmenu
diff -urN linux-2.5.73-bk4/arch/x86_64/Kconfig linux-2.5.73-bk5/arch/x86_64/Kconfig
--- linux-2.5.73-bk4/arch/x86_64/Kconfig	2003-06-22 11:33:07.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/Kconfig	2003-06-27 04:49:34.000000000 -0700
@@ -407,33 +407,8 @@
 
 source "drivers/ide/Kconfig"
 
-
-menu "SCSI device support"
-
-config SCSI
-	tristate "SCSI device support"
-	---help---
-	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
-	  any other SCSI device under Linux, say Y and make sure that you know
-	  the name of your SCSI host adapter (the card inside your computer
-	  that "speaks" the SCSI protocol, also called SCSI controller),
-	  because you will be asked for it.
-
-	  You also need to say Y here if you want support for the parallel
-	  port version of the 100 MB IOMEGA ZIP drive.
-
-	  This driver is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called scsi_mod.  If you want to compile it as
-	  a module, say M here and read <file:Documentation/modules.txt> and
-	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
-	  module if your root file system (the one containing the directory /)
-	  is located on a SCSI device.
-
 source "drivers/scsi/Kconfig"
 
-endmenu
-
 source "drivers/md/Kconfig"
 
 source "drivers/telephony/Kconfig"
diff -urN linux-2.5.73-bk4/arch/x86_64/ia32/ia32_binfmt.c linux-2.5.73-bk5/arch/x86_64/ia32/ia32_binfmt.c
--- linux-2.5.73-bk4/arch/x86_64/ia32/ia32_binfmt.c	2003-06-22 11:32:31.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/ia32/ia32_binfmt.c	2003-06-27 04:49:34.000000000 -0700
@@ -30,10 +30,12 @@
 #define AT_SYSINFO 32
 #define AT_SYSINFO_EHDR		33
 
+#if 0 /* disabled for now because the code has still problems */
 #define ARCH_DLINFO do {  \
 	NEW_AUX_ENT(AT_SYSINFO, (u32)(u64)VSYSCALL32_VSYSCALL); \
 	NEW_AUX_ENT(AT_SYSINFO_EHDR, VSYSCALL32_BASE);    \
 } while(0)
+#endif
 
 struct file;
 struct elf_phdr; 
diff -urN linux-2.5.73-bk4/arch/x86_64/ia32/ia32_ioctl.c linux-2.5.73-bk5/arch/x86_64/ia32/ia32_ioctl.c
--- linux-2.5.73-bk4/arch/x86_64/ia32/ia32_ioctl.c	2003-06-22 11:32:55.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/ia32/ia32_ioctl.c	2003-06-27 04:49:34.000000000 -0700
@@ -552,7 +552,7 @@
 	set_fs(old_fs);
 
 	if (err >= 0 &&
-	    put_user(((u32)(long)kptr), compat_ptr(arg)))
+	    put_user((u32)(u64)kptr, (u32 *)arg))
 		err = -EFAULT;
 
 	return err;
diff -urN linux-2.5.73-bk4/arch/x86_64/ia32/ptrace32.c linux-2.5.73-bk5/arch/x86_64/ia32/ptrace32.c
--- linux-2.5.73-bk4/arch/x86_64/ia32/ptrace32.c	2003-06-22 11:32:38.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/ia32/ptrace32.c	2003-06-27 04:49:34.000000000 -0700
@@ -210,6 +210,7 @@
 		return child; 
 	} 
  out:
+	if (child)
 	put_task_struct(child);
 	return NULL; 
 	
diff -urN linux-2.5.73-bk4/arch/x86_64/ia32/sys_ia32.c linux-2.5.73-bk5/arch/x86_64/ia32/sys_ia32.c
--- linux-2.5.73-bk4/arch/x86_64/ia32/sys_ia32.c	2003-06-22 11:32:43.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/ia32/sys_ia32.c	2003-06-27 04:49:34.000000000 -0700
@@ -946,10 +946,30 @@
 	struct sysinfo s;
 	int ret;
 	mm_segment_t old_fs = get_fs ();
+	int bitcount = 0;
 	
 	set_fs (KERNEL_DS);
 	ret = sys_sysinfo(&s);
 	set_fs (old_fs);
+
+        /* Check to see if any memory value is too large for 32-bit and scale
+	 *  down if needed
+	 */
+	if ((s.totalram >> 32) || (s.totalswap >> 32)) {
+		while (s.mem_unit < PAGE_SIZE) {
+			s.mem_unit <<= 1;
+			bitcount++;
+		}
+		s.totalram >>= bitcount;
+		s.freeram >>= bitcount;
+		s.sharedram >>= bitcount;
+		s.bufferram >>= bitcount;
+		s.totalswap >>= bitcount;
+		s.freeswap >>= bitcount;
+		s.totalhigh >>= bitcount;
+		s.freehigh >>= bitcount;
+	}
+
 	if (verify_area(VERIFY_WRITE, info, sizeof(struct sysinfo32)) ||
 	    __put_user (s.uptime, &info->uptime) ||
 	    __put_user (s.loads[0], &info->loads[0]) ||
diff -urN linux-2.5.73-bk4/arch/x86_64/kernel/acpi/boot.c linux-2.5.73-bk5/arch/x86_64/kernel/acpi/boot.c
--- linux-2.5.73-bk4/arch/x86_64/kernel/acpi/boot.c	2003-06-22 11:32:36.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/kernel/acpi/boot.c	2003-06-27 04:49:34.000000000 -0700
@@ -100,7 +100,7 @@
 	if (madt->lapic_address)
 		acpi_lapic_addr = (u64) madt->lapic_address;
 
-	printk(KERN_INFO PREFIX "Local APIC address 0x%08x\n",
+	printk(KERN_INFO PREFIX "Local APIC address 0x%016x\n",
 		madt->lapic_address);
 
 	return 0;
diff -urN linux-2.5.73-bk4/arch/x86_64/kernel/i8259.c linux-2.5.73-bk5/arch/x86_64/kernel/i8259.c
--- linux-2.5.73-bk4/arch/x86_64/kernel/i8259.c	2003-06-22 11:32:34.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/kernel/i8259.c	2003-06-27 04:49:34.000000000 -0700
@@ -26,9 +26,6 @@
 
 #include <linux/irq.h>
 
-/* When we have things working, we can switch to always use
-   IOAPIC. --pavel */
-
 /*
  * Common place to define all x86 IRQ vectors
  *
diff -urN linux-2.5.73-bk4/arch/x86_64/kernel/module.c linux-2.5.73-bk5/arch/x86_64/kernel/module.c
--- linux-2.5.73-bk4/arch/x86_64/kernel/module.c	2003-06-22 11:33:16.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/kernel/module.c	2003-06-27 04:49:34.000000000 -0700
@@ -31,9 +31,6 @@
 
 #define DEBUGP(fmt...) 
  
-/* TODO this should be in vmlist, but we must fix get_vm_area first to 
-   handle out of bounds entries properly. 
-   Also need to fix /proc/kcore, /dev/kmem */
 static struct vm_struct *mod_vmlist;
 
 void module_free(struct module *mod, void *module_region)
diff -urN linux-2.5.73-bk4/arch/x86_64/kernel/nmi.c linux-2.5.73-bk5/arch/x86_64/kernel/nmi.c
--- linux-2.5.73-bk4/arch/x86_64/kernel/nmi.c	2003-06-22 11:32:43.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/kernel/nmi.c	2003-06-27 04:49:34.000000000 -0700
@@ -34,7 +34,7 @@
 
 extern void default_do_nmi(struct pt_regs *);
 
-unsigned int nmi_watchdog = NMI_LOCAL_APIC;
+unsigned int nmi_watchdog = NMI_IO_APIC;
 static unsigned int nmi_hz = HZ;
 unsigned int nmi_perfctr_msr;	/* the MSR to reset in NMI handler */
 int nmi_watchdog_disabled;
@@ -153,17 +153,19 @@
 
 #include <linux/device.h>
 
+static int nmi_pm_active; /* nmi_active before suspend */
+
 static int lapic_nmi_suspend(struct sys_device *dev, u32 state)
 {
+	nmi_pm_active = nmi_active;
 	disable_lapic_nmi_watchdog();
 	return 0;
 }
 
 static int lapic_nmi_resume(struct sys_device *dev)
 {
-#if 0
+	if (nmi_pm_active > 0)
 	enable_lapic_nmi_watchdog();
-#endif
 	return 0;
 }
 
@@ -235,6 +237,8 @@
 	case X86_VENDOR_AMD:
 		if (boot_cpu_data.x86 < 6)
 			return;
+		if (strstr(boot_cpu_data.x86_model_id, "Screwdriver"))
+			return;
 		setup_k7_watchdog();
 		break;
 	default:
diff -urN linux-2.5.73-bk4/arch/x86_64/kernel/pci-gart.c linux-2.5.73-bk5/arch/x86_64/kernel/pci-gart.c
--- linux-2.5.73-bk4/arch/x86_64/kernel/pci-gart.c	2003-06-22 11:32:43.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/kernel/pci-gart.c	2003-06-27 04:49:34.000000000 -0700
@@ -236,7 +236,7 @@
 	static int dump; 
 	if (dump || !iommu_leak_tab) return;
 	dump = 1;
-	show_stack(NULL);
+	show_stack(NULL,NULL);
 	/* Very crude. dump some from the end of the table too */ 
 	printk("Dumping %d pages from end of IOMMU:\n", iommu_leak_pages); 
 	for (i = 0; i < iommu_leak_pages; i+=2) {
diff -urN linux-2.5.73-bk4/arch/x86_64/kernel/suspend.c linux-2.5.73-bk5/arch/x86_64/kernel/suspend.c
--- linux-2.5.73-bk4/arch/x86_64/kernel/suspend.c	2003-06-22 11:32:45.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/kernel/suspend.c	2003-06-27 04:49:34.000000000 -0700
@@ -121,11 +121,12 @@
 	struct tss_struct * t = init_tss + cpu;
 
 	set_tss_desc(cpu,t);	/* This just modifies memory; should not be neccessary. But... This is neccessary, because 386 hardware has concept of busy TSS or some similar stupidity. */
-        ((struct n_desc_struct *) &cpu_gdt_table[cpu][GDT_ENTRY_TSS])->b &= 0xfffffdff;
+
+	cpu_gdt_table[cpu][GDT_ENTRY_TSS].type = 9;
 
 	syscall_init();                         /* This sets MSR_*STAR and related */
 	load_TR_desc();				/* This does ltr */
-	load_LDT(&current->mm->context);	/* This does lldt */
+	load_LDT(&current->active_mm->context);	/* This does lldt */
 
 	/*
 	 * Now maybe reload the debug registers
diff -urN linux-2.5.73-bk4/arch/x86_64/kernel/time.c linux-2.5.73-bk5/arch/x86_64/kernel/time.c
--- linux-2.5.73-bk4/arch/x86_64/kernel/time.c	2003-06-22 11:32:58.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/kernel/time.c	2003-06-27 04:49:34.000000000 -0700
@@ -47,6 +47,7 @@
 unsigned long hpet_tick;				/* HPET clocks / interrupt */
 unsigned long vxtime_hz = 1193182;
 int report_lost_ticks;				/* command line option */
+unsigned long long monotonic_base;
 
 struct vxtime_data __vxtime __section_vxtime;	/* for vsyscalls */
 
@@ -137,6 +138,18 @@
 		tv->tv_sec--;
 	}
 
+	wall_to_monotonic.tv_sec += xtime.tv_sec - tv->tv_sec;
+	wall_to_monotonic.tv_nsec += xtime.tv_nsec - tv->tv_nsec;
+
+	if (wall_to_monotonic.tv_nsec > NSEC_PER_SEC) {
+		wall_to_monotonic.tv_nsec -= NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec++;
+	}
+	if (wall_to_monotonic.tv_nsec < 0) {
+		wall_to_monotonic.tv_nsec += NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec--;
+	}
+
 	xtime.tv_sec = tv->tv_sec;
 	xtime.tv_nsec = tv->tv_nsec;
 
@@ -219,6 +232,47 @@
 	spin_unlock(&rtc_lock);
 }
 
+
+/* monotonic_clock(): returns # of nanoseconds passed since time_init()
+ *		Note: This function is required to return accurate
+ *		time even in the absence of multiple timer ticks.
+ */
+unsigned long long monotonic_clock(void)
+{
+	unsigned long seq;
+ 	u32 last_offset, this_offset, offset;
+	unsigned long long base;
+
+	if (vxtime.mode == VXTIME_HPET) {
+		do {
+			seq = read_seqbegin(&xtime_lock);
+
+			last_offset = vxtime.last;
+			base = monotonic_base;
+			this_offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
+
+		} while (read_seqretry(&xtime_lock, seq));
+		offset = (this_offset - last_offset);
+		offset *=(NSEC_PER_SEC/HZ)/hpet_tick;
+		return base + offset;
+	}else{
+		do {
+			seq = read_seqbegin(&xtime_lock);
+
+			last_offset = vxtime.last_tsc;
+			base = monotonic_base;
+		} while (read_seqretry(&xtime_lock, seq));
+		sync_core();
+		rdtscll(this_offset);
+		offset = (this_offset - last_offset)*1000/cpu_khz; 
+		return base + offset;
+	}
+
+
+}
+EXPORT_SYMBOL(monotonic_clock);
+
+
 static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	static unsigned long rtc_update = 0;
@@ -253,6 +307,9 @@
 			lost = (offset - vxtime.last) / hpet_tick - 1;
 		}
 
+		monotonic_base += 
+			(offset - vxtime.last)*(NSEC_PER_SEC/HZ) / hpet_tick;
+
 		vxtime.last = offset;
 	} else {
 		offset = (((tsc - vxtime.last_tsc) *
@@ -266,6 +323,8 @@
 			offset %= (USEC_PER_SEC / HZ);
 		}
 
+		monotonic_base += (tsc - vxtime.last_tsc)*1000000/cpu_khz ;
+
 		vxtime.last_tsc = tsc - vxtime.quot * delay / vxtime.tsc_quot;
 
 		if ((((tsc - vxtime.last_tsc) *
@@ -544,6 +603,9 @@
 	xtime.tv_sec = get_cmos_time();
 	xtime.tv_nsec = 0;
 
+	wall_to_monotonic.tv_sec = -xtime.tv_sec;
+	wall_to_monotonic.tv_nsec = -xtime.tv_nsec;
+
 	if (!hpet_init()) {
                 vxtime_hz = (1000000000000000L + hpet_period / 2) /
 			hpet_period;
diff -urN linux-2.5.73-bk4/arch/x86_64/kernel/traps.c linux-2.5.73-bk5/arch/x86_64/kernel/traps.c
--- linux-2.5.73-bk4/arch/x86_64/kernel/traps.c	2003-06-22 11:32:29.000000000 -0700
+++ linux-2.5.73-bk5/arch/x86_64/kernel/traps.c	2003-06-27 04:49:34.000000000 -0700
@@ -27,6 +27,7 @@
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -206,7 +207,7 @@
 	show_trace((unsigned long *)rsp);
 }
 
-void show_stack(unsigned long * rsp)
+void show_stack(struct task_struct *tsk, unsigned long * rsp)
 {
 	unsigned long *stack;
 	int i;
@@ -214,7 +215,7 @@
 	unsigned long *irqstack_end = (unsigned long *) (cpu_pda[cpu].irqstackptr);
 	unsigned long *irqstack = (unsigned long *) (cpu_pda[cpu].irqstackptr - IRQSTACKSIZE);    
 
-	// debugging aid: "show_stack(NULL);" prints the
+	// debugging aid: "show_stack(NULL, NULL);" prints the
 	// back trace for this cpu.
 
 	if(rsp==NULL)
@@ -269,7 +270,7 @@
 	if (in_kernel) {
 
 		printk("Stack: ");
-		show_stack((unsigned long*)rsp);
+		show_stack(NULL, (unsigned long*)rsp);
 
 		printk("\nCode: ");
 		if(regs->rip < PAGE_OFFSET)
@@ -831,3 +832,4 @@
 	 */
 	cpu_init();
 }
+
diff -urN linux-2.5.73-bk4/drivers/acpi/osl.c linux-2.5.73-bk5/drivers/acpi/osl.c
--- linux-2.5.73-bk4/drivers/acpi/osl.c	2003-06-27 04:49:29.000000000 -0700
+++ linux-2.5.73-bk5/drivers/acpi/osl.c	2003-06-27 04:49:34.000000000 -0700
@@ -935,8 +935,8 @@
 }
 
 /* Assumes no unreadable holes inbetween */
-BOOLEAN
-acpi_os_readable(void *ptr, u32 len)
+u8
+acpi_os_readable(void *ptr, acpi_size len)
 {
 #if defined(__i386__) || defined(__x86_64__) 
 	char tmp;
@@ -945,8 +945,8 @@
 	return 1;
 }
 
-BOOLEAN
-acpi_os_writable(void *ptr, u32 len)
+u8
+acpi_os_writable(void *ptr, acpi_size len)
 {
 	/* could do dummy write (racy) or a kernel page table lookup.
 	   The later may be difficult at early boot when kmap doesn't work yet. */
diff -urN linux-2.5.73-bk4/drivers/ieee1394/Makefile linux-2.5.73-bk5/drivers/ieee1394/Makefile
--- linux-2.5.73-bk4/drivers/ieee1394/Makefile	2003-06-22 11:33:34.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/Makefile	2003-06-27 04:49:34.000000000 -0700
@@ -18,6 +18,9 @@
 
 clean-files := oui.c
 
+quiet_cmd_oui2c = OUI2C   $@
+      cmd_oui2c = $(CONFIG_SHELL) $(obj)/oui2c.sh < $(obj)/oui.db > $@
+
 $(obj)/oui.o: $(obj)/oui.c
 $(obj)/oui.c: $(obj)/oui.db $(obj)/oui2c.sh
-	$(CONFIG_SHELL) $(obj)/oui2c.sh < $(obj)/oui.db > $@
+	$(call if_changed,oui2c)
diff -urN linux-2.5.73-bk4/drivers/ieee1394/amdtp.c linux-2.5.73-bk5/drivers/ieee1394/amdtp.c
--- linux-2.5.73-bk4/drivers/ieee1394/amdtp.c	2003-06-22 11:32:56.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/amdtp.c	2003-06-27 04:49:34.000000000 -0700
@@ -732,7 +732,7 @@
 
 	/* Fill IEEE1394 headers */
 	packet->db->header_desc.header[0] =
-		(SPEED_100 << 16) | (0x01 << 14) | 
+		(IEEE1394_SPEED_100 << 16) | (0x01 << 14) | 
 		(s->iso_channel << 8) | (TCODE_ISO_DATA << 4);
 	packet->db->header_desc.header[1] = size << 16;
 	
diff -urN linux-2.5.73-bk4/drivers/ieee1394/cmp.c linux-2.5.73-bk5/drivers/ieee1394/cmp.c
--- linux-2.5.73-bk4/drivers/ieee1394/cmp.c	2003-06-22 11:33:05.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/cmp.c	2003-06-27 04:49:34.000000000 -0700
@@ -138,7 +138,7 @@
 	}
 
 	ch->host = host;
-	ch->u.ompr.rate = SPEED_100;
+	ch->u.ompr.rate = IEEE1394_SPEED_100;
 	ch->u.ompr.bcast_channel_base = 63;
 	ch->u.ompr.nplugs = 2;
 
diff -urN linux-2.5.73-bk4/drivers/ieee1394/csr.h linux-2.5.73-bk5/drivers/ieee1394/csr.h
--- linux-2.5.73-bk4/drivers/ieee1394/csr.h	2003-06-22 11:32:31.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/csr.h	2003-06-27 04:49:34.000000000 -0700
@@ -2,6 +2,10 @@
 #ifndef _IEEE1394_CSR_H
 #define _IEEE1394_CSR_H
 
+#ifdef CONFIG_PREEMPT
+#include <linux/sched.h>
+#endif
+
 #define CSR_REGISTER_BASE  0xfffff0000000ULL
 
 /* register offsets relative to CSR_REGISTER_BASE */
diff -urN linux-2.5.73-bk4/drivers/ieee1394/dma.c linux-2.5.73-bk5/drivers/ieee1394/dma.c
--- linux-2.5.73-bk4/drivers/ieee1394/dma.c	2003-06-22 11:32:46.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/dma.c	2003-06-27 04:49:34.000000000 -0700
@@ -31,7 +31,7 @@
 	prog->n_pages = n_bytes / PAGE_SIZE;
 
 	prog->kvirt = pci_alloc_consistent(dev, prog->n_pages * PAGE_SIZE, &prog->bus_addr);
-	if(!prog->kvirt) {
+	if (!prog->kvirt) {
 		printk(KERN_ERR "dma_prog_region_alloc: pci_alloc_consistent() failed\n");
 		dma_prog_region_free(prog);
 		return -ENOMEM;
@@ -44,7 +44,7 @@
 
 void dma_prog_region_free(struct dma_prog_region *prog)
 {
-	if(prog->kvirt) {
+	if (prog->kvirt) {
 		pci_free_consistent(prog->dev, prog->n_pages * PAGE_SIZE, prog->kvirt, prog->bus_addr);
 	}
 
@@ -75,7 +75,7 @@
 	n_pages = n_bytes / PAGE_SIZE;
 
 	dma->kvirt = vmalloc_32(n_pages * PAGE_SIZE);
-	if(!dma->kvirt) {
+	if (!dma->kvirt) {
 		printk(KERN_ERR "dma_region_alloc: vmalloc_32() failed\n");
 		goto err;
 	}
@@ -87,7 +87,7 @@
 
 	/* allocate scatter/gather list */
 	dma->sglist = kmalloc(dma->n_pages * sizeof(struct scatterlist), GFP_KERNEL);
-	if(!dma->sglist) {
+	if (!dma->sglist) {
 		printk(KERN_ERR "dma_region_alloc: kmalloc(sglist) failed\n");
 		goto err;
 	}
@@ -96,7 +96,7 @@
 	memset(dma->sglist, 0, dma->n_pages * sizeof(struct scatterlist));
 
 	/* fill scatter/gather list with pages */
-	for(i = 0; i < dma->n_pages; i++) {
+	for (i = 0; i < dma->n_pages; i++) {
 		unsigned long va = (unsigned long) dma->kvirt + i * PAGE_SIZE;
 			
 		dma->sglist[i].page = vmalloc_to_page((void *)va);
@@ -106,7 +106,7 @@
 	/* map sglist to the IOMMU */
 	dma->n_dma_pages = pci_map_sg(dev, &dma->sglist[0], dma->n_pages, direction);
 
-	if(dma->n_dma_pages == 0) {
+	if (dma->n_dma_pages == 0) {
 		printk(KERN_ERR "dma_region_alloc: pci_map_sg() failed\n");
 		goto err;
 	}
@@ -123,18 +123,18 @@
 
 void dma_region_free(struct dma_region *dma)
 {
-	if(dma->n_dma_pages) {
+	if (dma->n_dma_pages) {
 		pci_unmap_sg(dma->dev, dma->sglist, dma->n_pages, dma->direction);
 		dma->n_dma_pages = 0;
 		dma->dev = NULL;
 	}
 
-	if(dma->sglist) {
+	if (dma->sglist) {
 		kfree(dma->sglist);
 		dma->sglist = NULL;
 	}
 
-	if(dma->kvirt) {
+	if (dma->kvirt) {
 		vfree(dma->kvirt);
 		dma->kvirt = NULL;
 		dma->n_pages = 0;
@@ -148,8 +148,8 @@
 	int i;
 	unsigned long off = offset;
 
-	for(i = 0; i < dma->n_dma_pages; i++) {
-		if(off < sg_dma_len(&dma->sglist[i])) {
+	for (i = 0; i < dma->n_dma_pages; i++) {
+		if (off < sg_dma_len(&dma->sglist[i])) {
 			*rem = off;
 			return i;
 		}
@@ -173,7 +173,7 @@
 	int first, last;
 	unsigned long rem;
 
-	if(!len)
+	if (!len)
 		len = 1;
 
 	first = dma_region_find(dma, offset, &rem);
@@ -193,10 +193,10 @@
 
 	struct dma_region *dma = (struct dma_region*) area->vm_private_data;
 
-	if(!dma->kvirt)
+	if (!dma->kvirt)
 		goto out;
 
-	if( (address < (unsigned long) area->vm_start) ||
+	if ( (address < (unsigned long) area->vm_start) ||
 	    (address > (unsigned long) area->vm_start + (PAGE_SIZE * dma->n_pages)) )
 		goto out;
 
@@ -216,16 +216,16 @@
 {
 	unsigned long size;
 
-	if(!dma->kvirt)
+	if (!dma->kvirt)
 		return -EINVAL;
 
 	/* must be page-aligned */
-	if(vma->vm_pgoff != 0)
+	if (vma->vm_pgoff != 0)
 		return -EINVAL;
 
 	/* check the length */
 	size = vma->vm_end - vma->vm_start;
-	if(size > (PAGE_SIZE * dma->n_pages))
+	if (size > (PAGE_SIZE * dma->n_pages))
 		return -EINVAL;
 
 	vma->vm_ops = &dma_region_vm_ops;
diff -urN linux-2.5.73-bk4/drivers/ieee1394/dma.h linux-2.5.73-bk5/drivers/ieee1394/dma.h
--- linux-2.5.73-bk4/drivers/ieee1394/dma.h	2003-06-22 11:33:12.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/dma.h	2003-06-27 04:49:34.000000000 -0700
@@ -76,7 +76,7 @@
 /* round up a number of bytes to be a multiple of the PAGE_SIZE */
 static inline unsigned long round_up_to_page(unsigned long len)
 {
-	if(len % PAGE_SIZE)
+	if (len % PAGE_SIZE)
 		len += PAGE_SIZE - (len % PAGE_SIZE);
 	return len;
 }
diff -urN linux-2.5.73-bk4/drivers/ieee1394/dv1394-private.h linux-2.5.73-bk5/drivers/ieee1394/dv1394-private.h
--- linux-2.5.73-bk4/drivers/ieee1394/dv1394-private.h	2003-06-22 11:32:57.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/dv1394-private.h	2003-06-27 04:49:34.000000000 -0700
@@ -97,7 +97,7 @@
 	omi->q[3] = 0;
 	
 	/* IT packet header */
-	omi->q[4] = cpu_to_le32(  (0x0 << 16)  /* DMA_SPEED_100 */
+	omi->q[4] = cpu_to_le32(  (0x0 << 16)  /* IEEE1394_SPEED_100 */
 				  | (tag << 14)
 				  | (channel << 8)
 				  | (TCODE_ISO_DATA << 4) 
@@ -129,10 +129,10 @@
 	u32 temp = 0;
 	temp |= 1 << 28; /* OUTPUT_LAST */
 
-	if(want_timestamp) /* controller will update timestamp at DMA time */
+	if (want_timestamp) /* controller will update timestamp at DMA time */
 		temp |= 1 << 27;
 
-	if(want_interrupt)
+	if (want_interrupt)
 		temp |= 3 << 20;
 
 	temp |= 3 << 18; /* must take branch */
diff -urN linux-2.5.73-bk4/drivers/ieee1394/dv1394.c linux-2.5.73-bk5/drivers/ieee1394/dv1394.c
--- linux-2.5.73-bk4/drivers/ieee1394/dv1394.c	2003-06-22 11:33:03.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/dv1394.c	2003-06-27 04:49:34.000000000 -0700
@@ -201,14 +201,14 @@
 static struct frame* frame_new(unsigned int frame_num, struct video_card *video)
 {
 	struct frame *f = kmalloc(sizeof(*f), GFP_KERNEL);
-	if(!f)
+	if (!f)
 		return NULL;
 
 	f->video = video;
 	f->frame_num = frame_num;
 
 	f->header_pool = pci_alloc_consistent(f->video->ohci->dev, PAGE_SIZE, &f->header_pool_dma);
-	if(!f->header_pool) {
+	if (!f->header_pool) {
 		printk(KERN_ERR "dv1394: failed to allocate CIP header pool\n");
 		kfree(f);
 		return NULL;
@@ -224,7 +224,7 @@
 	f->descriptor_pool = pci_alloc_consistent(f->video->ohci->dev,
 						  f->descriptor_pool_size,
 						  &f->descriptor_pool_dma);
-	if(!f->descriptor_pool) {
+	if (!f->descriptor_pool) {
 		pci_free_consistent(f->video->ohci->dev, PAGE_SIZE, f->header_pool, f->header_pool_dma);
 		kfree(f);
 		return NULL;
@@ -284,12 +284,12 @@
 
 
 
-	if(video->pal_or_ntsc == DV1394_PAL)
+	if (video->pal_or_ntsc == DV1394_PAL)
 		packets_per_frame = DV1394_PAL_PACKETS_PER_FRAME;
 	else
 		packets_per_frame = DV1394_NTSC_PACKETS_PER_FRAME;
 
-	while( full_packets < packets_per_frame ) {
+	while ( full_packets < packets_per_frame ) {
 		empty_packet = first_packet = last_packet = mid_packet = 0;
 
 		data_p = f->data + full_packets * 480;
@@ -300,7 +300,7 @@
 
 		/* note: these should NOT cross a page boundary (DMA restriction) */
 
-		if(f->n_packets >= MAX_PACKETS) {
+		if (f->n_packets >= MAX_PACKETS) {
 			printk(KERN_ERR "dv1394: FATAL ERROR: max packet count exceeded\n");
 			return;
 		}
@@ -316,7 +316,7 @@
 		
 
 		/* the whole CIP pool fits on one page, so no worries about boundaries */
-		if( ((unsigned long) &(f->header_pool[f->n_packets]) - (unsigned long) f->header_pool) 
+		if ( ((unsigned long) &(f->header_pool[f->n_packets]) - (unsigned long) f->header_pool) 
 		    > PAGE_SIZE) {
 			printk(KERN_ERR "dv1394: FATAL ERROR: no room to allocate CIP header\n");
 			return;
@@ -331,7 +331,7 @@
 		
 		/* is this an empty packet? */
 
-		if(video->cip_accum > (video->cip_d - video->cip_n)) {
+		if (video->cip_accum > (video->cip_d - video->cip_n)) {
 			empty_packet = 1;
 			payload_size = 8;
 			video->cip_accum -= (video->cip_d - video->cip_n);
@@ -364,7 +364,7 @@
 				   the timestamp before DMA starts on the next frame.
 		*/
 		
-		if(f->n_packets == 0) {
+		if (f->n_packets == 0) {
 			first_packet = 1;
 		} else if ( full_packets == (packets_per_frame-1) ) {
 			last_packet = 1;
@@ -383,12 +383,12 @@
 		   need a timestamp. */
 
 		/* first packet in the frame needs a timestamp */
-		if(first_packet) {
+		if (first_packet) {
 			f->cip_syt1 = cip;
-			if(empty_packet)
+			if (empty_packet)
 				first_packet_empty = 1;
 
-		} else if(first_packet_empty && (f->n_packets == 1) ) {
+		} else if (first_packet_empty && (f->n_packets == 1) ) {
 			/* if the first packet was empty, the second
 			   packet's CIP header also needs a timestamp */
 			f->cip_syt2 = cip;
@@ -402,7 +402,7 @@
 				0xFFFF /* the timestamp is filled in later */);
 		
 		/* advance counter, only for full packets */
-		if( ! empty_packet )
+		if ( ! empty_packet )
 			video->continuity_counter++;
 
 		/******************************/
@@ -412,7 +412,7 @@
 		/* first descriptor - OUTPUT_MORE_IMMEDIATE, for the controller's IT header */
 		fill_output_more_immediate( &(block->u.out.omi), 1, video->channel, 0, payload_size);
 
-		if(empty_packet) {
+		if (empty_packet) {
 			/* second descriptor - OUTPUT_LAST for CIP header */
 			fill_output_last( &(block->u.out.u.empty.ol),
 
@@ -425,18 +425,18 @@
 					  sizeof(struct CIP_header), /* data size */
 					  cip_dma);
 			
-			if(first_packet)
+			if (first_packet)
 				f->frame_begin_timestamp = &(block->u.out.u.empty.ol.q[3]);
-			else if(mid_packet)
+			else if (mid_packet)
 				f->mid_frame_timestamp = &(block->u.out.u.empty.ol.q[3]);
-			else if(last_packet) {
+			else if (last_packet) {
 				f->frame_end_timestamp = &(block->u.out.u.empty.ol.q[3]);
 				f->frame_end_branch = &(block->u.out.u.empty.ol.q[2]);
 			}
 
 			branch_address = &(block->u.out.u.empty.ol.q[2]);
 			n_descriptors = 3;
-			if(first_packet)
+			if (first_packet)
 				f->first_n_descriptors = n_descriptors;
 
 		} else { /* full packet */
@@ -452,7 +452,7 @@
 			   we need to split it into two DMA descriptors */
 
 			/* does the 480-byte data payload cross a page boundary? */
-			if( (PAGE_SIZE- ((unsigned long)data_p % PAGE_SIZE) ) < 480 ) {
+			if ( (PAGE_SIZE- ((unsigned long)data_p % PAGE_SIZE) ) < 480 ) {
 
 				/* page boundary crossed */
 
@@ -479,11 +479,11 @@
 						  dma_region_offset_to_bus(&video->dv_buf,
 									   data_p + PAGE_SIZE - (data_p % PAGE_SIZE) - (unsigned long) video->dv_buf.kvirt));
 
-				if(first_packet)
+				if (first_packet)
 					f->frame_begin_timestamp = &(block->u.out.u.full.u.cross.ol.q[3]);
-				else if(mid_packet)
+				else if (mid_packet)
 					f->mid_frame_timestamp = &(block->u.out.u.full.u.cross.ol.q[3]);
-				else if(last_packet) {
+				else if (last_packet) {
 					f->frame_end_timestamp = &(block->u.out.u.full.u.cross.ol.q[3]);
 					f->frame_end_branch = &(block->u.out.u.full.u.cross.ol.q[2]);
 				}
@@ -491,7 +491,7 @@
 				branch_address = &(block->u.out.u.full.u.cross.ol.q[2]);
 
 				n_descriptors = 5;
-				if(first_packet)
+				if (first_packet)
 					f->first_n_descriptors = n_descriptors;
 				
 				full_packets++;
@@ -514,11 +514,11 @@
 						  dma_region_offset_to_bus(&video->dv_buf,
 									   data_p - (unsigned long) video->dv_buf.kvirt));
 				
-				if(first_packet)
+				if (first_packet)
 					f->frame_begin_timestamp = &(block->u.out.u.full.u.nocross.ol.q[3]);
-				else if(mid_packet)
+				else if (mid_packet)
 					f->mid_frame_timestamp = &(block->u.out.u.full.u.nocross.ol.q[3]);
-				else if(last_packet) {
+				else if (last_packet) {
 					f->frame_end_timestamp = &(block->u.out.u.full.u.nocross.ol.q[3]);
 					f->frame_end_branch = &(block->u.out.u.full.u.nocross.ol.q[2]);
 				}
@@ -526,7 +526,7 @@
 				branch_address = &(block->u.out.u.full.u.nocross.ol.q[2]);
 
 				n_descriptors = 4;
-				if(first_packet)
+				if (first_packet)
 					f->first_n_descriptors = n_descriptors;
 
 				full_packets++;
@@ -538,7 +538,7 @@
 
 		/* note: we are not linked into the active DMA chain yet */
 
-		if(last_branch_address) {
+		if (last_branch_address) {
 			*(last_branch_address) = cpu_to_le32(block_dma | n_descriptors);
 		}
 
@@ -564,7 +564,7 @@
 	video->n_clear_frames--;
 
 	last_frame = video->first_clear_frame - 1;
-	if(last_frame == -1)
+	if (last_frame == -1)
 		last_frame = video->n_frames-1;
 
 	video->first_clear_frame = (video->first_clear_frame + 1) % video->n_frames;
@@ -578,11 +578,11 @@
 		   (unsigned long) f->frame_end_timestamp, 
 		   (unsigned long) f->frame_end_branch);
 	
-	if(video->active_frame != -1) {
+	if (video->active_frame != -1) {
 
 		/* if DMA is already active, we are almost done */
 		/* just link us onto the active DMA chain */
-		if(video->frames[last_frame]->frame_end_branch) {
+		if (video->frames[last_frame]->frame_end_branch) {
 			u32 temp;
 
 			/* point the previous frame's tail to this frame's head */
@@ -650,11 +650,11 @@
 		f->assigned_timestamp = (ts_cyc&0xF) << 12;
 
 		/* now actually write the timestamp into the appropriate CIP headers */
-		if(f->cip_syt1) {
+		if (f->cip_syt1) {
 			f->cip_syt1->b[6] = f->assigned_timestamp >> 8;
 			f->cip_syt1->b[7] = f->assigned_timestamp & 0xFF;
 		}
-		if(f->cip_syt2) {
+		if (f->cip_syt2) {
 			f->cip_syt2->b[6] = f->assigned_timestamp >> 8;
 			f->cip_syt2->b[7] = f->assigned_timestamp & 0xFF;
 		}
@@ -706,10 +706,10 @@
 		{
 			/* check if DMA is really running */
 			int i = 0;
-			while(i < 20) {
+			while (i < 20) {
 				mb();
 				mdelay(1);
-				if(reg_read(video->ohci, video->ohci_IsoXmitContextControlSet) & (1 << 10)) {
+				if (reg_read(video->ohci, video->ohci_IsoXmitContextControlSet) & (1 << 10)) {
 					printk("DMA ACTIVE after %d msec\n", i);
 					break;
 				}
@@ -721,7 +721,7 @@
 			       reg_read(video->ohci, video->ohci_IsoXmitCommandPtr)
 			       );
 			
-			if( ! (reg_read(video->ohci, video->ohci_IsoXmitContextControlSet) &  (1 << 10)) ) {
+			if ( ! (reg_read(video->ohci, video->ohci_IsoXmitContextControlSet) &  (1 << 10)) ) {
 				printk("DMA did NOT go active after 20ms, event = %x\n", 
 				       reg_read(video->ohci, video->ohci_IsoXmitContextControlSet) & 0x1F);
 			} else
@@ -821,14 +821,14 @@
 		{
 			int i;
 		
-			for(i = 0; i < 1000; ++i) {
+			for (i = 0; i < 1000; ++i) {
 				mdelay(1);
-				if(reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) & (1 << 10)) {
+				if (reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) & (1 << 10)) {
 					printk("DMA ACTIVE after %d msec\n", i);
 					break;
 				}
 			}
-			if( reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) &  (1 << 11) ) {
+			if ( reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) &  (1 << 11) ) {
 				printk("DEAD, event = %x\n", 
 					   reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) & 0x1F);
 			} else
@@ -836,7 +836,7 @@
 		}
 #endif
 	} 
-	else if( reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) &  (1 << 11) ) {
+	else if ( reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) &  (1 << 11) ) {
 		debug_printk("DEAD, event = %x\n", 
 			     reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) & 0x1F);
 
@@ -912,36 +912,36 @@
 	int retval = -EINVAL;
 
 	debug_printk("dv1394: initialising %d\n", video->id);
-	if(init->api_version != DV1394_API_VERSION)
+	if (init->api_version != DV1394_API_VERSION)
 		return -EINVAL;
 	
 	/* first sanitize all the parameters */
-	if( (init->n_frames < 2) || (init->n_frames > DV1394_MAX_FRAMES) )
+	if ( (init->n_frames < 2) || (init->n_frames > DV1394_MAX_FRAMES) )
 		return -EINVAL;
 
-	if( (init->format != DV1394_NTSC) && (init->format != DV1394_PAL) )
+	if ( (init->format != DV1394_NTSC) && (init->format != DV1394_PAL) )
 		return -EINVAL;
 
-	if( (init->syt_offset == 0) || (init->syt_offset > 50) )
+	if ( (init->syt_offset == 0) || (init->syt_offset > 50) )
 		/* default SYT offset is 3 cycles */
 		init->syt_offset = 3;
 
-	if( (init->channel > 63) || (init->channel < 0) )
+	if ( (init->channel > 63) || (init->channel < 0) )
 		init->channel = 63;
 
 	chan_mask = (u64)1 << init->channel;
 
 	/* calculate what size DMA buffer is needed */
-	if(init->format == DV1394_NTSC)
+	if (init->format == DV1394_NTSC)
 		new_buf_size = DV1394_NTSC_FRAME_SIZE * init->n_frames;
 	else
 		new_buf_size = DV1394_PAL_FRAME_SIZE * init->n_frames;
 
 	/* round up to PAGE_SIZE */
-	if(new_buf_size % PAGE_SIZE) new_buf_size += PAGE_SIZE - (new_buf_size % PAGE_SIZE);
+	if (new_buf_size % PAGE_SIZE) new_buf_size += PAGE_SIZE - (new_buf_size % PAGE_SIZE);
 
 	/* don't allow the user to allocate the DMA buffer more than once */
-	if(video->dv_buf.kvirt && video->dv_buf_size != new_buf_size) {
+	if (video->dv_buf.kvirt && video->dv_buf_size != new_buf_size) {
 		printk("dv1394: re-sizing the DMA buffer is not allowed\n");
 		return -EINVAL;
 	}
@@ -953,7 +953,7 @@
 	
 	/* try to claim the ISO channel */
 	spin_lock_irqsave(&video->ohci->IR_channel_lock, flags);
-	if(video->ohci->ISO_channel_usage & chan_mask) {
+	if (video->ohci->ISO_channel_usage & chan_mask) {
 		spin_unlock_irqrestore(&video->ohci->IR_channel_lock, flags);
 		retval = -EBUSY;
 		goto err;
@@ -981,7 +981,7 @@
 	video->current_packet = -1;
 	video->first_frame = 0;
 
-	if(video->pal_or_ntsc == DV1394_NTSC) {
+	if (video->pal_or_ntsc == DV1394_NTSC) {
 		video->cip_n = init->cip_n != 0 ? init->cip_n : CIP_N_NTSC;
 		video->cip_d = init->cip_d != 0 ? init->cip_d : CIP_D_NTSC;
 		video->frame_size = DV1394_NTSC_FRAME_SIZE;
@@ -995,7 +995,7 @@
 	
 	/* find and claim DMA contexts on the OHCI card */
 
-	if(video->ohci_it_ctx == -1) {
+	if (video->ohci_it_ctx == -1) {
 		ohci1394_init_iso_tasklet(&video->it_tasklet, OHCI_ISO_TRANSMIT,
 					  it_tasklet_func, (unsigned long) video);
 
@@ -1009,7 +1009,7 @@
 		debug_printk("dv1394: claimed IT DMA context %d\n", video->ohci_it_ctx);
 	}
 
-	if(video->ohci_ir_ctx == -1) {
+	if (video->ohci_ir_ctx == -1) {
 		ohci1394_init_iso_tasklet(&video->ir_tasklet, OHCI_ISO_RECEIVE,
 					  ir_tasklet_func, (unsigned long) video);
 
@@ -1023,20 +1023,20 @@
 	}
 	
 	/* allocate struct frames */
-	for(i = 0; i < init->n_frames; i++) {
+	for (i = 0; i < init->n_frames; i++) {
 		video->frames[i] = frame_new(i, video);
 
-		if(!video->frames[i]) {
+		if (!video->frames[i]) {
 			printk(KERN_ERR "dv1394: Cannot allocate frame structs\n");
 			retval = -ENOMEM;
 			goto err;
 		}
 	}
 
-	if(!video->dv_buf.kvirt) {
+	if (!video->dv_buf.kvirt) {
 		/* allocate the ringbuffer */
 		retval = dma_region_alloc(&video->dv_buf, new_buf_size, video->ohci->dev, PCI_DMA_TODEVICE);
-		if(retval)
+		if (retval)
 			goto err;
 					  
 		video->dv_buf_size = new_buf_size;
@@ -1047,10 +1047,10 @@
 	}
 	
 	/* set up the frame->data pointers */
-	for(i = 0; i < video->n_frames; i++)
+	for (i = 0; i < video->n_frames; i++)
 		video->frames[i]->data = (unsigned long) video->dv_buf.kvirt + i * video->frame_size;
 
-	if(!video->packet_buf.kvirt) {
+	if (!video->packet_buf.kvirt) {
 		/* allocate packet buffer */
 		video->packet_buf_size = sizeof(struct packet) * video->n_frames * MAX_PACKETS;
 		if (video->packet_buf_size % PAGE_SIZE)
@@ -1058,7 +1058,7 @@
 		
 		retval = dma_region_alloc(&video->packet_buf, video->packet_buf_size,
 					  video->ohci->dev, PCI_DMA_FROMDEVICE);
-		if(retval)
+		if (retval)
 			goto err;
 		
 		debug_printk("dv1394: Allocated %d packets in buffer, total %u pages (%u DMA pages), %lu bytes\n", 
@@ -1124,11 +1124,11 @@
 
 	video->dma_running = 0;
 
-	if( (video->ohci_it_ctx == -1) && (video->ohci_ir_ctx == -1) )
+	if ( (video->ohci_it_ctx == -1) && (video->ohci_ir_ctx == -1) )
 		goto out;
 
 	/* stop DMA if in progress */
-	if( (video->active_frame != -1) ||
+	if ( (video->active_frame != -1) ||
 	    (reg_read(video->ohci, video->ohci_IsoXmitContextControlClear) & (1 << 10)) ||
 	    (reg_read(video->ohci, video->ohci_IsoRcvContextControlClear) &  (1 << 10)) ) {
 
@@ -1142,12 +1142,12 @@
 		
 		/* wait until DMA really stops */
 		i = 0;
-		while(i < 1000) {
+		while (i < 1000) {
 				
 			/* wait 0.1 millisecond */
 			udelay(100); 
 			
-			if( (reg_read(video->ohci, video->ohci_IsoXmitContextControlClear) & (1 << 10)) ||
+			if ( (reg_read(video->ohci, video->ohci_IsoXmitContextControlClear) & (1 << 10)) ||
 			    (reg_read(video->ohci, video->ohci_IsoRcvContextControlClear)  & (1 << 10)) ) {
 				/* still active */
 				debug_printk("dv1394: stop_dma: DMA not stopped yet\n" );
@@ -1160,7 +1160,7 @@
 			i++;
 		}
 			
-		if(i == 1000) {
+		if (i == 1000) {
 			printk(KERN_ERR "dv1394: stop_dma: DMA still going after %d ms!\n", i/10);
 		}
 	}
@@ -1183,7 +1183,7 @@
 	stop_dma(video);
 	
 	/* release the DMA contexts */
-	if(video->ohci_it_ctx != -1) {
+	if (video->ohci_it_ctx != -1) {
 		video->ohci_IsoXmitContextControlSet = 0;
 		video->ohci_IsoXmitContextControlClear = 0;
 		video->ohci_IsoXmitCommandPtr = 0;
@@ -1197,7 +1197,7 @@
 		video->ohci_it_ctx = -1;
 	}
 
-	if(video->ohci_ir_ctx != -1) {
+	if (video->ohci_ir_ctx != -1) {
 		video->ohci_IsoRcvContextControlSet = 0;
 		video->ohci_IsoRcvContextControlClear = 0;
 		video->ohci_IsoRcvCommandPtr = 0;
@@ -1213,7 +1213,7 @@
 	}
 
 	/* release the ISO channel */
-	if(video->channel != -1) {
+	if (video->channel != -1) {
 		u64 chan_mask;
 		unsigned long flags;
 		
@@ -1227,8 +1227,8 @@
 	}
 	
 	/* free the frame structs */
-	for(i = 0; i < DV1394_MAX_FRAMES; i++) {
-		if(video->frames[i])
+	for (i = 0; i < DV1394_MAX_FRAMES; i++) {
+		if (video->frames[i])
 			frame_delete(video->frames[i]);
 		video->frames[i] = NULL;
 	}
@@ -1238,7 +1238,7 @@
 	/* we can't free the DMA buffer unless it is guaranteed that
 	   no more user-space mappings exist */
 	
-	if(free_dv_buf) {
+	if (free_dv_buf) {
 		dma_region_free(&video->dv_buf);
 		video->dv_buf_size = 0;
 	}
@@ -1282,9 +1282,9 @@
 	/* serialize mmap */
 	down(&video->sem);
 
-	if( ! video_card_initialized(video) ) {
+	if ( ! video_card_initialized(video) ) {
 		retval = do_dv1394_init_default(video);
-		if(retval)
+		if (retval)
 			goto out;
 	}
 
@@ -1306,14 +1306,14 @@
 	poll_wait(file, &video->waitq, wait);
 
 	spin_lock_irqsave(&video->spinlock, flags);
-	if( video->n_frames == 0 ) {
+	if ( video->n_frames == 0 ) {
 
-	} else if( video->active_frame == -1 ) {
+	} else if ( video->active_frame == -1 ) {
 		/* nothing going on */
 		mask |= POLLOUT;
 	} else {
 		/* any clear/ready buffers? */
-		if(video->n_clear_frames >0)
+		if (video->n_clear_frames >0)
 			mask |= POLLOUT | POLLIN;
 	}
 	spin_unlock_irqrestore(&video->spinlock, flags);
@@ -1345,17 +1345,17 @@
 	int target_frame;
 
 	/* serialize this to prevent multi-threaded mayhem */
-	if(file->f_flags & O_NONBLOCK) {
-		if(down_trylock(&video->sem))
+	if (file->f_flags & O_NONBLOCK) {
+		if (down_trylock(&video->sem))
 			return -EAGAIN;
 	} else {
-		if(down_interruptible(&video->sem))
+		if (down_interruptible(&video->sem))
 			return -ERESTARTSYS;
 	}
 
-	if( !video_card_initialized(video) ) {
+	if ( !video_card_initialized(video) ) {
 		ret = do_dv1394_init_default(video);
-		if(ret) {
+		if (ret) {
 			up(&video->sem);
 			return ret;
 		}
@@ -1364,7 +1364,7 @@
 	ret = 0;
 	add_wait_queue(&video->waitq, &wait);
 	
-	while(count > 0) {
+	while (count > 0) {
 
 		/* must set TASK_INTERRUPTIBLE *before* checking for free
 		   buffers; otherwise we could miss a wakeup if the interrupt
@@ -1378,7 +1378,7 @@
 		
 		spin_unlock_irqrestore(&video->spinlock, flags);
 
-		if(video->frames[target_frame]->state == FRAME_CLEAR) {
+		if (video->frames[target_frame]->state == FRAME_CLEAR) {
 
 			/* how much room is left in the target frame buffer */
 			cnt = video->frame_size - (video->write_off - target_frame * video->frame_size);
@@ -1388,12 +1388,12 @@
 			cnt = 0;
 		}
 
-		if(cnt > count)
+		if (cnt > count)
 			cnt = count;
 
 		if (cnt <= 0) { 
 			/* no room left, gotta wait */
-			if(file->f_flags & O_NONBLOCK) {
+			if (file->f_flags & O_NONBLOCK) {
 				if (!ret)
 					ret = -EAGAIN;
 				break;
@@ -1409,8 +1409,8 @@
 			continue; /* start over from 'while(count > 0)...' */
 		}
 
-		if(copy_from_user(video->dv_buf.kvirt + video->write_off, buffer, cnt)) {
-			if(!ret)
+		if (copy_from_user(video->dv_buf.kvirt + video->write_off, buffer, cnt)) {
+			if (!ret)
 				ret = -EFAULT;
 			break;
 		}
@@ -1421,7 +1421,7 @@
 		buffer += cnt;
 		ret += cnt;
 
-		if(video->write_off == video->frame_size * ((target_frame + 1) % video->n_frames))
+		if (video->write_off == video->frame_size * ((target_frame + 1) % video->n_frames))
 				frame_prepare(video, target_frame);
 	}
 	
@@ -1442,17 +1442,17 @@
 	int target_frame;
 
 	/* serialize this to prevent multi-threaded mayhem */
-	if(file->f_flags & O_NONBLOCK) {
-		if(down_trylock(&video->sem))
+	if (file->f_flags & O_NONBLOCK) {
+		if (down_trylock(&video->sem))
 			return -EAGAIN;
 	} else {
-		if(down_interruptible(&video->sem))
+		if (down_interruptible(&video->sem))
 			return -ERESTARTSYS;
 	}
 
-	if( !video_card_initialized(video) ) {
+	if ( !video_card_initialized(video) ) {
 		ret = do_dv1394_init_default(video);
-		if(ret) {
+		if (ret) {
 			up(&video->sem);
 			return ret;
 		}
@@ -1466,7 +1466,7 @@
 	ret = 0;
 	add_wait_queue(&video->waitq, &wait);
 
-	while(count > 0) {
+	while (count > 0) {
 
 		/* must set TASK_INTERRUPTIBLE *before* checking for free
 		   buffers; otherwise we could miss a wakeup if the interrupt
@@ -1480,7 +1480,7 @@
 
 		spin_unlock_irqrestore(&video->spinlock, flags);
 
-		if(target_frame >= 0 &&
+		if (target_frame >= 0 &&
 			video->n_clear_frames > 0 &&
 			video->frames[target_frame]->state == FRAME_CLEAR) {
 
@@ -1492,12 +1492,12 @@
 			cnt = 0;
 		}
 
-		if(cnt > count)
+		if (cnt > count)
 			cnt = count;
 
 		if (cnt <= 0) { 
 			/* no room left, gotta wait */
-			if(file->f_flags & O_NONBLOCK) {
+			if (file->f_flags & O_NONBLOCK) {
 				if (!ret)
 					ret = -EAGAIN;
 				break;
@@ -1513,8 +1513,8 @@
 			continue; /* start over from 'while(count > 0)...' */
 		}
 
-		if(copy_to_user(buffer, video->dv_buf.kvirt + video->write_off, cnt)) {
-				if(!ret)
+		if (copy_to_user(buffer, video->dv_buf.kvirt + video->write_off, cnt)) {
+				if (!ret)
 					ret = -EFAULT;
 				break;
 		}
@@ -1525,7 +1525,7 @@
 		buffer += cnt;
 		ret += cnt;
 
-		if(video->write_off == video->frame_size * ((target_frame + 1) % video->n_frames)) {
+		if (video->write_off == video->frame_size * ((target_frame + 1) % video->n_frames)) {
 			spin_lock_irqsave(&video->spinlock, flags);
 			video->n_clear_frames--;
 			video->first_clear_frame = (video->first_clear_frame + 1) % video->n_frames;
@@ -1555,11 +1555,11 @@
 	DECLARE_WAITQUEUE(wait, current);
 
 	/* serialize this to prevent multi-threaded mayhem */
-	if(file->f_flags & O_NONBLOCK) {
-		if(down_trylock(&video->sem))
+	if (file->f_flags & O_NONBLOCK) {
+		if (down_trylock(&video->sem))
 			return -EAGAIN;
 	} else {
-		if(down_interruptible(&video->sem))
+		if (down_interruptible(&video->sem))
 			return -ERESTARTSYS;
 	}
 
@@ -1568,20 +1568,20 @@
 	case DV1394_IOC_SUBMIT_FRAMES: {
 		unsigned int n_submit;
 
-		if( !video_card_initialized(video) ) {
+		if ( !video_card_initialized(video) ) {
 			ret = do_dv1394_init_default(video);
-			if(ret)
+			if (ret)
 				goto out;
 		}
 
 		n_submit = (unsigned int) arg;
 
-		if(n_submit > video->n_frames) {
+		if (n_submit > video->n_frames) {
 			ret = -EINVAL;
 			goto out;
 		}
 			
-		while(n_submit > 0) {
+		while (n_submit > 0) {
 
 			add_wait_queue(&video->waitq, &wait);
 			set_current_state(TASK_INTERRUPTIBLE);
@@ -1589,11 +1589,11 @@
 			spin_lock_irqsave(&video->spinlock, flags);
 
 			/* wait until video->first_clear_frame is really CLEAR */
-			while(video->frames[video->first_clear_frame]->state != FRAME_CLEAR) {
+			while (video->frames[video->first_clear_frame]->state != FRAME_CLEAR) {
 
 				spin_unlock_irqrestore(&video->spinlock, flags);
 					
-				if(signal_pending(current)) {
+				if (signal_pending(current)) {
 					remove_wait_queue(&video->waitq, &wait);
 					set_current_state(TASK_RUNNING);
 					ret = -EINTR;
@@ -1622,7 +1622,7 @@
 	case DV1394_IOC_WAIT_FRAMES: {
 		unsigned int n_wait;
 
-		if( !video_card_initialized(video) ) {
+		if ( !video_card_initialized(video) ) {
 			ret = -EINVAL;
 			goto out;
 		}
@@ -1633,7 +1633,7 @@
 		   never actually have n_frames clear frames; at most only
 		   n_frames - 1 */
 
-		if(n_wait > (video->n_frames-1) ) {
+		if (n_wait > (video->n_frames-1) ) {
 			ret = -EINVAL;
 			goto out;
 		}
@@ -1643,11 +1643,11 @@
 		
 		spin_lock_irqsave(&video->spinlock, flags);
 
-		while(video->n_clear_frames < n_wait) {
+		while (video->n_clear_frames < n_wait) {
 			
 			spin_unlock_irqrestore(&video->spinlock, flags);
 					
-			if(signal_pending(current)) {
+			if (signal_pending(current)) {
 				remove_wait_queue(&video->waitq, &wait);
 				set_current_state(TASK_RUNNING);
 				ret = -EINTR;
@@ -1671,7 +1671,7 @@
 	case DV1394_IOC_RECEIVE_FRAMES: {
 		unsigned int n_recv;
 
-		if( !video_card_initialized(video) ) {
+		if ( !video_card_initialized(video) ) {
 			ret = -EINVAL;
 			goto out;
 		}
@@ -1679,7 +1679,7 @@
 		n_recv = (unsigned int) arg;
 
 		/* at least one frame must be active */
-		if(n_recv > (video->n_frames-1) ) {
+		if (n_recv > (video->n_frames-1) ) {
 			ret = -EINVAL;
 			goto out;
 		}
@@ -1702,9 +1702,9 @@
 	}
 
 	case DV1394_IOC_START_RECEIVE: {
-		if( !video_card_initialized(video) ) {
+		if ( !video_card_initialized(video) ) {
 			ret = do_dv1394_init_default(video);
-			if(ret)
+			if (ret)
 				goto out;
 		}
 	
@@ -1720,10 +1720,10 @@
 
 	case DV1394_IOC_INIT: {
 		struct dv1394_init init;
-		if(arg == (unsigned long) NULL) {
+		if (arg == (unsigned long) NULL) {
 			ret = do_dv1394_init_default(video);
 		} else {
-			if(copy_from_user(&init, (void*)arg, sizeof(init))) {
+			if (copy_from_user(&init, (void*)arg, sizeof(init))) {
 				ret = -EFAULT;
 				goto out;
 			}
@@ -1741,7 +1741,7 @@
         case DV1394_IOC_GET_STATUS: {
 		struct dv1394_status status;
 
-		if( !video_card_initialized(video) ) {
+		if ( !video_card_initialized(video) ) {
 			ret = -EINVAL;
 			goto out;
 		}
@@ -1769,7 +1769,7 @@
 			
 		spin_unlock_irqrestore(&video->spinlock, flags);
 
-		if(copy_to_user((void*)arg, &status, sizeof(status))) {
+		if (copy_to_user((void*)arg, &status, sizeof(status))) {
 			ret = -EFAULT;
 			goto out;
 		}
@@ -1797,7 +1797,7 @@
 
 	/* if the device was opened through devfs, then file->private_data
 	   has already been set to video by devfs */
-	if(file->private_data) {
+	if (file->private_data) {
 		video = (struct video_card*) file->private_data;
 		
 	} else {
@@ -1807,11 +1807,11 @@
 		unsigned long flags;
 		
 		spin_lock_irqsave(&dv1394_cards_lock, flags);
-		if(!list_empty(&dv1394_cards)) {
+		if (!list_empty(&dv1394_cards)) {
 			struct video_card *p;
 			list_for_each(lh, &dv1394_cards) {
 				p = list_entry(lh, struct video_card, list);
-				if((p->id) == ieee1394_file_to_instance(file)) {
+				if ((p->id) == ieee1394_file_to_instance(file)) {
 					video = p;
 					break;
 				}
@@ -1819,7 +1819,7 @@
 		}
 		spin_unlock_irqrestore(&dv1394_cards_lock, flags);
 
-		if(!video) {
+		if (!video) {
 			debug_printk("dv1394: OHCI card %d not found", ieee1394_file_to_instance(file));
 			return -ENODEV;
 		}
@@ -1829,7 +1829,7 @@
 	
 #ifndef DV1394_ALLOW_MORE_THAN_ONE_OPEN
 
-	if( test_and_set_bit(0, &video->open) ) {
+	if ( test_and_set_bit(0, &video->open) ) {
 		/* video is already open by someone else */
 		return -EBUSY;
  	}
@@ -1971,10 +1971,10 @@
 	struct dv1394_procfs_entry *p;
 		
 	spin_lock( &dv1394_procfs_lock);
-	if(!list_empty(&dv1394_procfs)) {
+	if (!list_empty(&dv1394_procfs)) {
 		list_for_each(lh, &dv1394_procfs) {
 			p = list_entry(lh, struct dv1394_procfs_entry, list);
-			if(!strncmp(p->name, name, sizeof(p->name))) {
+			if (!strncmp(p->name, name, sizeof(p->name))) {
 				spin_unlock( &dv1394_procfs_lock);
 				return p;
 			}
@@ -1991,7 +1991,7 @@
 	struct dv1394_procfs_entry *parent;
 
 	p = kmalloc(sizeof(struct dv1394_procfs_entry), GFP_KERNEL);
-	if(!p) {
+	if (!p) {
 		printk(KERN_ERR "dv1394: cannot allocate dv1394_procfs_entry\n");
 		goto err;
 	}
@@ -2043,7 +2043,7 @@
 	struct dv1394_procfs_entry *p;
 
 	p = kmalloc(sizeof(struct dv1394_procfs_entry), GFP_KERNEL);
-	if(!p) {
+	if (!p) {
 		printk(KERN_ERR "dv1394: cannot allocate dv1394_procfs_entry\n");
 		goto err;
 	}
@@ -2104,7 +2104,7 @@
 
 	spin_lock(&video->spinlock);
 
-	if(!video->dma_running)
+	if (!video->dma_running)
 		goto out;
 
 	irq_printk("ContextControl = %08x, CommandPtr = %08x\n", 
@@ -2113,24 +2113,24 @@
 	       );
 
 	
-	if( (video->ohci_it_ctx != -1) &&
+	if ( (video->ohci_it_ctx != -1) &&
 	    (reg_read(video->ohci, video->ohci_IsoXmitContextControlSet) & (1 << 10)) ) {
 
 		struct frame *f;
 		unsigned int frame, i;
 
 		
-		if(video->active_frame == -1)
+		if (video->active_frame == -1)
 			frame = 0;
 		else
 			frame = video->active_frame;
 
 		/* check all the DMA-able frames */
-		for(i = 0; i < video->n_frames; i++, frame = (frame+1) % video->n_frames) {
+		for (i = 0; i < video->n_frames; i++, frame = (frame+1) % video->n_frames) {
 
 			irq_printk("IRQ checking frame %d...", frame);
 			f = video->frames[frame];
-			if(f->state != FRAME_READY) {
+			if (f->state != FRAME_READY) {
 				irq_printk("clear, skipping\n");
 				/* we don't own this frame */
 				continue;
@@ -2139,7 +2139,7 @@
 			irq_printk("DMA\n");
 
 			/* check the frame begin semaphore to see if we can free the previous frame */
-			if( *(f->frame_begin_timestamp) ) {
+			if ( *(f->frame_begin_timestamp) ) {
 				int prev_frame;
 				struct frame *prev_f;
 
@@ -2149,13 +2149,13 @@
 				irq_printk("  BEGIN\n");
 
 				prev_frame = frame - 1;
-				if(prev_frame == -1)
+				if (prev_frame == -1)
 					prev_frame += video->n_frames;
 				prev_f = video->frames[prev_frame];
 				
 				/* make sure we can actually garbage collect
 				   this frame */
-				if( (prev_f->state == FRAME_READY) &&
+				if ( (prev_f->state == FRAME_READY) &&
 				    prev_f->done && (!f->done) ) 
 				{
 					frame_reset(prev_f);
@@ -2173,7 +2173,7 @@
 
 		     
 			/* see if we need to set the timestamp for the next frame */
-			if( *(f->mid_frame_timestamp) ) {
+			if ( *(f->mid_frame_timestamp) ) {
 				struct frame *next_frame;
 				u32 begin_ts, ts_cyc, ts_off;
 
@@ -2188,7 +2188,7 @@
 				/* prepare next frame and assign timestamp */
 				next_frame = video->frames[ (frame+1) % video->n_frames ];
 
-				if(next_frame->state == FRAME_READY) {
+				if (next_frame->state == FRAME_READY) {
 					irq_printk("  MIDDLE - next frame is ready, good\n");
 				} else {
 					debug_printk("dv1394: Underflow! At least one frame has been dropped.\n");
@@ -2207,11 +2207,11 @@
 				ts_off %= 3072;
 
 				next_frame->assigned_timestamp = ((ts_cyc&0xF) << 12) + ts_off;
-				if(next_frame->cip_syt1) {
+				if (next_frame->cip_syt1) {
 					next_frame->cip_syt1->b[6] = next_frame->assigned_timestamp >> 8;
 					next_frame->cip_syt1->b[7] = next_frame->assigned_timestamp & 0xFF;
 				}
-				if(next_frame->cip_syt2) {
+				if (next_frame->cip_syt2) {
 					next_frame->cip_syt2->b[6] = next_frame->assigned_timestamp >> 8;
 					next_frame->cip_syt2->b[7] = next_frame->assigned_timestamp & 0xFF;
 				}
@@ -2219,7 +2219,7 @@
 			}
 
 			/* see if the frame looped */
-			if( *(f->frame_end_timestamp) ) {
+			if ( *(f->frame_end_timestamp) ) {
 
 				*(f->frame_end_timestamp) = 0;
 
@@ -2230,10 +2230,10 @@
 
 
 		
-		} /* for(each frame) */
+		} /* for (each frame) */
 	}
 
-	if(wake) {
+	if (wake) {
 		kill_fasync(&video->fasync, SIGIO, POLL_OUT);
 		
 		/* wake readers/writers/ioctl'ers */
@@ -2251,10 +2251,10 @@
 
 	spin_lock(&video->spinlock);
 
-	if(!video->dma_running)
+	if (!video->dma_running)
 		goto out;
 	
-	if( (video->ohci_ir_ctx != -1) &&
+	if ( (video->ohci_ir_ctx != -1) &&
 	    (reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) & (1 << 10)) )
 	{ 
 
@@ -2374,7 +2374,7 @@
 			prev_i = (next_i == 0) ? (MAX_PACKETS * video->n_frames - 1) : (next_i - 1);
 			f = video->frames[prev_i / MAX_PACKETS];
 			prev = &(f->descriptor_pool[prev_i % MAX_PACKETS]);
-			if(prev_i % (MAX_PACKETS/2)) {
+			if (prev_i % (MAX_PACKETS/2)) {
 				prev->u.in.il.q[0] &= ~(3 << 20); /* no interrupt */
 			} else {
 				prev->u.in.il.q[0] |= 3 << 20; /* enable interrupt */
@@ -2394,7 +2394,7 @@
 		
 	} /* receive interrupt */
 	
-	if(wake) {
+	if (wake) {
 		kill_fasync(&video->fasync, SIGIO, POLL_IN);
 
 		/* wake readers/writers/ioctl'ers */
@@ -2453,7 +2453,7 @@
 	int i;
 
 	video = kmalloc(sizeof(struct video_card), GFP_KERNEL);
-	if(!video) {
+	if (!video) {
 		printk(KERN_ERR "dv1394: cannot allocate video_card\n");
 		goto err;
 	}
@@ -2497,7 +2497,7 @@
 		goto err_free;
 #endif
 
-	for(i = 0; i < DV1394_MAX_FRAMES; i++)
+	for (i = 0; i < DV1394_MAX_FRAMES; i++)
 		video->frames[i] = NULL;
 
 	dma_region_init(&video->dv_buf);
@@ -2574,10 +2574,10 @@
 
 	/* find the corresponding video_cards */
 	spin_lock_irqsave(&dv1394_cards_lock, flags);
-	if(!list_empty(&dv1394_cards)) {
+	if (!list_empty(&dv1394_cards)) {
 		list_for_each_safe(lh, templh, &dv1394_cards) {
 			video = list_entry(lh, struct video_card, list);
-			if((video->id >> 2) == ohci->id)
+			if ((video->id >> 2) == ohci->id)
 				dv1394_un_init(video);
 		}
 	}
@@ -2655,32 +2655,32 @@
 
 	/* find the corresponding video_cards */
 	spin_lock_irqsave(&dv1394_cards_lock, flags);
-	if(!list_empty(&dv1394_cards)) {
+	if (!list_empty(&dv1394_cards)) {
 		list_for_each(lh, &dv1394_cards) {
 			video = list_entry(lh, struct video_card, list);
-			if((video->id >> 2) == ohci->id)
+			if ((video->id >> 2) == ohci->id)
 				break;
 		}
 	}
 	spin_unlock_irqrestore(&dv1394_cards_lock, flags);
 
-	if(!video)
+	if (!video)
 		return;
 
 	
 	spin_lock_irqsave(&video->spinlock, flags);
 
-	if(!video->dma_running)
+	if (!video->dma_running)
 		goto out;
 
 	/* check IT context */
-	if(video->ohci_it_ctx != -1) {
+	if (video->ohci_it_ctx != -1) {
 		u32 ctx;
 		
 		ctx = reg_read(video->ohci, video->ohci_IsoXmitContextControlSet);
 
-		/* if(RUN but not ACTIVE) */
-		if( (ctx & (1<<15)) &&
+		/* if (RUN but not ACTIVE) */
+		if ( (ctx & (1<<15)) &&
 		    !(ctx & (1<<10)) ) {
 
 			debug_printk("dv1394: IT context stopped due to bus reset; waking it up\n");
@@ -2710,13 +2710,13 @@
 	}
 	
 	/* check IR context */
-	if(video->ohci_ir_ctx != -1) {
+	if (video->ohci_ir_ctx != -1) {
 		u32 ctx;
 		
 		ctx = reg_read(video->ohci, video->ohci_IsoRcvContextControlSet);
 
-		/* if(RUN but not ACTIVE) */
-		if( (ctx & (1<<15)) &&
+		/* if (RUN but not ACTIVE) */
+		if ( (ctx & (1<<15)) &&
 		    !(ctx & (1<<10)) ) {
 
 			debug_printk("dv1394: IR context stopped due to bus reset; waking it up\n");
diff -urN linux-2.5.73-bk4/drivers/ieee1394/dv1394.h linux-2.5.73-bk5/drivers/ieee1394/dv1394.h
--- linux-2.5.73-bk4/drivers/ieee1394/dv1394.h	2003-06-22 11:33:04.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/dv1394.h	2003-06-27 04:49:34.000000000 -0700
@@ -64,7 +64,7 @@
 
 	   ioctl(fd, DV1394_INIT, &init);
 
-	   while(1) {
+	   while (1) {
 	          read( <a raw DV file>, buf, DV1394_NTSC_FRAME_SIZE );
 		  write( <the dv1394 FD>, buf, DV1394_NTSC_FRAME_SIZE );
            }
@@ -145,7 +145,7 @@
    (checks of system call return values omitted for brevity; always
    check return values in your code!)
    
-   while( frames left ) {
+   while ( frames left ) {
    
     struct pollfd *pfd = ...;
 
@@ -157,15 +157,15 @@
     
     poll(pfd, 1, -1); (or select(); add a timeout if you want)
 
-    if(pfd->revents) {
+    if (pfd->revents) {
          struct dv1394_status status;
 	 
          ioctl(dv1394_fd, DV1394_GET_STATUS, &status);
 
-	 if(status.dropped_frames > 0) {
+	 if (status.dropped_frames > 0) {
 	      reset_dv1394();
          } else {
-              for(int i = 0; i < status.n_clear_frames; i++) {
+              for (int i = 0; i < status.n_clear_frames; i++) {
 	          copy_DV_frame();
               }
          }
diff -urN linux-2.5.73-bk4/drivers/ieee1394/eth1394.c linux-2.5.73-bk5/drivers/ieee1394/eth1394.c
--- linux-2.5.73-bk4/drivers/ieee1394/eth1394.c	2003-06-22 11:32:57.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/eth1394.c	2003-06-27 04:49:34.000000000 -0700
@@ -30,7 +30,7 @@
  * TODO:
  * RFC 2734 related:
  * - Add Config ROM entry
- * - Add MCAP and multicast
+ * - Add MCAP. Limited Multicast exists only to 224.0.0.1 and 224.0.0.2.
  *
  * Non-RFC 2734 related:
  * - Fix bug related to fragmented broadcast datagrams
@@ -59,9 +59,12 @@
 #include <linux/if_arp.h>
 #include <linux/if_ether.h>
 #include <linux/ip.h>
+#include <linux/in.h>
 #include <linux/tcp.h>
 #include <linux/skbuff.h>
 #include <linux/bitops.h>
+#include <linux/ethtool.h>
+#include <asm/uaccess.h>
 #include <asm/delay.h>
 #include <asm/semaphore.h>
 #include <net/arp.h>
@@ -76,17 +79,17 @@
 #include "eth1394.h"
 
 #define ETH1394_PRINT_G(level, fmt, args...) \
-	printk(level ETHER1394_DRIVER_NAME": "fmt, ## args)
+	printk(level "%s: " fmt, driver_name, ## args)
 
 #define ETH1394_PRINT(level, dev_name, fmt, args...) \
-	printk(level ETHER1394_DRIVER_NAME": %s: " fmt, dev_name, ## args)
+	printk(level "%s: %s: " fmt, driver_name, dev_name, ## args)
 
 #define DEBUG(fmt, args...) \
-	printk(KERN_ERR "eth1394:%s[%d]: "fmt"\n", __FUNCTION__, __LINE__, ## args)
-#define TRACE() printk(KERN_ERR "eth1394:%s[%d] ---- TRACE\n", __FUNCTION__, __LINE__)
+	printk(KERN_ERR "%s:%s[%d]: " fmt "\n", driver_name, __FUNCTION__, __LINE__, ## args)
+#define TRACE() printk(KERN_ERR "%s:%s[%d] ---- TRACE\n", driver_name, __FUNCTION__, __LINE__)
 
 static char version[] __devinitdata =
-	"$Rev: 951 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 971 $ Ben Collins <bcollins@debian.org>";
 
 struct fragment_info {
 	struct list_head list;
@@ -105,7 +108,7 @@
 };
 
 /* Our ieee1394 highlevel driver */
-#define ETHER1394_DRIVER_NAME "ether1394"
+static const char driver_name[] = "eth1394";
 
 static kmem_cache_t *packet_task_cache;
 
@@ -156,15 +159,26 @@
 static int ether1394_tx(struct sk_buff *skb, struct net_device *dev);
 static void ether1394_iso(struct hpsb_iso *iso);
 
+static int ether1394_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
+static int ether1394_ethtool_ioctl(struct net_device *dev, void *useraddr);
+
+static void eth1394_iso_shutdown(struct eth1394_priv *priv)
+{
+	priv->bc_state = ETHER1394_BC_CLOSED;
+
+	if (priv->iso != NULL) {
+		hpsb_iso_shutdown(priv->iso);
+		priv->iso = NULL;
+	}
+}
 
 static int ether1394_init_bc(struct net_device *dev)
 {
-	int ret = 0;
 	struct eth1394_priv *priv = (struct eth1394_priv *)dev->priv;
 
 	/* First time sending?  Need a broadcast channel for ARP and for
 	 * listening on */
-	if(priv->bc_state == ETHER1394_BC_CHECK) {
+	if (priv->bc_state == ETHER1394_BC_CHECK) {
 		quadlet_t bc;
 
 		/* Get the local copy of the broadcast channel and check its
@@ -172,30 +186,26 @@
 
 		bc = priv->host->csr.broadcast_channel;
 
-		if((bc & 0xc0000000) != 0xc0000000) {
+		if ((bc & 0xc0000000) != 0xc0000000) {
 			/* broadcast channel not validated yet */
 			ETH1394_PRINT(KERN_WARNING, dev->name,
 				      "Error BROADCAST_CHANNEL register valid "
 				      "bit not set, can't send IP traffic\n");
-			if(!in_interrupt()) {
-				hpsb_iso_shutdown(priv->iso);
-				priv->bc_state = ETHER1394_BC_CLOSED;
-			}
-			ret = -EAGAIN;
-			goto fail;
+
+			if (!in_interrupt())
+				eth1394_iso_shutdown(priv);
+
+			return -EAGAIN;
 		}
-		if(priv->broadcast_channel != (bc & 0x3f)) {
+		if (priv->broadcast_channel != (bc & 0x3f)) {
 			/* This really shouldn't be possible, but just in case
 			 * the IEEE 1394 spec changes regarding broadcast
 			 * channels in the future. */
 
-			if(in_interrupt()) {
-				ret = -EAGAIN;
-				goto fail;
-
-			}
+			if (in_interrupt())
+				return -EAGAIN;
 
-			hpsb_iso_shutdown(priv->iso);
+			eth1394_iso_shutdown(priv);
 
 			priv->broadcast_channel = bc & 0x3f;
 			ETH1394_PRINT(KERN_INFO, dev->name,
@@ -205,29 +215,26 @@
 			priv->iso = hpsb_iso_recv_init(priv->host, 16 * 4096,
 						       16, priv->broadcast_channel,
 						       1, ether1394_iso);
-			if(priv->iso == NULL) {
+			if (priv->iso == NULL) {
 				ETH1394_PRINT(KERN_ERR, dev->name,
 					      "failed to change broadcast "
 					      "channel\n");
-				ret = -EAGAIN;
-				goto fail;
+				return -EAGAIN;
 			}
 		}
-		if(hpsb_iso_recv_start(priv->iso, -1, (1 << 3), -1) < 0) {
+		if (hpsb_iso_recv_start(priv->iso, -1, (1 << 3), -1) < 0) {
 			ETH1394_PRINT(KERN_ERR, dev->name,
 				      "Could not start data stream reception\n");
-			if(!in_interrupt()) {
-				hpsb_iso_shutdown(priv->iso);
-				priv->bc_state = ETHER1394_BC_CLOSED;
-			}
-			ret = -EAGAIN;
-			goto fail;
+
+			if (!in_interrupt())
+				eth1394_iso_shutdown(priv);
+
+			return -EAGAIN;
 		}
 		priv->bc_state = ETHER1394_BC_OPENED;
 	}
     
-fail:
-	return ret;
+	return 0;
 }
 
 /* This is called after an "ifup" */
@@ -243,7 +250,7 @@
 	ret = ether1394_init_bc(dev);
 	spin_unlock_irqrestore(&priv->lock, flags);
 
-	if(ret)
+	if (ret)
 		return ret;
 
 	netif_start_queue (dev);
@@ -280,9 +287,9 @@
 	struct eth1394_priv *priv = (struct eth1394_priv *)dev->priv;
 	int phy_id = NODEID_TO_NODE(priv->host->node_id);
 
-	if ((new_mtu < 68) || (new_mtu > (priv->maxpayload[phy_id] -
+	if ((new_mtu < 68) || (new_mtu > MIN(ETH_DATA_LEN, (priv->maxpayload[phy_id] -
 					  (sizeof(union eth1394_hdr) +
-					   ETHER1394_GASP_OVERHEAD))))
+					   ETHER1394_GASP_OVERHEAD)))))
 		return -EINVAL;
 	dev->mtu = new_mtu;
 	return 0;
@@ -315,7 +322,8 @@
 	struct eth1394_priv *priv = (struct eth1394_priv *)dev->priv;
 	struct hpsb_host *host = priv->host;
 	int phy_id = NODEID_TO_NODE(host->node_id);
-	u64 guid = *((u64*)&(host->csr.rom[3]));
+	u64 guid = (u64)(((u64)be32_to_cpu(host->csr.rom[3]) << 32) |
+			  be32_to_cpu(host->csr.rom[4]));
 	u16 maxpayload = 1 << (((be32_to_cpu(host->csr.rom[2]) >> 12) & 0xf) + 1);
 
 	spin_lock_irqsave (&priv->lock, flags);
@@ -325,14 +333,14 @@
 	memset (priv->sspd, 0, sizeof (priv->sspd));
 	memset (priv->fifo, 0, sizeof (priv->fifo));
 
-#if 0
+#if 1
 /* Compile this out to make testing of fragmented broadcast datagrams
  * easier. */
-	priv->sspd[ALL_NODES] = SPEED_MAX;
-	priv->maxpayload[ALL_NODES] = eth1394_speedto_maxpayload[SPEED_MAX];
+	priv->sspd[ALL_NODES] = IEEE1394_SPEED_MAX;
+	priv->maxpayload[ALL_NODES] = eth1394_speedto_maxpayload[IEEE1394_SPEED_MAX];
 #else
-	priv->sspd[ALL_NODES] = SPEED_100;
-	priv->maxpayload[ALL_NODES] = eth1394_speedto_maxpayload[SPEED_100];
+	priv->sspd[ALL_NODES] = IEEE1394_SPEED_100;
+	priv->maxpayload[ALL_NODES] = eth1394_speedto_maxpayload[IEEE1394_SPEED_100];
 #endif
 
 	priv->bc_state = ETHER1394_BC_CHECK;
@@ -344,8 +352,9 @@
 
 	/* We'll use our maxpayload as the default mtu */
 	if (set_mtu) {
-		dev->mtu = priv->maxpayload[phy_id] - (sizeof(union eth1394_hdr) +
-						       ETHER1394_GASP_OVERHEAD);
+		dev->mtu = MIN(ETH_DATA_LEN, priv->maxpayload[phy_id] -
+					     (sizeof(union eth1394_hdr) +
+					     ETHER1394_GASP_OVERHEAD));
 
 		/* Set our hardware address while we're at it */
 		*(u64*)dev->dev_addr = guid;
@@ -354,11 +363,11 @@
 
 	spin_unlock_irqrestore (&priv->lock, flags);
 
-	for(i = 0; i < ALL_NODES; i++) {
+	for (i = 0; i < ALL_NODES; i++) {
 		struct list_head *lh, *n;
 
 		spin_lock_irqsave(&priv->pdg[i].lock, flags);
-		if(!set_mtu) {
+		if (!set_mtu) {
 			list_for_each_safe(lh, n, &priv->pdg[i].list) {
 				purge_partial_datagram(lh);
 			}
@@ -386,11 +395,14 @@
 	dev->header_cache_update= ether1394_header_cache_update;
 	dev->hard_header_parse	= ether1394_header_parse;
 	dev->set_mac_address	= ether1394_mac_addr;
+	dev->do_ioctl		= ether1394_do_ioctl;
 
 	/* Some constants */
 	dev->watchdog_timeo	= ETHER1394_TIMEOUT;
-	dev->flags		= IFF_BROADCAST; /* | IFF_MULTICAST someday */
-	dev->features		= NETIF_F_NO_CSUM|NETIF_F_SG|NETIF_F_HIGHDMA|NETIF_F_FRAGLIST;
+	dev->flags		= IFF_BROADCAST | IFF_MULTICAST;
+        /* !! If data corruption or untrackable kernel panics occur, try
+         * removing NETIF_F_FRAGLIST !! */
+	dev->features		= NETIF_F_HIGHDMA | NETIF_F_FRAGLIST;
 	dev->addr_len		= ETH1394_ALEN;
 	dev->hard_header_len 	= ETH1394_HLEN;
 	dev->type		= ARPHRD_IEEE1394;
@@ -421,8 +433,12 @@
 	 * it for ourselves.  That way we'd be a real networking device. */
 	dev = alloc_etherdev(sizeof (struct eth1394_priv));
 
-	if (dev == NULL)
+	if (dev == NULL) {
+		ETH1394_PRINT_G (KERN_ERR, "Out of memory trying to allocate "
+				 "etherdevice for IEEE 1394 device %s-%d\n",
+				 host->driver->name, host->id);
 		goto out;
+        }
 
 	SET_MODULE_OWNER(dev);
 
@@ -433,7 +449,7 @@
 	priv->host = host;
 	spin_lock_init(&priv->lock);
 
-	for(i = 0; i < ALL_NODES; i++) {
+	for (i = 0; i < ALL_NODES; i++) {
                 spin_lock_init(&priv->pdg[i].lock);
 		INIT_LIST_HEAD(&priv->pdg[i].list);
 		priv->pdg[i].sz = 0;
@@ -441,8 +457,12 @@
 
 	hi = hpsb_create_hostinfo(&eth1394_highlevel, host, sizeof(*hi));
 
-	if (hi == NULL)
+	if (hi == NULL) {
+		ETH1394_PRINT_G (KERN_ERR, "Out of memory trying to create "
+				 "hostinfo for IEEE 1394 device %s-%d\n",
+				 host->driver->name, host->id);
 		goto out;
+        }
 
 	if (register_netdev (dev)) {
 		ETH1394_PRINT (KERN_ERR, dev->name, "Error registering network driver\n");
@@ -472,8 +492,6 @@
 	if (hi)
 		hpsb_destroy_hostinfo(&eth1394_highlevel, host);
 
-	ETH1394_PRINT_G (KERN_ERR, "Out of memory\n");
-
 	return;
 }
 
@@ -486,10 +504,12 @@
 		struct eth1394_priv *priv = (struct eth1394_priv *)hi->dev->priv;
 
 		priv->bc_state = ETHER1394_BC_CLOSED;
-		unregister_netdev (hi->dev);
-		hpsb_iso_shutdown(priv->iso);
+		eth1394_iso_shutdown(priv);
 
-		kfree(hi->dev);
+		if (hi->dev) {
+			unregister_netdev (hi->dev);
+			kfree(hi->dev);
+		}
 	}
 
 	return;
@@ -536,7 +556,7 @@
 		return(dev->hard_header_len);
 	}
 
-	if(daddr)
+	if (daddr)
 	{
 		memcpy(eth->h_dest,daddr,dev->addr_len);
 		return dev->hard_header_len;
@@ -579,7 +599,7 @@
 {
 	struct net_device *dev = skb->dev;
 	memcpy(haddr, dev->dev_addr, ETH1394_ALEN);
-	return ETH_ALEN;
+	return ETH1394_ALEN;
 }
 
 
@@ -635,15 +655,15 @@
 	skb_pull (skb, ETH1394_HLEN);
 	eth = (struct eth1394hdr*)skb->mac.raw;
 
-	if(*eth->h_dest & 1) {
-		if(memcmp(eth->h_dest, dev->broadcast, dev->addr_len)==0)
+	if (*eth->h_dest & 1) {
+		if (memcmp(eth->h_dest, dev->broadcast, dev->addr_len)==0)
 			skb->pkt_type = PACKET_BROADCAST;
 #if 0
 		else
 			skb->pkt_type = PACKET_MULTICAST;
 #endif
 	} else {
-		if(memcmp(eth->h_dest, dev->dev_addr, dev->addr_len))
+		if (memcmp(eth->h_dest, dev->dev_addr, dev->addr_len))
 			skb->pkt_type = PACKET_OTHERHOST;
         }
 
@@ -671,7 +691,7 @@
 
 	/* Setup our hw addresses. We use these to build the
 	 * ethernet header.  */
-	if(destid == (LOCAL_BUS | ALL_NODES))
+	if (destid == (LOCAL_BUS | ALL_NODES))
 		dest_hw = ~0ULL;  /* broadcast */
 	else
 		dest_hw = priv->eui[NODEID_TO_NODE(destid)];
@@ -716,7 +736,7 @@
 		*(u32*)arp_ptr = arp1394->sip;	/* move sender IP addr */
 		arp_ptr += arp->ar_pln;		/* skip over sender IP addr */
 
-		if(arp->ar_op == 1)
+		if (arp->ar_op == 1)
 			/* just set ARP req target unique ID to 0 */
 			memset(arp_ptr, 0, ETH1394_ALEN);
 		else
@@ -739,7 +759,7 @@
 	list_for_each(lh, frag_list) {
 		fi = list_entry(lh, struct fragment_info, list);
 
-		if( ! ((offset > (fi->offset + fi->len - 1)) ||
+		if ( ! ((offset > (fi->offset + fi->len - 1)) ||
 		       ((offset + len - 1) < fi->offset)))
 			return 1;
 	}
@@ -753,7 +773,7 @@
 
 	list_for_each(lh, pdgl) {
 		pd = list_entry(lh, struct partial_datagram, list);
-		if(pd->dgl == dgl)
+		if (pd->dgl == dgl)
 			return lh;
 	}
 	return NULL;
@@ -767,32 +787,32 @@
 
 	list_for_each(lh, frag_info) {
 		fi = list_entry(lh, struct fragment_info, list);
-		if((fi->offset + fi->len) == offset) {
+		if ((fi->offset + fi->len) == offset) {
 			/* The new fragment can be tacked on to the end */
 			fi->len += len;
 			/* Did the new fragment plug a hole? */
 			fi2 = list_entry(lh->next, struct fragment_info, list);
-			if((fi->offset + fi->len) == fi2->offset) {
+			if ((fi->offset + fi->len) == fi2->offset) {
 				/* glue fragments together */
 				fi->len += fi2->len;
 				list_del(lh->next);
 				kfree(fi2);
 			}
 			return 0;
-		} else if((offset + len) == fi->offset) {
+		} else if ((offset + len) == fi->offset) {
 			/* The new fragment can be tacked on to the beginning */
 			fi->offset = offset;
 			fi->len += len;
 			/* Did the new fragment plug a hole? */
 			fi2 = list_entry(lh->prev, struct fragment_info, list);
-			if((fi2->offset + fi2->len) == fi->offset) {
+			if ((fi2->offset + fi2->len) == fi->offset) {
 				/* glue fragments together */
 				fi2->len += fi->len;
 				list_del(lh);
 				kfree(fi);
 			}
 			return 0;
-		} else if(offset > (fi->offset + fi->len)) {
+		} else if (offset > (fi->offset + fi->len)) {
 			break;
 		} else if ((offset + len) < fi->offset) {
 			lh = lh->prev;
@@ -801,7 +821,7 @@
 	}
 
 	new = kmalloc(sizeof(struct fragment_info), GFP_ATOMIC);
-	if(!new) 
+	if (!new) 
 		return -ENOMEM;
 
 	new->offset = offset;
@@ -820,12 +840,12 @@
 	struct partial_datagram *new;
 
 	new = kmalloc(sizeof(struct partial_datagram), GFP_ATOMIC);
-	if(!new)
+	if (!new)
 		return -ENOMEM;
 
 	INIT_LIST_HEAD(&new->frag_info);
 
-	if(new_fragment(&new->frag_info, frag_off, frag_len) < 0) {
+	if (new_fragment(&new->frag_info, frag_off, frag_len) < 0) {
 		kfree(new);
 		return -ENOMEM;
 	}
@@ -834,7 +854,7 @@
 	new->dg_size = dg_size;
 
 	new->skb = dev_alloc_skb(dg_size + dev->hard_header_len + 15);
-	if(!new->skb) {
+	if (!new->skb) {
 		struct fragment_info *fi = list_entry(new->frag_info.next,
 						      struct fragment_info,
 						      list);
@@ -857,7 +877,7 @@
 {
 	struct partial_datagram *pd = list_entry(lh, struct partial_datagram, list);
 
-	if(new_fragment(&pd->frag_info, frag_off, frag_len) < 0) {
+	if (new_fragment(&pd->frag_info, frag_off, frag_len) < 0) {
 		return -ENOMEM;
 	}
 
@@ -915,7 +935,7 @@
 
 	hdr_len = hdr_type_len[hdr->common.lf];
 
-	if(hdr->common.lf == ETH1394_HDR_LF_UF) {
+	if (hdr->common.lf == ETH1394_HDR_LF_UF) {
 		/* An unfragmented datagram has been received by the ieee1394
 		 * bus. Build an skbuff around it so we can pass it to the
 		 * high level network layer. */
@@ -945,15 +965,15 @@
 		hdr->words.word3 = ntohs(hdr->words.word3);
 		/* The 4th header word is reserved so no need to do ntohs() */
 
-		if(hdr->common.lf == ETH1394_HDR_LF_FF) {
+		if (hdr->common.lf == ETH1394_HDR_LF_FF) {
 			ether_type = hdr->ff.ether_type;
 			dgl = hdr->ff.dgl;
-			dg_size = hdr->ff.dg_size;
+			dg_size = hdr->ff.dg_size + 1;
 			fg_off = 0;
 		} else {
 			hdr->words.word2 = ntohs(hdr->words.word2);
 			dgl = hdr->sf.dgl;
-			dg_size = hdr->sf.dg_size;
+			dg_size = hdr->sf.dg_size + 1;
 			fg_off = hdr->sf.fg_off;
 		}
 		spin_lock_irqsave(&pdg->lock, flags);
@@ -961,8 +981,8 @@
 		pdgl = &(pdg->list);
 		lh = find_partial_datagram(pdgl, dgl);
 
-		if(lh == NULL) {
-			if(pdg->sz == max_partial_datagrams) {
+		if (lh == NULL) {
+			if (pdg->sz == max_partial_datagrams) {
 				/* remove the oldest */
 				purge_partial_datagram(pdgl->prev);
 				pdg->sz--;
@@ -971,7 +991,7 @@
 			retval = new_partial_datagram(dev, pdgl, dgl, dg_size,
 						      buf + hdr_len, fg_off,
 						      fg_len);
-			if(retval < 0) {
+			if (retval < 0) {
 				spin_unlock_irqrestore(&pdg->lock, flags);
 				goto bad_proto;
 			}
@@ -982,7 +1002,7 @@
 
 			pd = list_entry(lh, struct partial_datagram, list);
 
-			if(fragment_overlap(&pd->frag_info, fg_off, fg_len)) {
+			if (fragment_overlap(&pd->frag_info, fg_off, fg_len)) {
 				/* Overlapping fragments, obliterate old
 				 * datagram and start new one. */
 				purge_partial_datagram(lh);
@@ -990,7 +1010,7 @@
 							      dg_size,
 							      buf + hdr_len,
 							      fg_off, fg_len);
-				if(retval < 0) {
+				if (retval < 0) {
 					pdg->sz--;
 					spin_unlock_irqrestore(&pdg->lock, flags);
 					goto bad_proto;
@@ -999,7 +1019,7 @@
 				retval = update_partial_datagram(pdgl, lh,
 								 buf + hdr_len,
 								 fg_off, fg_len);
-				if(retval < 0) {
+				if (retval < 0) {
 					/* Couldn't save off fragment anyway
 					 * so might as well obliterate the
 					 * datagram now. */
@@ -1013,11 +1033,11 @@
 
 		pd = list_entry(lh, struct partial_datagram, list);
 
-		if(hdr->common.lf == ETH1394_HDR_LF_FF) {
+		if (hdr->common.lf == ETH1394_HDR_LF_FF) {
 			pd->ether_type = ether_type;
 		}
 
-		if(is_datagram_complete(lh, dg_size)) {
+		if (is_datagram_complete(lh, dg_size)) {
 			ether_type = pd->ether_type;
 			pdg->sz--;
 			skb = skb_get(pd->skb);
@@ -1044,14 +1064,14 @@
 
 
 	spin_lock_irqsave(&priv->lock, flags);
-	if(!skb->protocol) {
+	if (!skb->protocol) {
 		priv->stats.rx_errors++;
 		priv->stats.rx_dropped++;
 		dev_kfree_skb_any(skb);
 		goto bad_proto;
 	}
 
-	if(netif_rx(skb) == NET_RX_DROP) {
+	if (netif_rx(skb) == NET_RX_DROP) {
 		priv->stats.rx_errors++;
 		priv->stats.rx_dropped++;
 		goto bad_proto;
@@ -1062,7 +1082,7 @@
 	priv->stats.rx_bytes += skb->len;
 
 bad_proto:
-	if(netif_queue_stopped(dev))
+	if (netif_queue_stopped(dev))
 		netif_wake_queue(dev);
 	spin_unlock_irqrestore(&priv->lock, flags);
 
@@ -1076,13 +1096,13 @@
 {
 	struct host_info *hi = hpsb_get_hostinfo(&eth1394_highlevel, host);
 
-	if(hi == NULL) {
+	if (hi == NULL) {
 		ETH1394_PRINT_G(KERN_ERR, "Could not find net device for host %s\n",
 				host->driver->name);
 		return RCODE_ADDRESS_ERROR;
 	}
 
-	if(ether1394_data_handler(hi->dev, srcid, destid, (char*)data, len))
+	if (ether1394_data_handler(hi->dev, srcid, destid, (char*)data, len))
 		return RCODE_ADDRESS_ERROR;
 	else
 		return RCODE_COMPLETE;
@@ -1101,7 +1121,7 @@
 	int i;
 	int nready;
 
-	if(hi == NULL) {
+	if (hi == NULL) {
 		ETH1394_PRINT_G(KERN_ERR, "Could not find net device for host %s\n",
 				iso->host->driver->name);
 		return;
@@ -1110,7 +1130,7 @@
 	dev = hi->dev;
 
 	nready = hpsb_iso_n_ready(iso);
-	for(i = 0; i < nready; i++) {
+	for (i = 0; i < nready; i++) {
 		struct hpsb_iso_packet_info *info = &iso->infos[iso->first_packet + i];
 		data = (quadlet_t*) (iso->data_buf.kvirt + info->offset);
 
@@ -1124,7 +1144,7 @@
 
 		priv = (struct eth1394_priv *)dev->priv;
 
-		if(info->channel != (iso->host->csr.broadcast_channel & 0x3f) ||
+		if (info->channel != (iso->host->csr.broadcast_channel & 0x3f) ||
 		   specifier_id != ETHER1394_GASP_SPECIFIER_ID) {
 			/* This packet is not for us */
 			continue;
@@ -1185,13 +1205,13 @@
 	unsigned int adj_max_payload = max_payload - hdr_type_len[ETH1394_HDR_LF_UF];
 
 	/* Does it all fit in one packet? */
-	if(dg_size <= adj_max_payload) {
+	if (dg_size <= adj_max_payload) {
 		hdr->uf.lf = ETH1394_HDR_LF_UF;
 		hdr->uf.ether_type = proto;
 	} else {
 		hdr->ff.lf = ETH1394_HDR_LF_FF;
 		hdr->ff.ether_type = proto;
-		hdr->ff.dg_size = dg_size;
+		hdr->ff.dg_size = dg_size - 1;
 		hdr->ff.dgl = dgl;
 		adj_max_payload = max_payload - hdr_type_len[ETH1394_HDR_LF_FF];
 	}
@@ -1229,7 +1249,7 @@
 	default:
 		hdr->sf.fg_off += adj_max_payload;
 		bufhdr = (union eth1394_hdr *)skb_pull(skb, adj_max_payload);
-		if(max_payload >= skb->len)
+		if (max_payload >= skb->len)
 			hdr->common.lf = ETH1394_HDR_LF_LF;
 		bufhdr->words.word1 = htons(hdr->words.word1);
 		bufhdr->words.word2 = htons(hdr->words.word2);
@@ -1245,7 +1265,7 @@
 	struct hpsb_packet *p;
 
 	p = alloc_hpsb_packet(0);
-	if(p) {
+	if (p) {
 		p->host = host;
 		p->data = NULL;
 		p->generation = get_hpsb_generation(host);
@@ -1269,8 +1289,9 @@
 	p->header_size = 16;
 	p->expect_response = 1;
 
-	if(hpsb_get_tlabel(p, !in_interrupt())) {
-		ETH1394_PRINT_G(KERN_ERR, "No more tlabels left");
+	if (hpsb_get_tlabel(p, !in_interrupt())) {
+		ETH1394_PRINT_G(KERN_ERR, "No more tlabels left while sending "
+				"to node " NODE_BUS_FMT "\n", NODE_BUS_ARGS(node));
 		return -1;
 	}		
 	p->header[0] = (p->node_id << 16) | (p->tlabel << 10)
@@ -1309,41 +1330,45 @@
 
 static inline void ether1394_free_packet(struct hpsb_packet *packet)
 {
+	if (packet->tcode != TCODE_STREAM_DATA)
+		hpsb_free_tlabel(packet);
 	packet->data = NULL;
 	free_hpsb_packet(packet);
 }
 
 static void ether1394_complete_cb(void *__ptask);
+
 static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
 {
 	struct eth1394_priv *priv = ptask->priv;
-	struct hpsb_packet *packet;
+	struct hpsb_packet *packet = NULL;
 
 	packet = ether1394_alloc_common_packet(priv->host);
-	if(!packet)
+	if (!packet)
 		return -1;
 
-	if(ptask->tx_type == ETH1394_GASP) {
+	if (ptask->tx_type == ETH1394_GASP) {
 		int length = tx_len + (2 * sizeof(quadlet_t));
 
 		ether1394_prep_gasp_packet(packet, priv, ptask->skb, length);
-
-	} else {
-		if(ether1394_prep_write_packet(packet, priv->host,
+	} else if (ether1394_prep_write_packet(packet, priv->host,
 					       ptask->dest_node,
 					       ptask->addr, ptask->skb->data,
-					       tx_len))
-			goto fail;
+					       tx_len)) {
+		goto fail;
 	}
 
 	ptask->packet = packet;
 	hpsb_set_packet_complete_task(ptask->packet, ether1394_complete_cb,
 				      ptask);
 
-	if(hpsb_send_packet(packet)) {
+	if (hpsb_send_packet(packet))
 		return 0;
-	}
+
 fail:
+	if (packet)
+		ether1394_free_packet(packet);
+
 	return -1;
 }
 
@@ -1357,7 +1382,7 @@
         unsigned long flags;
 		
 	/* Statistics */
-	if(fail) {
+	if (fail) {
 		spin_lock_irqsave(&priv->lock, flags);
 		priv->stats.tx_dropped++;
 		priv->stats.tx_errors++;
@@ -1382,22 +1407,20 @@
 	struct hpsb_packet *packet = ptask->packet;
 	int fail = 0;
 
-	if(packet->tcode != TCODE_STREAM_DATA) {
+	if (packet->tcode != TCODE_STREAM_DATA)
 		fail = hpsb_packet_success(packet);
-		hpsb_free_tlabel(packet);
-	}
 
 	ether1394_free_packet(packet);
 
 	ptask->outstanding_pkts--;
-	if(ptask->outstanding_pkts > 0 && !fail)
+	if (ptask->outstanding_pkts > 0 && !fail)
 	{
 		int tx_len;
 
 		/* Add the encapsulation header to the fragment */
 		tx_len = ether1394_encapsulate(ptask->skb, ptask->max_payload,
 					       &ptask->hdr);
-		if(ether1394_send_packet(ptask, tx_len))
+		if (ether1394_send_packet(ptask, tx_len))
 			ether1394_dg_complete(ptask, 1);
 	} else {
 		ether1394_dg_complete(ptask, fail);
@@ -1424,14 +1447,8 @@
 	struct packet_task *ptask;
 	struct node_entry *ne;
 
-	if (skb_is_nonlinear(skb)) {
-		ret = skb_linearize(skb, kmflags);
-		if(ret)
-			goto fail;
-	}
-
 	ptask = kmem_cache_alloc(packet_task_cache, kmflags);
-	if(ptask == NULL) {
+	if (ptask == NULL) {
 		ret = -ENOMEM;
 		goto fail;
 	}
@@ -1446,7 +1463,7 @@
 	}
 
 	if (priv->bc_state == ETHER1394_BC_CHECK) {
-		if(ether1394_init_bc(dev)) {
+		if (ether1394_init_bc(dev)) {
 			spin_unlock_irqrestore (&priv->lock, flags);
 			goto fail;
 		}
@@ -1464,7 +1481,7 @@
 	skb_pull(skb, ETH1394_HLEN);
 
 	ne = hpsb_guid_get_entry(be64_to_cpu(*(u64*)eth->h_dest));
-	if(!ne)
+	if (!ne)
 		dest_node = LOCAL_BUS | ALL_NODES;
 	else
 		dest_node = ne->nodeid;
@@ -1479,7 +1496,7 @@
 
 	/* This check should be unnecessary, but we'll keep it for safety for
 	 * a while longer. */
-	if(max_payload < 512) {
+	if (max_payload < 512) {
 		ETH1394_PRINT(KERN_WARNING, dev->name,
 			      "max_payload too small: %d   (setting to 512)\n",
 			      max_payload);
@@ -1487,13 +1504,11 @@
 	}
 
 	/* Set the transmission type for the packet.  ARP packets and IP
-	 * broadcast packets are sent via GASP, however, we cheat a little bit
-	 * when detecting IP broadcast packets.  This will need to change when
-	 * we switch from using node id for the hardware address to the EUI
-	 * which we should be using instead.  IP multicast is not yet
-	 * supported. */
-	if((memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0) ||
-	   (proto == __constant_htons(ETH_P_ARP))) {
+	 * broadcast packets are sent via GASP. */
+	if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 ||
+	    proto == __constant_htons(ETH_P_ARP) ||
+	    (proto == __constant_htons(ETH_P_IP) &&
+	     IN_MULTICAST(__constant_ntohl(skb->nh.iph->daddr)))) {
 		tx_type = ETH1394_GASP;
                 max_payload -= ETHER1394_GASP_OVERHEAD;
 	} else {
@@ -1504,7 +1519,7 @@
 
 	spin_lock_irqsave (&priv->lock, flags);
 	dgl = priv->dgl[NODEID_TO_NODE(dest_node)];
-	if(max_payload < dg_size + hdr_type_len[ETH1394_HDR_LF_UF])
+	if (max_payload < dg_size + hdr_type_len[ETH1394_HDR_LF_UF])
 		priv->dgl[NODEID_TO_NODE(dest_node)]++;
 	spin_unlock_irqrestore (&priv->lock, flags);
 
@@ -1516,14 +1531,14 @@
 	ptask->priv = priv;
 	ptask->tx_type = tx_type;
 
-	if(tx_type != ETH1394_GASP) {
+	if (tx_type != ETH1394_GASP) {
 		u64 addr;
 
 		/* This test is just temporary until ConfigROM support has
 		 * been added to eth1394.  Until then, we need an ARP packet
 		 * after a bus reset from the current destination node so that
 		 * we can get FIFO information. */
-		if(priv->fifo[NODEID_TO_NODE(dest_node)] == 0ULL) {
+		if (priv->fifo[NODEID_TO_NODE(dest_node)] == 0ULL) {
 			ret = -EAGAIN;
 			goto fail;
 		}
@@ -1545,19 +1560,17 @@
 	/* Add the encapsulation header to the fragment */
 	tx_len = ether1394_encapsulate(skb, max_payload, &ptask->hdr);
 	dev->trans_start = jiffies;
-	if(ether1394_send_packet(ptask, tx_len))
+	if (ether1394_send_packet(ptask, tx_len))
 		goto fail;
 
 	netif_wake_queue(dev);
 	return 0;
 fail:
-	if(ptask->packet)
-		ether1394_free_packet(ptask->packet);
-	if(ptask)
+	if (ptask)
 		kmem_cache_free(packet_task_cache, ptask);
-	if(skb != NULL) {
+
+	if (skb != NULL)
 		dev_kfree_skb(skb);
-	}
 
 	spin_lock_irqsave (&priv->lock, flags);
 	priv->stats.tx_dropped++;
@@ -1570,6 +1583,53 @@
 	return 0;  /* returning non-zero causes serious problems */
 }
 
+static int ether1394_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+	switch(cmd) {
+		case SIOCETHTOOL:
+			return ether1394_ethtool_ioctl(dev, (void *) ifr->ifr_data);
+
+		case SIOCGMIIPHY:		/* Get address of MII PHY in use. */
+		case SIOCGMIIREG:		/* Read MII PHY register. */
+		case SIOCSMIIREG:		/* Write MII PHY register. */
+		default:
+			return -EOPNOTSUPP;
+	}
+
+	return 0;
+}
+
+static int ether1394_ethtool_ioctl(struct net_device *dev, void *useraddr)
+{
+	u32 ethcmd;
+
+	if (get_user(ethcmd, (u32 *)useraddr))
+		return -EFAULT;
+
+	switch (ethcmd) {
+		case ETHTOOL_GDRVINFO: {
+			struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO };
+			strcpy (info.driver, driver_name);
+			strcpy (info.version, "$Rev: 971 $");
+			/* FIXME XXX provide sane businfo */
+			strcpy (info.bus_info, "ieee1394");
+			if (copy_to_user (useraddr, &info, sizeof (info)))
+				return -EFAULT;
+			break;
+		}
+		case ETHTOOL_GSET:
+		case ETHTOOL_SSET:
+		case ETHTOOL_NWAY_RST:
+		case ETHTOOL_GLINK:
+		case ETHTOOL_GMSGLVL:
+		case ETHTOOL_SMSGLVL:
+		default:
+			return -EOPNOTSUPP;
+	}
+
+	return 0;
+}
+
 /* Function for incoming 1394 packets */
 static struct hpsb_address_ops addr_ops = {
 	.write =	ether1394_write,
@@ -1577,7 +1637,7 @@
 
 /* Ieee1394 highlevel driver functions */
 static struct hpsb_highlevel eth1394_highlevel = {
-	.name =		ETHER1394_DRIVER_NAME,
+	.name =		driver_name,
 	.add_host =	ether1394_add_host,
 	.remove_host =	ether1394_remove_host,
 	.host_reset =	ether1394_host_reset,
diff -urN linux-2.5.73-bk4/drivers/ieee1394/ieee1394.h linux-2.5.73-bk5/drivers/ieee1394/ieee1394.h
--- linux-2.5.73-bk4/drivers/ieee1394/ieee1394.h	2003-06-22 11:32:39.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/ieee1394.h	2003-06-27 04:49:34.000000000 -0700
@@ -46,14 +46,14 @@
 #define ACKX_TIMEOUT             (-4)
 
 
-#define SPEED_100		0x00
-#define SPEED_200		0x01
-#define SPEED_400		0x02
-#define SPEED_800		0x03
-#define SPEED_1600		0x04
-#define SPEED_3200		0x05
+#define IEEE1394_SPEED_100		0x00
+#define IEEE1394_SPEED_200		0x01
+#define IEEE1394_SPEED_400		0x02
+#define IEEE1394_SPEED_800		0x03
+#define IEEE1394_SPEED_1600		0x04
+#define IEEE1394_SPEED_3200		0x05
 /* The current highest tested speed supported by the subsystem */
-#define SPEED_MAX		SPEED_800
+#define IEEE1394_SPEED_MAX		IEEE1394_SPEED_800
 
 /* Maps speed values above to a string representation */
 extern const char *hpsb_speedto_str[];
diff -urN linux-2.5.73-bk4/drivers/ieee1394/ieee1394_core.c linux-2.5.73-bk5/drivers/ieee1394/ieee1394_core.c
--- linux-2.5.73-bk4/drivers/ieee1394/ieee1394_core.c	2003-06-22 11:32:37.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/ieee1394_core.c	2003-06-27 04:49:34.000000000 -0700
@@ -289,7 +289,7 @@
 
         for (i = 0; i < (nodecount * 64); i += 64) {
                 for (j = 0; j < nodecount; j++) {
-                        map[i+j] = SPEED_MAX;
+                        map[i+j] = IEEE1394_SPEED_MAX;
                 }
         }
 
@@ -458,7 +458,7 @@
 	struct hpsb_packet *packet;
 	int retval = 0;
 
-	if(rootid >= ALL_NODES || rootid < -1 || gapcnt > 0x3f || gapcnt < -1 ||
+	if (rootid >= ALL_NODES || rootid < -1 || gapcnt > 0x3f || gapcnt < -1 ||
 	   (rootid == -1 && gapcnt == -1)) {
 		HPSB_DEBUG("Invalid Parameter: rootid = %d   gapcnt = %d",
 			   rootid, gapcnt);
@@ -470,22 +470,21 @@
 		return -ENOMEM;
 
 	packet->host = host;
-	packet->header_size = 16;
+	packet->header_size = 8;
 	packet->data_size = 0;
 	packet->expect_response = 0;
 	packet->no_waiter = 0;
 	packet->type = hpsb_raw;
 	packet->header[0] = 0;
-	if(rootid != -1)
+	if (rootid != -1)
 		packet->header[0] |= rootid << 24 | 1 << 23;
-	if(gapcnt != -1)
+	if (gapcnt != -1)
 		packet->header[0] |= gapcnt << 16 | 1 << 22;
 
 	packet->header[1] = ~packet->header[0];
 
 	packet->generation = get_hpsb_generation(host);
 
-	HPSB_DEBUG("Sending PHY configuration packet (I hope)...");
 	if (!hpsb_send_packet(packet)) {
 		retval = -EINVAL;
 		goto fail;
@@ -1030,12 +1029,12 @@
 {
 	int retval;
 
-	if( (blocknum < 0) || (blocknum > 15) )
+	if ( (blocknum < 0) || (blocknum > 15) )
 		return -EINVAL;
 
 	write_lock(&ieee1394_chardevs_lock);
 
-	if(ieee1394_chardevs[blocknum].file_ops == NULL) {
+	if (ieee1394_chardevs[blocknum].file_ops == NULL) {
 		/* grab the minor block */
 		ieee1394_chardevs[blocknum].file_ops = file_ops;
 		ieee1394_chardevs[blocknum].module = module;
@@ -1054,12 +1053,12 @@
 /* release a block of minor numbers */
 void ieee1394_unregister_chardev(int blocknum)
 {
-	if( (blocknum < 0) || (blocknum > 15) )
+	if ( (blocknum < 0) || (blocknum > 15) )
 		return;
 
 	write_lock(&ieee1394_chardevs_lock);
 
-	if(ieee1394_chardevs[blocknum].file_ops) {
+	if (ieee1394_chardevs[blocknum].file_ops) {
 		ieee1394_chardevs[blocknum].file_ops = NULL;
 		ieee1394_chardevs[blocknum].module = NULL;
 	}
@@ -1139,7 +1138,7 @@
 
 	/* look up the driver */
 
-	if(ieee1394_get_chardev(blocknum, &module, &file_ops) == 0)
+	if (ieee1394_get_chardev(blocknum, &module, &file_ops) == 0)
 		return -ENODEV;
 
 	/* redirect all subsequent requests to the driver's
diff -urN linux-2.5.73-bk4/drivers/ieee1394/ieee1394_core.h linux-2.5.73-bk5/drivers/ieee1394/ieee1394_core.h
--- linux-2.5.73-bk4/drivers/ieee1394/ieee1394_core.h	2003-06-22 11:32:34.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/ieee1394_core.h	2003-06-27 04:49:34.000000000 -0700
@@ -34,7 +34,7 @@
         } __attribute__((packed)) state;
 
         /* These are core internal. */
-        char tlabel;
+        signed char tlabel;
         char ack_code;
         char tcode;
 
diff -urN linux-2.5.73-bk4/drivers/ieee1394/ieee1394_transactions.c linux-2.5.73-bk5/drivers/ieee1394/ieee1394_transactions.c
--- linux-2.5.73-bk4/drivers/ieee1394/ieee1394_transactions.c	2003-06-22 11:32:39.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/ieee1394_transactions.c	2003-06-27 04:49:34.000000000 -0700
@@ -95,7 +95,7 @@
         packet->data_size = 0;
         packet->expect_response = 0;
         packet->type = hpsb_raw;             /* No CRC added */
-        packet->speed_code = SPEED_100; /* Force speed to be 100Mbps */
+        packet->speed_code = IEEE1394_SPEED_100; /* Force speed to be 100Mbps */
 }
 
 static void fill_async_stream_packet(struct hpsb_packet *packet, int length,
@@ -147,7 +147,7 @@
 	spin_lock_irqsave(&tp->lock, flags);
 	
 	packet->tlabel = find_next_zero_bit(tp->pool, 64, tp->next);
-	if(packet->tlabel > 63)
+	if (packet->tlabel > 63)
 		packet->tlabel = find_first_zero_bit(tp->pool, 64);
 	tp->next = (packet->tlabel + 1) % 64;
 	/* Should _never_ happen */
diff -urN linux-2.5.73-bk4/drivers/ieee1394/ieee1394_types.h linux-2.5.73-bk5/drivers/ieee1394/ieee1394_types.h
--- linux-2.5.73-bk4/drivers/ieee1394/ieee1394_types.h	2003-06-22 11:33:03.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/ieee1394_types.h	2003-06-27 04:49:34.000000000 -0700
@@ -40,7 +40,7 @@
 	(_tp)->next = 0;			\
 	(_tp)->allocations = 0;			\
 	sema_init(&(_tp)->count, 63);		\
-} while(0)
+} while (0)
 
 
 typedef u32 quadlet_t;
diff -urN linux-2.5.73-bk4/drivers/ieee1394/iso.c linux-2.5.73-bk5/drivers/ieee1394/iso.c
--- linux-2.5.73-bk4/drivers/ieee1394/iso.c	2003-06-22 11:33:08.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/iso.c	2003-06-27 04:49:34.000000000 -0700
@@ -25,7 +25,7 @@
 
 void hpsb_iso_shutdown(struct hpsb_iso *iso)
 {
-	if(iso->flags & HPSB_ISO_DRIVER_INIT) {
+	if (iso->flags & HPSB_ISO_DRIVER_INIT) {
 		hpsb_iso_stop(iso);
 		iso->host->driver->isoctl(iso, iso->type == HPSB_ISO_XMIT ?
 					  XMIT_SHUTDOWN : RECV_SHUTDOWN, 0);
@@ -47,7 +47,7 @@
 	int dma_direction;
 
 	/* make sure driver supports the ISO API */
-	if(!host->driver->isoctl) {
+	if (!host->driver->isoctl) {
 		printk(KERN_INFO "ieee1394: host driver '%s' does not support the rawiso API\n",
 		       host->driver->name);
 		return NULL;
@@ -55,23 +55,23 @@
 
 	/* sanitize parameters */
 
-	if(buf_packets < 2)
+	if (buf_packets < 2)
 		buf_packets = 2;
 
-	if(irq_interval < 1 || irq_interval > buf_packets / 2)
+	if (irq_interval < 1 || irq_interval > buf_packets / 2)
 		irq_interval = buf_packets / 2;
 
-	if(channel < -1 || channel >= 64)
+	if (channel < -1 || channel >= 64)
 		return NULL;
 
 	/* channel = -1 is OK for multi-channel recv but not for xmit */
-	if(type == HPSB_ISO_XMIT && channel < 0)
+	if (type == HPSB_ISO_XMIT && channel < 0)
 		return NULL;
 
 	/* allocate and write the struct hpsb_iso */
 
 	iso = kmalloc(sizeof(*iso) + buf_packets * sizeof(struct hpsb_iso_packet_info), GFP_KERNEL);
-	if(!iso)
+	if (!iso)
 		return NULL;
 
 	iso->infos = (struct hpsb_iso_packet_info *)(iso + 1);
@@ -90,7 +90,7 @@
 	iso->first_packet = 0;
 	spin_lock_init(&iso->lock);
 
-	if(iso->type == HPSB_ISO_XMIT) {
+	if (iso->type == HPSB_ISO_XMIT) {
 		iso->n_ready_packets = iso->buf_packets;
 		dma_direction = PCI_DMA_TODEVICE;
 	} else {
@@ -103,7 +103,7 @@
 	iso->prebuffer = 0;
 
 	/* allocate the packet buffer */
-	if(dma_region_alloc(&iso->data_buf, iso->buf_size, host->pdev, dma_direction))
+	if (dma_region_alloc(&iso->data_buf, iso->buf_size, host->pdev, dma_direction))
 		goto err;
 
 	return iso;
@@ -137,13 +137,13 @@
 	struct hpsb_iso *iso = hpsb_iso_common_init(host, HPSB_ISO_XMIT,
 						    data_buf_size, buf_packets,
 						    channel, irq_interval, callback);
-	if(!iso)
+	if (!iso)
 		return NULL;
 
 	iso->speed = speed;
 
 	/* tell the driver to start working */
-	if(host->driver->isoctl(iso, XMIT_INIT, 0))
+	if (host->driver->isoctl(iso, XMIT_INIT, 0))
 		goto err;
 
 	iso->flags |= HPSB_ISO_DRIVER_INIT;
@@ -164,11 +164,11 @@
 	struct hpsb_iso *iso = hpsb_iso_common_init(host, HPSB_ISO_RECV,
 						    data_buf_size, buf_packets,
 						    channel, irq_interval, callback);
-	if(!iso)
+	if (!iso)
 		return NULL;
 
 	/* tell the driver to start working */
-	if(host->driver->isoctl(iso, RECV_INIT, 0))
+	if (host->driver->isoctl(iso, RECV_INIT, 0))
 		goto err;
 
 	iso->flags |= HPSB_ISO_DRIVER_INIT;
@@ -181,21 +181,21 @@
 
 int hpsb_iso_recv_listen_channel(struct hpsb_iso *iso, unsigned char channel)
 {
-	if(iso->type != HPSB_ISO_RECV || iso->channel != -1 || channel >= 64)
+	if (iso->type != HPSB_ISO_RECV || iso->channel != -1 || channel >= 64)
 		return -EINVAL;
 	return iso->host->driver->isoctl(iso, RECV_LISTEN_CHANNEL, channel);
 }
 
 int hpsb_iso_recv_unlisten_channel(struct hpsb_iso *iso, unsigned char channel)
 {
-       if(iso->type != HPSB_ISO_RECV || iso->channel != -1 || channel >= 64)
+       if (iso->type != HPSB_ISO_RECV || iso->channel != -1 || channel >= 64)
                return -EINVAL;
        return iso->host->driver->isoctl(iso, RECV_UNLISTEN_CHANNEL, channel);
 }
 
 int hpsb_iso_recv_set_channel_mask(struct hpsb_iso *iso, u64 mask)
 {
-	if(iso->type != HPSB_ISO_RECV || iso->channel != -1)
+	if (iso->type != HPSB_ISO_RECV || iso->channel != -1)
 		return -EINVAL;
 	return iso->host->driver->isoctl(iso, RECV_SET_CHANNEL_MASK, (unsigned long) &mask);
 }
@@ -203,7 +203,7 @@
 static int do_iso_xmit_start(struct hpsb_iso *iso, int cycle)
 {
 	int retval = iso->host->driver->isoctl(iso, XMIT_START, cycle);
-	if(retval)
+	if (retval)
 		return retval;
 
 	iso->flags |= HPSB_ISO_DRIVER_STARTED;
@@ -212,25 +212,25 @@
 
 int hpsb_iso_xmit_start(struct hpsb_iso *iso, int cycle, int prebuffer)
 {
-	if(iso->type != HPSB_ISO_XMIT)
+	if (iso->type != HPSB_ISO_XMIT)
 		return -1;
 
-	if(iso->flags & HPSB_ISO_DRIVER_STARTED)
+	if (iso->flags & HPSB_ISO_DRIVER_STARTED)
 		return 0;
 
-	if(cycle < -1)
+	if (cycle < -1)
 		cycle = -1;
-	else if(cycle >= 8000)
+	else if (cycle >= 8000)
 		cycle %= 8000;
 
 	iso->xmit_cycle = cycle;
 
-	if(prebuffer < 0)
+	if (prebuffer < 0)
 		prebuffer = iso->buf_packets;
-	else if(prebuffer == 0)
+	else if (prebuffer == 0)
 		prebuffer = 1;
 
-	if(prebuffer > iso->buf_packets)
+	if (prebuffer > iso->buf_packets)
 		prebuffer = iso->buf_packets;
 
 	iso->prebuffer = prebuffer;
@@ -247,20 +247,20 @@
 	int retval = 0;
 	int isoctl_args[3];
 
-	if(iso->type != HPSB_ISO_RECV)
+	if (iso->type != HPSB_ISO_RECV)
 		return -1;
 
-	if(iso->flags & HPSB_ISO_DRIVER_STARTED)
+	if (iso->flags & HPSB_ISO_DRIVER_STARTED)
 		return 0;
 
-	if(cycle < -1)
+	if (cycle < -1)
 		cycle = -1;
-	else if(cycle >= 8000)
+	else if (cycle >= 8000)
 		cycle %= 8000;
 
 	isoctl_args[0] = cycle;
 	
-	if(tag_mask < 0)
+	if (tag_mask < 0)
 		/* match all tags */
 		tag_mask = 0xF;
 	isoctl_args[1] = tag_mask;
@@ -268,7 +268,7 @@
 	isoctl_args[2] = sync;
 
 	retval = iso->host->driver->isoctl(iso, RECV_START, (unsigned long) &isoctl_args[0]);
-	if(retval)
+	if (retval)
 		return retval;
 
 	iso->flags |= HPSB_ISO_DRIVER_STARTED;
@@ -282,15 +282,15 @@
 				     unsigned int offset, unsigned short len,
 				     unsigned int *out_offset, unsigned short *out_len)
 {
-	if(offset >= iso->buf_size)
+	if (offset >= iso->buf_size)
 		return -EFAULT;
 
 	/* make sure the packet does not go beyond the end of the buffer */
-	if(offset + len > iso->buf_size)
+	if (offset + len > iso->buf_size)
 		return -EFAULT;
 
 	/* check for wrap-around */
-	if(offset + len < offset)
+	if (offset + len < offset)
 		return -EFAULT;
 
 	/* now we can trust 'offset' and 'length' */
@@ -307,18 +307,18 @@
 	unsigned long flags;
 	int rv;
 
-	if(iso->type != HPSB_ISO_XMIT)
+	if (iso->type != HPSB_ISO_XMIT)
 		return -EINVAL;
 
 	/* is there space in the buffer? */
-	if(iso->n_ready_packets <= 0) {
+	if (iso->n_ready_packets <= 0) {
 		return -EBUSY;
 	}
 
 	info = &iso->infos[iso->first_packet];
 
 	/* check for bogus offset/length */
-	if(hpsb_iso_check_offset_len(iso, offset, len, &info->offset, &info->len))
+	if (hpsb_iso_check_offset_len(iso, offset, len, &info->offset, &info->len))
 		return -EFAULT;
 
 	info->tag = tag;
@@ -327,7 +327,7 @@
 	spin_lock_irqsave(&iso->lock, flags);
 
 	rv = iso->host->driver->isoctl(iso, XMIT_QUEUE, (unsigned long) info);
-	if(rv)
+	if (rv)
 		goto out;
 
 	/* increment cursors */
@@ -335,9 +335,9 @@
 	iso->xmit_cycle = (iso->xmit_cycle+1) % 8000;
 	iso->n_ready_packets--;
 
-	if(iso->prebuffer != 0) {
+	if (iso->prebuffer != 0) {
 		iso->prebuffer--;
-		if(iso->prebuffer <= 0) {
+		if (iso->prebuffer <= 0) {
 			iso->prebuffer = 0;
 			rv = do_iso_xmit_start(iso, iso->start_cycle);
 		}
@@ -350,7 +350,7 @@
 
 int hpsb_iso_xmit_sync(struct hpsb_iso *iso)
 {
-	if(iso->type != HPSB_ISO_XMIT)
+	if (iso->type != HPSB_ISO_XMIT)
 		return -EINVAL;
 
 	return wait_event_interruptible(iso->waitq, hpsb_iso_n_ready(iso) == iso->buf_packets);
@@ -371,7 +371,7 @@
 	iso->n_ready_packets++;
 	iso->pkt_dma = (iso->pkt_dma + 1) % iso->buf_packets;
 
-	if(iso->n_ready_packets == iso->buf_packets || error != 0) {
+	if (iso->n_ready_packets == iso->buf_packets || error != 0) {
 		/* the buffer has run empty! */
 		atomic_inc(&iso->overflows);
 	}
@@ -385,7 +385,7 @@
 	unsigned long flags;
 	spin_lock_irqsave(&iso->lock, flags);
 
-	if(iso->n_ready_packets == iso->buf_packets) {
+	if (iso->n_ready_packets == iso->buf_packets) {
 		/* overflow! */
 		atomic_inc(&iso->overflows);
 	} else {
@@ -410,14 +410,14 @@
 	unsigned int i;
 	int rv = 0;
 
-	if(iso->type != HPSB_ISO_RECV)
+	if (iso->type != HPSB_ISO_RECV)
 		return -1;
 
 	spin_lock_irqsave(&iso->lock, flags);
-	for(i = 0; i < n_packets; i++) {
+	for (i = 0; i < n_packets; i++) {
 		rv = iso->host->driver->isoctl(iso, RECV_RELEASE,
 					       (unsigned long) &iso->infos[iso->first_packet]);
-		if(rv)
+		if (rv)
 			break;
 
 		iso->first_packet = (iso->first_packet+1) % iso->buf_packets;
@@ -431,6 +431,6 @@
 {
 	wake_up_interruptible(&iso->waitq);
 
-	if(iso->callback)
+	if (iso->callback)
 		iso->callback(iso);
 }
diff -urN linux-2.5.73-bk4/drivers/ieee1394/iso.h linux-2.5.73-bk5/drivers/ieee1394/iso.h
--- linux-2.5.73-bk4/drivers/ieee1394/iso.h	2003-06-22 11:33:15.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/iso.h	2003-06-27 04:49:34.000000000 -0700
@@ -66,7 +66,7 @@
 	/* wait for buffer space */
 	wait_queue_head_t waitq;
 
-	int speed; /* SPEED_100, 200, or 400 */
+	int speed; /* IEEE1394_SPEED_100, 200, or 400 */
 	int channel; /* -1 if multichannel */
 
 	/* greatest # of packets between interrupts - controls
diff -urN linux-2.5.73-bk4/drivers/ieee1394/nodemgr.c linux-2.5.73-bk5/drivers/ieee1394/nodemgr.c
--- linux-2.5.73-bk4/drivers/ieee1394/nodemgr.c	2003-06-22 11:32:57.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/nodemgr.c	2003-06-27 04:49:34.000000000 -0700
@@ -1167,7 +1167,7 @@
 		return -ENOMEM;					\
 	++length;						\
 	scratch = buffer + length;				\
-} while(0)
+} while (0)
 
 	PUT_ENVP("VENDOR_ID=%06x", ud->vendor_id);
 	PUT_ENVP("MODEL_ID=%06x", ud->model_id);
@@ -1547,12 +1547,12 @@
 	/* If there is no bus manager then we should set the root node's
 	 * force_root bit to promote bus stability per the 1394
 	 * spec. (8.4.2.6) */
-	if (host->busmgr_id == 0x3f && host->node_count > 1)
+	if (host->busmgr_id == 0xffff && host->node_count > 1)
 	{
 		u16 root_node = host->node_count - 1;
-		struct node_entry *ne = hpsb_nodeid_get_entry(host, root_node);
+		struct node_entry *ne = find_entry_by_nodeid(host, root_node | LOCAL_BUS);
 
-		if (ne->busopt.cmc)
+		if (ne && ne->busopt.cmc)
 			hpsb_send_phy_config(host, root_node, -1);
 		else {
 			HPSB_DEBUG("The root node is not cycle master capable; "
diff -urN linux-2.5.73-bk4/drivers/ieee1394/ohci1394.c linux-2.5.73-bk5/drivers/ieee1394/ohci1394.c
--- linux-2.5.73-bk4/drivers/ieee1394/ohci1394.c	2003-06-22 11:33:12.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/ohci1394.c	2003-06-27 04:49:34.000000000 -0700
@@ -164,7 +164,7 @@
 printk(level "%s_%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args)
 
 static char version[] __devinitdata =
-	"$Rev: 948 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 952 $ Ben Collins <bcollins@debian.org>";
 
 /* Module Parameters */
 static int phys_dma = 1;
@@ -428,7 +428,7 @@
         d->buf_ind = 0;
         d->buf_offset = 0;
 
-	if(d->type == DMA_CTX_ISO) {
+	if (d->type == DMA_CTX_ISO) {
 		/* Clear contextControl */
 		reg_write(ohci, d->ctrlClear, 0xffffffff);
 
@@ -470,7 +470,7 @@
 	INIT_LIST_HEAD(&d->fifo_list);
 	INIT_LIST_HEAD(&d->pending_list);
 
-	if(d->type == DMA_CTX_ISO) {
+	if (d->type == DMA_CTX_ISO) {
 		/* enable interrupts */
 		reg_write(ohci, OHCI1394_IsoXmitIntMaskSet, 1 << d->ctx);
 	}
@@ -490,8 +490,8 @@
 	DBGMSG(ohci->id,"Iso contexts reg: %08x implemented: %08x", reg, tmp);
 
 	/* Count the number of contexts */
-	for(i=0; i<32; i++) {
-	    	if(tmp & 1) ctx++;
+	for (i=0; i<32; i++) {
+	    	if (tmp & 1) ctx++;
 		tmp >>= 1;
 	}
 	return ctx;
@@ -856,8 +856,8 @@
 		 * case. I don't see anyone sending ISO packets from
 		 * interrupt context anyway... */
 		
-		if(ohci->it_legacy_context.ohci == NULL) {
-			if(in_interrupt()) {
+		if (ohci->it_legacy_context.ohci == NULL) {
+			if (in_interrupt()) {
 				PRINT(KERN_ERR, ohci->id, 
 				      "legacy IT context cannot be initialized during interrupt");
 				return 0;
@@ -1074,7 +1074,7 @@
                 spin_unlock_irqrestore(&ohci->IR_channel_lock, flags);
                 DBGMSG(ohci->id, "Listening disabled on channel %d", arg);
 
-		if(ohci->ir_legacy_channels == 0) {
+		if (ohci->ir_legacy_channels == 0) {
 			free_dma_rcv_ctx(&ohci->ir_legacy_context);
 			DBGMSG(ohci->id, "ISO receive legacy context deactivated");
 		}
@@ -1162,7 +1162,7 @@
 	int ret = -ENOMEM;
 
 	recv = kmalloc(sizeof(*recv), SLAB_KERNEL);
-	if(!recv)
+	if (!recv)
 		return -ENOMEM;
 
 	iso->hostdata = recv;
@@ -1174,7 +1174,7 @@
 	/* use buffer-fill mode, unless irq_interval is 1
 	   (note: multichannel requires buffer-fill) */
 
-	if(iso->irq_interval == 1 && iso->channel != -1) {
+	if (iso->irq_interval == 1 && iso->channel != -1) {
 		recv->dma_mode = PACKET_PER_BUFFER_MODE;
 	} else {
 		recv->dma_mode = BUFFER_FILL_MODE;
@@ -1182,12 +1182,12 @@
 
 	/* set nblocks, buf_stride, block_irq_interval */
 
-	if(recv->dma_mode == BUFFER_FILL_MODE) {
+	if (recv->dma_mode == BUFFER_FILL_MODE) {
 		recv->buf_stride = PAGE_SIZE;
 
 		/* one block per page of data in the DMA buffer, minus the final guard page */
 		recv->nblocks = iso->buf_size/PAGE_SIZE - 1;
-		if(recv->nblocks < 3) {
+		if (recv->nblocks < 3) {
 			DBGMSG(ohci->id, "ohci_iso_recv_init: DMA buffer too small");
 			goto err;
 		}
@@ -1195,9 +1195,9 @@
 		/* iso->irq_interval is in packets - translate that to blocks */
 		/* (err, sort of... 1 is always the safest value) */
 		recv->block_irq_interval = iso->irq_interval / recv->nblocks;
-		if(recv->block_irq_interval*4 > recv->nblocks)
+		if (recv->block_irq_interval*4 > recv->nblocks)
 			recv->block_irq_interval = recv->nblocks/4;
-		if(recv->block_irq_interval < 1)
+		if (recv->block_irq_interval < 1)
 			recv->block_irq_interval = 1;
 
 	} else {
@@ -1211,10 +1211,10 @@
 
 		max_packet_size = iso->buf_size / iso->buf_packets;
 
-		for(recv->buf_stride = 8; recv->buf_stride < max_packet_size;
+		for (recv->buf_stride = 8; recv->buf_stride < max_packet_size;
 		    recv->buf_stride *= 2);
 	
-		if(recv->buf_stride*iso->buf_packets > iso->buf_size ||
+		if (recv->buf_stride*iso->buf_packets > iso->buf_size ||
 		   recv->buf_stride > PAGE_SIZE) {
 			/* this shouldn't happen, but anyway... */
 			DBGMSG(ohci->id, "ohci_iso_recv_init: problem choosing a buffer stride");
@@ -1243,7 +1243,7 @@
 				  ohci_iso_recv_packetperbuf_task,
 				  (unsigned long) iso);
 
-	if(ohci1394_register_iso_tasklet(recv->ohci, &recv->task) < 0)
+	if (ohci1394_register_iso_tasklet(recv->ohci, &recv->task) < 0)
 		goto err;
 
 	recv->task_active = 1;
@@ -1255,7 +1255,7 @@
 	recv->CommandPtr = OHCI1394_IsoRcvCommandPtr + 32 * ctx;
 	recv->ContextMatch = OHCI1394_IsoRcvContextMatch + 32 * ctx;
 
-	if(iso->channel == -1) {
+	if (iso->channel == -1) {
 		/* clear multi-channel selection mask */
 		reg_write(recv->ohci, OHCI1394_IRMultiChanMaskHiClear, 0xFFFFFFFF);
 		reg_write(recv->ohci, OHCI1394_IRMultiChanMaskLoClear, 0xFFFFFFFF);
@@ -1293,7 +1293,7 @@
 {
 	struct ohci_iso_recv *recv = iso->hostdata;
 
-	if(recv->task_active) {
+	if (recv->task_active) {
 		ohci_iso_recv_stop(iso);
 		ohci1394_unregister_iso_tasklet(recv->ohci, &recv->task);
 		recv->task_active = 0;
@@ -1363,7 +1363,7 @@
 	struct ohci_iso_recv *recv = iso->hostdata;
 	int reg, i;
 
-	if(channel < 32) {
+	if (channel < 32) {
 		reg = listen ? OHCI1394_IRMultiChanMaskLoSet : OHCI1394_IRMultiChanMaskLoClear;
 		i = channel;
 	} else {
@@ -1383,14 +1383,14 @@
 	struct ohci_iso_recv *recv = iso->hostdata;
 	int i;
 
-	for(i = 0; i < 64; i++) {
-		if(mask & (1ULL << i)) {
-			if(i < 32)
+	for (i = 0; i < 64; i++) {
+		if (mask & (1ULL << i)) {
+			if (i < 32)
 				reg_write(recv->ohci, OHCI1394_IRMultiChanMaskLoSet, (1 << i));
 			else
 				reg_write(recv->ohci, OHCI1394_IRMultiChanMaskHiSet, (1 << (i-32)));
 		} else {
-			if(i < 32)
+			if (i < 32)
 				reg_write(recv->ohci, OHCI1394_IRMultiChanMaskLoClear, (1 << i));
 			else
 				reg_write(recv->ohci, OHCI1394_IRMultiChanMaskHiClear, (1 << (i-32)));
@@ -1413,7 +1413,7 @@
 	/* always keep ISO headers */
 	command = (1 << 30);
 
-	if(recv->dma_mode == BUFFER_FILL_MODE)
+	if (recv->dma_mode == BUFFER_FILL_MODE)
 		command |= (1 << 31);
 
 	reg_write(recv->ohci, recv->ContextControlSet, command);
@@ -1421,7 +1421,7 @@
 	/* match on specified tags */
 	contextMatch = tag_mask << 28;
 
-	if(iso->channel == -1) {
+	if (iso->channel == -1) {
 		/* enable multichannel reception */
 		reg_write(recv->ohci, recv->ContextControlSet, (1 << 28));
 	} else {
@@ -1429,7 +1429,7 @@
 		contextMatch |= iso->channel;
 	}
 
-	if(cycle != -1) {
+	if (cycle != -1) {
 		u32 seconds;
 		
 		/* enable cycleMatch */
@@ -1450,7 +1450,7 @@
 		contextMatch |= cycle << 12;
 	}
 
-	if(sync != -1) {
+	if (sync != -1) {
 		/* set sync flag on first DMA descriptor */
 		struct dma_cmd *cmd = &recv->block[recv->block_dma];
 		cmd->control |= DMA_CTL_WAIT;
@@ -1482,7 +1482,7 @@
 	reg_read(recv->ohci, OHCI1394_IsochronousCycleTimer);
 
 	/* check RUN */
-	if(!(reg_read(recv->ohci, recv->ContextControlSet) & 0x8000)) {
+	if (!(reg_read(recv->ohci, recv->ContextControlSet) & 0x8000)) {
 		PRINT(KERN_ERR, recv->ohci->id,
 		      "Error starting IR DMA (ContextControl 0x%08x)\n",
 		      reg_read(recv->ohci, recv->ContextControlSet));
@@ -1515,7 +1515,7 @@
 					  | 1); /* Z=1 */
 
 	/* disable interrupt on previous DMA descriptor, except at intervals */
-	if((prev_i % recv->block_irq_interval) == 0) {
+	if ((prev_i % recv->block_irq_interval) == 0) {
 		prev->control |= cpu_to_le32(3 << 20); /* enable interrupt */
 	} else {
 		prev->control &= cpu_to_le32(~(3<<20)); /* disable interrupt */
@@ -1535,7 +1535,7 @@
 	len = info->len;
 
 	/* add the wasted space for padding to 4 bytes */
-	if(len % 4)
+	if (len % 4)
 		len += 4 - (len % 4);
 
 	/* add 8 bytes for the OHCI DMA data format overhead */
@@ -1544,7 +1544,7 @@
 	recv->released_bytes += len;
 
 	/* have we released enough memory for one block? */
-	while(recv->released_bytes > recv->buf_stride) {
+	while (recv->released_bytes > recv->buf_stride) {
 		ohci_iso_recv_release_block(recv, recv->block_reader);
 		recv->block_reader = (recv->block_reader + 1) % recv->nblocks;
 		recv->released_bytes -= recv->buf_stride;
@@ -1554,7 +1554,7 @@
 static inline void ohci_iso_recv_release(struct hpsb_iso *iso, struct hpsb_iso_packet_info *info)
 {
 	struct ohci_iso_recv *recv = iso->hostdata;
-	if(recv->dma_mode == BUFFER_FILL_MODE) {
+	if (recv->dma_mode == BUFFER_FILL_MODE) {
 		ohci_iso_recv_bufferfill_release(recv, info);
 	} else {
 		ohci_iso_recv_release_block(recv, info - iso->infos);
@@ -1567,7 +1567,7 @@
 	int wake = 0;
 	int runaway = 0;
 		
-	while(1) {
+	while (1) {
 		/* we expect the next parsable packet to begin at recv->dma_offset */
 		/* note: packet layout is as shown in section 10.6.1.1 of the OHCI spec */
 		
@@ -1580,7 +1580,7 @@
 		unsigned int this_block = recv->dma_offset/recv->buf_stride;
 
 		/* don't loop indefinitely */
-		if(runaway++ > 100000) {
+		if (runaway++ > 100000) {
 			atomic_inc(&iso->overflows);
 			PRINT(KERN_ERR, recv->ohci->id,
 			      "IR DMA error - Runaway during buffer parsing!\n");
@@ -1588,7 +1588,7 @@
 		}
 
 		/* stop parsing once we arrive at block_dma (i.e. don't get ahead of DMA) */
-		if(this_block == recv->block_dma)
+		if (this_block == recv->block_dma)
 			break;
 
 		wake = 1;
@@ -1600,7 +1600,7 @@
 		
 		len = p[recv->dma_offset+2] | (p[recv->dma_offset+3] << 8);
 
-		if(len > 4096) {
+		if (len > 4096) {
 			PRINT(KERN_ERR, recv->ohci->id,
 			      "IR DMA error - bogus 'len' value %u\n", len);
 		}
@@ -1613,7 +1613,7 @@
 		recv->dma_offset += 4;
 		
 		/* check for wrap-around */
-		if(recv->dma_offset >= recv->buf_stride*recv->nblocks) {
+		if (recv->dma_offset >= recv->buf_stride*recv->nblocks) {
 			recv->dma_offset -= recv->buf_stride*recv->nblocks;
 		}
 
@@ -1624,12 +1624,12 @@
 		recv->dma_offset += len;
 
 		/* payload is padded to 4 bytes */
-		if(len % 4) { 
+		if (len % 4) { 
 			recv->dma_offset += 4 - (len%4);
 		}
 
 		/* check for wrap-around */
-		if(recv->dma_offset >= recv->buf_stride*recv->nblocks) {
+		if (recv->dma_offset >= recv->buf_stride*recv->nblocks) {
 			/* uh oh, the packet data wraps from the last
                            to the first DMA block - make the packet
                            contiguous by copying its "tail" into the
@@ -1638,7 +1638,7 @@
 			int guard_off = recv->buf_stride*recv->nblocks;
 			int tail_len = len - (guard_off - offset);
 
-			if(tail_len > 0  && tail_len < recv->buf_stride) {
+			if (tail_len > 0  && tail_len < recv->buf_stride) {
 				memcpy(iso->data_buf.kvirt + guard_off,
 				       iso->data_buf.kvirt,
 				       tail_len);
@@ -1655,14 +1655,14 @@
 		recv->dma_offset += 4;
 
 		/* check for wrap-around */
-		if(recv->dma_offset >= recv->buf_stride*recv->nblocks) {
+		if (recv->dma_offset >= recv->buf_stride*recv->nblocks) {
 			recv->dma_offset -= recv->buf_stride*recv->nblocks;
 		}
 
 		hpsb_iso_packet_received(iso, offset, len, cycle, channel, tag, sy);
 	}
 
-	if(wake)
+	if (wake)
 		hpsb_iso_wake(iso);
 }
 
@@ -1674,7 +1674,7 @@
 	int loop;
 
 	/* loop over all blocks */
-	for(loop = 0; loop < recv->nblocks; loop++) {
+	for (loop = 0; loop < recv->nblocks; loop++) {
 		
 		/* check block_dma to see if it's done */
 		
@@ -1688,18 +1688,18 @@
 
 		unsigned char event = xferstatus & 0x1F;
 
-		if(!event) {
+		if (!event) {
 			/* nothing has happened to this block yet */
 			break;
 		}
 
-		if(event != 0x11) {
+		if (event != 0x11) {
 			atomic_inc(&iso->overflows);
 			PRINT(KERN_ERR, recv->ohci->id,
 			      "IR DMA error - OHCI error code 0x%02x\n", event);
 		}
 
-		if(rescount != 0) {
+		if (rescount != 0) {
 			/* the card is still writing to this block;
 			   we can't touch it until it's done */
 			break;
@@ -1716,7 +1716,7 @@
 		/* advance block_dma */
 		recv->block_dma = (recv->block_dma + 1) % recv->nblocks;
 
-		if((recv->block_dma+1) % recv->nblocks == recv->block_reader) {
+		if ((recv->block_dma+1) % recv->nblocks == recv->block_reader) {
 			atomic_inc(&iso->overflows);
 			DBGMSG(recv->ohci->id, "ISO reception overflow - "
 			       "ran out of DMA blocks");
@@ -1735,7 +1735,7 @@
 	int wake = 0;
 	
 	/* loop over the entire buffer */
-	for(count = 0; count < recv->nblocks; count++) {
+	for (count = 0; count < recv->nblocks; count++) {
 		u32 packet_len = 0;
 		
 		/* pointer to the DMA descriptor */
@@ -1747,21 +1747,21 @@
 
 		unsigned char event = xferstatus & 0x1F;
 
-		if(!event) {
+		if (!event) {
 			/* this packet hasn't come in yet; we are done for now */
 			goto out;
 		}
 		
-		if(event == 0x11) {
+		if (event == 0x11) {
 			/* packet received successfully! */
 			
 			/* rescount is the number of bytes *remaining* in the packet buffer,
 			   after the packet was written */
 			packet_len = recv->buf_stride - rescount;
 
-		} else if(event == 0x02) {
+		} else if (event == 0x02) {
 			PRINT(KERN_ERR, recv->ohci->id, "IR DMA error - packet too long for buffer\n");
-		} else if(event) {
+		} else if (event) {
 			PRINT(KERN_ERR, recv->ohci->id, "IR DMA error - OHCI error code 0x%02x\n", event);
 		}
 
@@ -1800,7 +1800,7 @@
 	}
 
 out:
-	if(wake)
+	if (wake)
 		hpsb_iso_wake(iso);
 }
 
@@ -1844,7 +1844,7 @@
 	int ret = -ENOMEM;
 
 	xmit = kmalloc(sizeof(*xmit), SLAB_KERNEL);
-	if(!xmit)
+	if (!xmit)
 		return -ENOMEM;
 
 	iso->hostdata = xmit;
@@ -1855,13 +1855,13 @@
 
 	prog_size = sizeof(struct iso_xmit_cmd) * iso->buf_packets;
 
-	if(dma_prog_region_alloc(&xmit->prog, prog_size, xmit->ohci->dev))
+	if (dma_prog_region_alloc(&xmit->prog, prog_size, xmit->ohci->dev))
 		goto err;
 
 	ohci1394_init_iso_tasklet(&xmit->task, OHCI_ISO_TRANSMIT,
 				  ohci_iso_xmit_task, (unsigned long) iso);
 
-	if(ohci1394_register_iso_tasklet(xmit->ohci, &xmit->task) < 0)
+	if (ohci1394_register_iso_tasklet(xmit->ohci, &xmit->task) < 0)
 		goto err;
 
 	xmit->task_active = 1;
@@ -1887,7 +1887,7 @@
 	reg_write(xmit->ohci, OHCI1394_IsoXmitIntMaskClear, 1 << xmit->task.context);
 
 	/* halt DMA */
-	if(ohci1394_stop_context(xmit->ohci, xmit->ContextControlClear, NULL)) {
+	if (ohci1394_stop_context(xmit->ohci, xmit->ContextControlClear, NULL)) {
 		/* XXX the DMA context will lock up if you try to send too much data! */
 		PRINT(KERN_ERR, xmit->ohci->id,
 		      "you probably exceeded the OHCI card's bandwidth limit - "
@@ -1899,7 +1899,7 @@
 {
 	struct ohci_iso_xmit *xmit = iso->hostdata;
 
-	if(xmit->task_active) {
+	if (xmit->task_active) {
 		ohci_iso_xmit_stop(iso);
 		ohci1394_unregister_iso_tasklet(xmit->ohci, &xmit->task);
 		xmit->task_active = 0;
@@ -1918,7 +1918,7 @@
 	int count;
 
 	/* check the whole buffer if necessary, starting at pkt_dma */
-	for(count = 0; count < iso->buf_packets; count++) {
+	for (count = 0; count < iso->buf_packets; count++) {
 		int cycle;
 
 		/* DMA descriptor */
@@ -1928,12 +1928,12 @@
 		u16 xferstatus = le32_to_cpu(cmd->output_last.status) >> 16;
 		u8  event = xferstatus & 0x1F;
 
-		if(!event) {
+		if (!event) {
 			/* packet hasn't been sent yet; we are done for now */
 			break;
 		}
 
-		if(event != 0x11)
+		if (event != 0x11)
 			PRINT(KERN_ERR, xmit->ohci->id,
 			      "IT DMA error - OHCI error code 0x%02x\n", event);
 		
@@ -1950,7 +1950,7 @@
 		cmd->output_last.status = 0;
 	}
 
-	if(wake)
+	if (wake)
 		hpsb_iso_wake(iso);
 }
 
@@ -1967,7 +1967,7 @@
 
 	/* check that the packet doesn't cross a page boundary
 	   (we could allow this if we added OUTPUT_MORE descriptor support) */
-	if(cross_bound(info->offset, info->len)) {
+	if (cross_bound(info->offset, info->len)) {
 		PRINT(KERN_ERR, xmit->ohci->id,
 		      "rawiso xmit: packet %u crosses a page boundary",
 		      iso->first_packet);
@@ -2030,7 +2030,7 @@
 		dma_prog_region_offset_to_bus(&xmit->prog, sizeof(struct iso_xmit_cmd) * next_i) | 3);
 
 	/* disable interrupt, unless required by the IRQ interval */
-	if(prev_i % iso->irq_interval) {
+	if (prev_i % iso->irq_interval) {
 		prev->output_last.control &= cpu_to_le32(~(3 << 20)); /* no interrupt */
 	} else {
 		prev->output_last.control |= cpu_to_le32(3 << 20); /* enable interrupt */
@@ -2062,7 +2062,7 @@
 		  dma_prog_region_offset_to_bus(&xmit->prog, iso->pkt_dma * sizeof(struct iso_xmit_cmd)) | 3);
 
 	/* cycle match */
-	if(cycle != -1) {
+	if (cycle != -1) {
 		u32 start = cycle & 0x1FFF;
 		
 		/* 'cycle' is only mod 8000, but we also need two 'seconds' bits -
@@ -2088,7 +2088,7 @@
 	udelay(100);
 
 	/* check the RUN bit */
-	if(!(reg_read(xmit->ohci, xmit->ContextControlSet) & 0x8000)) {
+	if (!(reg_read(xmit->ohci, xmit->ContextControlSet) & 0x8000)) {
 		PRINT(KERN_ERR, xmit->ohci->id, "Error starting IT DMA (ContextControl 0x%08x)\n",
 		      reg_read(xmit->ohci, xmit->ContextControlSet));
 		return -1;
@@ -2694,7 +2694,7 @@
 
 #ifdef OHCI1394_DEBUG
 		if (datasize)
-			if(((le32_to_cpu(d->prg_cpu[d->sent_ind]->data[0])>>4)&0xf) == 0xa)
+			if (((le32_to_cpu(d->prg_cpu[d->sent_ind]->data[0])>>4)&0xf) == 0xa)
 				DBGMSG(ohci->id,
 				       "Stream packet sent to channel %d tcode=0x%X "
 				       "ack=0x%X spd=%d dataLength=%d ctx=%d", 
@@ -2807,7 +2807,7 @@
 
 	DBGMSG(d->ohci->id, "Freeing dma_rcv_ctx %d", d->ctx);
 
-	if(d->ctrlClear) {
+	if (d->ctrlClear) {
 		ohci1394_stop_context(d->ohci, d->ctrlClear, NULL);
 
 		if (d->type == DMA_CTX_ISO) {
@@ -2969,7 +2969,7 @@
 
 	DBGMSG(d->ohci->id, "Freeing dma_trm_ctx %d", d->ctx);
 
-	if(d->ctrlClear) {
+	if (d->ctrlClear) {
 		ohci1394_stop_context(d->ohci, d->ctrlClear, NULL);
 
 		if (d->type == DMA_CTX_ISO) {
@@ -3261,7 +3261,7 @@
 	PRINT_G(KERN_ERR, fmt , ## args);	\
         ohci1394_pci_remove(dev);               \
 	return err;				\
-} while(0)
+} while (0)
 
 static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
 					const struct pci_device_id *ent)
@@ -3624,8 +3624,8 @@
 		usage = &ohci->ir_ctx_usage;
 
 		/* only one receive context can be multichannel (OHCI sec 10.4.1) */
-		if(tasklet->type == OHCI_ISO_MULTICHANNEL_RECEIVE) {
-			if(test_and_set_bit(0, &ohci->ir_multichannel_used)) {
+		if (tasklet->type == OHCI_ISO_MULTICHANNEL_RECEIVE) {
+			if (test_and_set_bit(0, &ohci->ir_multichannel_used)) {
 				return r;
 			}
 		}
@@ -3660,7 +3660,7 @@
 	else {
 		clear_bit(tasklet->context, &ohci->ir_ctx_usage);
 
-		if(tasklet->type == OHCI_ISO_MULTICHANNEL_RECEIVE) {
+		if (tasklet->type == OHCI_ISO_MULTICHANNEL_RECEIVE) {
 			clear_bit(0, &ohci->ir_multichannel_used);
 		}
 	}
diff -urN linux-2.5.73-bk4/drivers/ieee1394/raw1394.c linux-2.5.73-bk5/drivers/ieee1394/raw1394.c
--- linux-2.5.73-bk4/drivers/ieee1394/raw1394.c	2003-06-22 11:32:30.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/raw1394.c	2003-06-27 04:49:34.000000000 -0700
@@ -601,7 +601,7 @@
                 if (fi->listen_channels & (1ULL << channel)) {
                         req->req.error = RAW1394_ERROR_ALREADY;
                 } else {
-                        if(hpsb_listen_channel(&raw1394_highlevel, fi->host, channel)) {
+                        if (hpsb_listen_channel(&raw1394_highlevel, fi->host, channel)) {
 				req->req.error = RAW1394_ERROR_ALREADY;
 			} else {
 				fi->listen_channels |= 1ULL << channel;
@@ -2008,7 +2008,7 @@
 
 	list_for_each(lh, &fi->req_complete) {
 		req = list_entry(lh, struct pending_request, list);
-		if(req->req.type == RAW1394_REQ_RAWISO_ACTIVITY) {
+		if (req->req.type == RAW1394_REQ_RAWISO_ACTIVITY) {
 			return 1;
 		}
 	}
@@ -2024,17 +2024,17 @@
 	spin_lock_irqsave(&fi->reqlists_lock, flags);
 
 	/* only one ISO activity event may be in the queue */
-	if(!__rawiso_event_in_queue(fi)) {
+	if (!__rawiso_event_in_queue(fi)) {
 		struct pending_request *req = __alloc_pending_request(SLAB_ATOMIC);
 
-		if(req) {
+		if (req) {
 			req->file_info = fi;
 			req->req.type = RAW1394_REQ_RAWISO_ACTIVITY;
 			req->req.generation = get_hpsb_generation(fi->host);
 			__queue_complete_req(req);
 		} else {
 			/* on allocation failure, signal an overflow */
-			if(fi->iso_handle) {
+			if (fi->iso_handle) {
 				atomic_inc(&fi->iso_handle->overflows);
 			}
 		}
@@ -2054,7 +2054,7 @@
 	if (hi != NULL) {
 		list_for_each(lh, &hi->file_info_list) {
 			struct file_info *fi = list_entry(lh, struct file_info, list);
-			if(fi->iso_handle == iso)
+			if (fi->iso_handle == iso)
 				queue_rawiso_event(fi);
 		}
 	}
@@ -2079,7 +2079,7 @@
 {
 	struct raw1394_iso_status stat;
 
-	if(copy_from_user(&stat, uaddr, sizeof(stat)))
+	if (copy_from_user(&stat, uaddr, sizeof(stat)))
 		return -EFAULT;
 
 	fi->iso_handle = hpsb_iso_xmit_init(fi->host,
@@ -2089,13 +2089,13 @@
 					    stat.config.speed,
 					    stat.config.irq_interval,
 					    rawiso_activity_cb);
-	if(!fi->iso_handle)
+	if (!fi->iso_handle)
 		return -ENOMEM;
 
 	fi->iso_state = RAW1394_ISO_XMIT;
 
 	raw1394_iso_fill_status(fi->iso_handle, &stat);
-	if(copy_to_user(uaddr, &stat, sizeof(stat)))
+	if (copy_to_user(uaddr, &stat, sizeof(stat)))
 		return -EFAULT;
 
 	/* queue an event to get things started */
@@ -2108,7 +2108,7 @@
 {
 	struct raw1394_iso_status stat;
 
-	if(copy_from_user(&stat, uaddr, sizeof(stat)))
+	if (copy_from_user(&stat, uaddr, sizeof(stat)))
 		return -EFAULT;
 
 	fi->iso_handle = hpsb_iso_recv_init(fi->host,
@@ -2117,13 +2117,13 @@
 					    stat.config.channel,
 					    stat.config.irq_interval,
 					    rawiso_activity_cb);
-	if(!fi->iso_handle)
+	if (!fi->iso_handle)
 		return -ENOMEM;
 
 	fi->iso_state = RAW1394_ISO_RECV;
 
 	raw1394_iso_fill_status(fi->iso_handle, &stat);
-	if(copy_to_user(uaddr, &stat, sizeof(stat)))
+	if (copy_to_user(uaddr, &stat, sizeof(stat)))
 		return -EFAULT;
 	return 0;
 }
@@ -2134,7 +2134,7 @@
 	struct hpsb_iso *iso = fi->iso_handle;
 
 	raw1394_iso_fill_status(fi->iso_handle, &stat);
-	if(copy_to_user(uaddr, &stat, sizeof(stat)))
+	if (copy_to_user(uaddr, &stat, sizeof(stat)))
 		return -EFAULT;
 
 	/* reset overflow counter */
@@ -2150,20 +2150,20 @@
 	unsigned int packet = fi->iso_handle->first_packet;
 	int i;
 
-	if(copy_from_user(&upackets, uaddr, sizeof(upackets)))
+	if (copy_from_user(&upackets, uaddr, sizeof(upackets)))
 		return -EFAULT;
 
-	if(upackets.n_packets > hpsb_iso_n_ready(fi->iso_handle))
+	if (upackets.n_packets > hpsb_iso_n_ready(fi->iso_handle))
 		return -EINVAL;
 
 	/* ensure user-supplied buffer is accessible and big enough */
-	if(verify_area(VERIFY_WRITE, upackets.infos,
+	if (verify_area(VERIFY_WRITE, upackets.infos,
 		       upackets.n_packets * sizeof(struct raw1394_iso_packet_info)))
 		return -EFAULT;
 
 	/* copy the packet_infos out */
-	for(i = 0; i < upackets.n_packets; i++) {
-		if(__copy_to_user(&upackets.infos[i],
+	for (i = 0; i < upackets.n_packets; i++) {
+		if (__copy_to_user(&upackets.infos[i],
 				  &fi->iso_handle->infos[packet],
 				  sizeof(struct raw1394_iso_packet_info)))
 			return -EFAULT;
@@ -2180,28 +2180,28 @@
 	struct raw1394_iso_packets upackets;
 	int i, rv;
 
-	if(copy_from_user(&upackets, uaddr, sizeof(upackets)))
+	if (copy_from_user(&upackets, uaddr, sizeof(upackets)))
 		return -EFAULT;
 
-	if(upackets.n_packets > hpsb_iso_n_ready(fi->iso_handle))
+	if (upackets.n_packets > hpsb_iso_n_ready(fi->iso_handle))
 		return -EINVAL;
 
 	/* ensure user-supplied buffer is accessible and big enough */
-	if(verify_area(VERIFY_READ, upackets.infos,
+	if (verify_area(VERIFY_READ, upackets.infos,
 		       upackets.n_packets * sizeof(struct raw1394_iso_packet_info)))
 		return -EFAULT;
 
 	/* copy the infos structs in and queue the packets */
-	for(i = 0; i < upackets.n_packets; i++) {
+	for (i = 0; i < upackets.n_packets; i++) {
 		struct raw1394_iso_packet_info info;
 
-		if(__copy_from_user(&info, &upackets.infos[i],
+		if (__copy_from_user(&info, &upackets.infos[i],
 				    sizeof(struct raw1394_iso_packet_info)))
 			return -EFAULT;
 
 		rv = hpsb_iso_xmit_queue_packet(fi->iso_handle, info.offset,
 						info.len, info.tag, info.sy);
-		if(rv)
+		if (rv)
 			return rv;
 	}
 
@@ -2210,7 +2210,7 @@
 
 static void raw1394_iso_shutdown(struct file_info *fi)
 {
-	if(fi->iso_handle)
+	if (fi->iso_handle)
 		hpsb_iso_shutdown(fi->iso_handle);
 
 	fi->iso_handle = NULL;
@@ -2222,7 +2222,7 @@
 {
 	struct file_info *fi = file->private_data;
 
-	if(fi->iso_state == RAW1394_ISO_INACTIVE)
+	if (fi->iso_state == RAW1394_ISO_INACTIVE)
 		return -EINVAL;
 
 	return dma_region_mmap(&fi->iso_handle->data_buf, file, vma);
@@ -2249,7 +2249,7 @@
 		case RAW1394_IOC_ISO_RECV_START: {
 			/* copy args from user-space */
 			int args[3];
-			if(copy_from_user(&args[0], (void*) arg, sizeof(args)))
+			if (copy_from_user(&args[0], (void*) arg, sizeof(args)))
 				return -EFAULT;
 			return hpsb_iso_recv_start(fi->iso_handle, args[0], args[1], args[2]);
 		}
@@ -2263,7 +2263,7 @@
 		case RAW1394_IOC_ISO_RECV_SET_CHANNEL_MASK: {
 			/* copy the u64 from user-space */
 			u64 mask;
-			if(copy_from_user(&mask, (void*) arg, sizeof(mask)))
+			if (copy_from_user(&mask, (void*) arg, sizeof(mask)))
 				return -EFAULT;
 			return hpsb_iso_recv_set_channel_mask(fi->iso_handle, mask);
 		}
@@ -2286,7 +2286,7 @@
 		case RAW1394_IOC_ISO_XMIT_START: {
 			/* copy two ints from user-space */
 			int args[2];
-			if(copy_from_user(&args[0], (void*) arg, sizeof(args)))
+			if (copy_from_user(&args[0], (void*) arg, sizeof(args)))
 				return -EFAULT;
 			return hpsb_iso_xmit_start(fi->iso_handle, args[0], args[1]);
 		}
@@ -2374,7 +2374,7 @@
         struct arm_addr  *arm_addr = NULL;
         int another_host;
 
-	if(fi->iso_state != RAW1394_ISO_INACTIVE)
+	if (fi->iso_state != RAW1394_ISO_INACTIVE)
 		raw1394_iso_shutdown(fi);
 
         for (i = 0; i < 64; i++) {
diff -urN linux-2.5.73-bk4/drivers/ieee1394/sbp2.c linux-2.5.73-bk5/drivers/ieee1394/sbp2.c
--- linux-2.5.73-bk4/drivers/ieee1394/sbp2.c	2003-06-22 11:32:33.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/sbp2.c	2003-06-27 04:49:34.000000000 -0700
@@ -79,7 +79,7 @@
 #include "sbp2.h"
 
 static char version[] __devinitdata =
-	"$Rev: 942 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 967 $ Ben Collins <bcollins@debian.org>";
 
 /*
  * Module load parameter definitions
@@ -93,7 +93,7 @@
  * (probably due to PCI latency/throughput issues with the part). You can
  * bump down the speed if you are running into problems.
  */
-static int max_speed = SPEED_MAX;
+static int max_speed = IEEE1394_SPEED_MAX;
 module_param(max_speed, int, 0644);
 MODULE_PARM_DESC(max_speed, "Force max speed (3 = 800mb, 2 = 400mb default, 1 = 200mb, 0 = 100mb)");
 
@@ -780,8 +780,8 @@
 
 		scsi_id->ne = ud->ne;
 		scsi_id->hi = hi;
-		scsi_id->speed_code = SPEED_100;
-		scsi_id->max_payload_size = sbp2_speedto_max_payload[SPEED_100];
+		scsi_id->speed_code = IEEE1394_SPEED_100;
+		scsi_id->max_payload_size = sbp2_speedto_max_payload[IEEE1394_SPEED_100];
 		atomic_set(&scsi_id->sbp2_login_complete, 0);
 		INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_inuse);
 		INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_completed);
diff -urN linux-2.5.73-bk4/drivers/ieee1394/video1394.c linux-2.5.73-bk5/drivers/ieee1394/video1394.c
--- linux-2.5.73-bk4/drivers/ieee1394/video1394.c	2003-06-22 11:32:34.000000000 -0700
+++ linux-2.5.73-bk5/drivers/ieee1394/video1394.c	2003-06-27 04:49:34.000000000 -0700
@@ -589,7 +589,7 @@
 		it_prg[i].begin.status = 0;
 		
 		it_prg[i].data[0] = cpu_to_le32(
-			(SPEED_100 << 16) 
+			(IEEE1394_SPEED_100 << 16) 
 			| (/* tag */ 1 << 14)
 			| (d->channel << 8) 
 			| (TCODE_ISO_DATA << 4));
@@ -705,7 +705,7 @@
 		struct dma_iso_ctx *d;
 		int i;
 
-		if(copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, (void *)arg, sizeof(v)))
 			return -EFAULT;
 
 		/* if channel < 0, find lowest available one */
@@ -802,7 +802,7 @@
 			      v.channel);
 		}
 
-		if(copy_to_user((void *)arg, &v, sizeof(v)))
+		if (copy_to_user((void *)arg, &v, sizeof(v)))
 			return -EFAULT;
 
 		return 0;
@@ -814,7 +814,7 @@
 		u64 mask;
 		struct dma_iso_ctx *d;
 
-		if(copy_from_user(&channel, (void *)arg, sizeof(int)))
+		if (copy_from_user(&channel, (void *)arg, sizeof(int)))
 			return -EFAULT;
 
 		if (channel<0 || channel>(ISO_CHANNELS-1)) {
@@ -849,7 +849,7 @@
 		struct video1394_wait v;
 		struct dma_iso_ctx *d;
 
-		if(copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, (void *)arg, sizeof(v)))
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
@@ -911,7 +911,7 @@
 		struct dma_iso_ctx *d;
 		int i;
 
-		if(copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, (void *)arg, sizeof(v)))
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
@@ -939,12 +939,12 @@
 			}
 
 #if 1
-			while(d->buffer_status[v.buffer]!=
+			while (d->buffer_status[v.buffer]!=
 			      VIDEO1394_BUFFER_READY) {
 				spin_unlock_irqrestore(&d->lock, flags);
 				interruptible_sleep_on(&d->waitq);
 				spin_lock_irqsave(&d->lock, flags);
-				if(signal_pending(current)) {
+				if (signal_pending(current)) {
 					spin_unlock_irqrestore(&d->lock,flags);
 					return -EINTR;
 				}
@@ -981,7 +981,7 @@
 		spin_unlock_irqrestore(&d->lock, flags);
 
 		v.buffer=i;
-		if(copy_to_user((void *)arg, &v, sizeof(v)))
+		if (copy_to_user((void *)arg, &v, sizeof(v)))
 			return -EFAULT;
 
 		return 0;
@@ -994,7 +994,7 @@
 
 		qv.packet_sizes = NULL;
 
-		if(copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, (void *)arg, sizeof(v)))
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel);
@@ -1097,7 +1097,7 @@
 		struct video1394_wait v;
 		struct dma_iso_ctx *d;
 
-		if(copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, (void *)arg, sizeof(v)))
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel);
@@ -1114,10 +1114,10 @@
 			return 0;
 		case VIDEO1394_BUFFER_QUEUED:
 #if 1
-			while(d->buffer_status[v.buffer]!=
+			while (d->buffer_status[v.buffer]!=
 			      VIDEO1394_BUFFER_READY) {
 				interruptible_sleep_on(&d->waitq);
-				if(signal_pending(current)) return -EINTR;
+				if (signal_pending(current)) return -EINTR;
 			}
 #else
 			if (wait_event_interruptible(d->waitq, 
diff -urN linux-2.5.73-bk4/drivers/mtd/chips/gen_probe.c linux-2.5.73-bk5/drivers/mtd/chips/gen_probe.c
--- linux-2.5.73-bk4/drivers/mtd/chips/gen_probe.c	2003-06-22 11:33:16.000000000 -0700
+++ linux-2.5.73-bk5/drivers/mtd/chips/gen_probe.c	2003-06-27 04:49:34.000000000 -0700
@@ -1,8 +1,8 @@
 /*
  * Routines common to all CFI-type probes.
- * (C) 2001, 2001 Red Hat, Inc.
+ * (C) 2001-2003 Red Hat, Inc.
  * GPL'd
- * $Id: gen_probe.c,v 1.11 2003/05/21 15:15:05 dwmw2 Exp $
+ * $Id: gen_probe.c,v 1.13 2003/06/25 11:50:37 dwmw2 Exp $
  */
 
 #include <linux/kernel.h>
@@ -281,6 +281,7 @@
 
 extern cfi_cmdset_fn_t cfi_cmdset_0001;
 extern cfi_cmdset_fn_t cfi_cmdset_0002;
+extern cfi_cmdset_fn_t cfi_cmdset_0020;
 
 static inline struct mtd_info *cfi_cmdset_unknown(struct map_info *map, 
 						  int primary)
diff -urN linux-2.5.73-bk4/drivers/mtd/inftlcore.c linux-2.5.73-bk5/drivers/mtd/inftlcore.c
--- linux-2.5.73-bk4/drivers/mtd/inftlcore.c	2003-06-27 04:49:30.000000000 -0700
+++ linux-2.5.73-bk5/drivers/mtd/inftlcore.c	2003-06-27 04:49:34.000000000 -0700
@@ -7,7 +7,7 @@
  * (c) 1999 Machine Vision Holdings, Inc.
  * Author: David Woodhouse <dwmw2@infradead.org>
  *
- * $Id: inftlcore.c,v 1.11 2003/06/23 12:00:08 dwmw2 Exp $
+ * $Id: inftlcore.c,v 1.14 2003/06/26 08:28:26 dwmw2 Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -573,7 +573,7 @@
 {
 	unsigned char BlockUsed[MAX_SECTORS_PER_UNIT];
 	unsigned char BlockDeleted[MAX_SECTORS_PER_UNIT];
-	unsigned int thisEUN, prevEUN, status;
+	unsigned int thisEUN, status;
 	int block, silly;
 	struct inftl_bci bci;
 	size_t retlen;
@@ -645,26 +645,45 @@
 	DEBUG(MTD_DEBUG_LEVEL1, "INFTL: deleting empty VUC %d\n", thisVUC);
 
 	for (;;) {
+		u16 *prevEUN = &inftl->VUtable[thisVUC];
+		thisEUN = *prevEUN;
+
+		/* If the chain is all gone already, we're done */
+		if (thisEUN == BLOCK_NIL) {
+			DEBUG(MTD_DEBUG_LEVEL2, "INFTL: Empty VUC %d for deletion was already absent\n", thisEUN);
+			return;
+		}
+
 		/* Find oldest unit in chain. */
-		thisEUN = inftl->VUtable[thisVUC];
-		prevEUN = BLOCK_NIL;
 		while (inftl->PUtable[thisEUN] != BLOCK_NIL) {
-			prevEUN = thisEUN;
-			thisEUN = inftl->PUtable[thisEUN];
+			BUG_ON(thisEUN >= inftl->nb_blocks);
+
+			prevEUN = &inftl->PUtable[thisEUN];
+			thisEUN = *prevEUN;
 		}
 
+		DEBUG(MTD_DEBUG_LEVEL3, "Deleting EUN %d from VUC %d\n",
+		      thisEUN, thisVUC);
+
                 if (INFTL_formatblock(inftl, thisEUN) < 0) {
 			/*
 			 * Could not erase : mark block as reserved.
-			 * FixMe: Update Bad Unit Table on disk.
+			 * FixMe: Update Bad Unit Table on medium.
 			 */
 			inftl->PUtable[thisEUN] = BLOCK_RESERVED;
                 } else {
 			/* Correctly erased : mark it as free */
 			inftl->PUtable[thisEUN] = BLOCK_FREE;
-			inftl->PUtable[prevEUN] = BLOCK_NIL;
 			inftl->numfreeEUNs++;
-                }
+		}
+
+		/* Now sort out whatever was pointing to it... */
+		*prevEUN = BLOCK_NIL;
+
+		/* Ideally we'd actually be responsive to new
+		   requests while we're doing this -- if there's
+		   free space why should others be made to wait? */
+		cond_resched();
 	}
 
 	inftl->VUtable[thisVUC] = BLOCK_NIL;
@@ -837,11 +856,11 @@
 
 static int inftl_getgeo(struct mtd_blktrans_dev *dev, struct hd_geometry *geo)
 {
-	struct NFTLrecord *nftl = (void *)dev;
+	struct INFTLrecord *inftl = (void *)dev;
 
-	geo->heads = nftl->heads;
-	geo->sectors = nftl->sectors;
-	geo->cylinders = nftl->cylinders;
+	geo->heads = inftl->heads;
+	geo->sectors = inftl->sectors;
+	geo->cylinders = inftl->cylinders;
 
 	return 0;
 }
@@ -862,7 +881,7 @@
 
 int __init init_inftl(void)
 {
-	printk(KERN_INFO "INFTL: inftlcore.c $Revision: 1.11 $, "
+	printk(KERN_INFO "INFTL: inftlcore.c $Revision: 1.14 $, "
 		"inftlmount.c %s\n", inftlmountrev);
 
 	return register_mtd_blktrans(&inftl_tr);
diff -urN linux-2.5.73-bk4/drivers/pci/hotplug/acpiphp_core.c linux-2.5.73-bk5/drivers/pci/hotplug/acpiphp_core.c
--- linux-2.5.73-bk4/drivers/pci/hotplug/acpiphp_core.c	2003-06-22 11:32:57.000000000 -0700
+++ linux-2.5.73-bk5/drivers/pci/hotplug/acpiphp_core.c	2003-06-27 04:49:35.000000000 -0700
@@ -380,6 +380,25 @@
 }
 
 /**
+ * release_slot - free up the memory used by a slot
+ * @hotplug_slot: slot to free
+ */
+static void release_slot(struct hotplug_slot *hotplug_slot)
+{
+	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+
+	if (slot == NULL)
+		return;
+
+	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+
+	kfree(slot->hotplug_slot->info);
+	kfree(slot->hotplug_slot->name);
+	kfree(slot->hotplug_slot);
+	kfree(slot);
+}
+
+/**
  * init_slots - initialize 'struct slot' structures for each slot
  *
  */
@@ -422,6 +441,7 @@
 		slot->number = i;
 
 		slot->hotplug_slot->private = slot;
+		slot->hotplug_slot->release = &release_slot;
 		slot->hotplug_slot->ops = &acpi_hotplug_slot_ops;
 
 		slot->acpi_slot = get_slot_from_id(i);
@@ -435,10 +455,7 @@
 		retval = pci_hp_register(slot->hotplug_slot);
 		if (retval) {
 			err("pci_hp_register failed with error %d\n", retval);
-			kfree(slot->hotplug_slot->info);
-			kfree(slot->hotplug_slot->name);
-			kfree(slot->hotplug_slot);
-			kfree(slot);
+			release_slot(slot->hotplug_slot);
 			return retval;
 		}
 
@@ -457,13 +474,10 @@
 	struct slot *slot;
 
 	list_for_each_safe (tmp, n, &slot_list) {
+		/* memory will be freed in release_slot callback */
 		slot = list_entry(tmp, struct slot, slot_list);
 		list_del(&slot->slot_list);
 		pci_hp_deregister(slot->hotplug_slot);
-		kfree(slot->hotplug_slot->info);
-		kfree(slot->hotplug_slot->name);
-		kfree(slot->hotplug_slot);
-		kfree(slot);
 	}
 
 	return;
diff -urN linux-2.5.73-bk4/drivers/pci/hotplug/cpci_hotplug_core.c linux-2.5.73-bk5/drivers/pci/hotplug/cpci_hotplug_core.c
--- linux-2.5.73-bk4/drivers/pci/hotplug/cpci_hotplug_core.c	2003-06-22 11:32:43.000000000 -0700
+++ linux-2.5.73-bk5/drivers/pci/hotplug/cpci_hotplug_core.c	2003-06-27 04:49:35.000000000 -0700
@@ -278,6 +278,19 @@
 	return 0;
 }
 
+static void release_slot(struct hotplug_slot *hotplug_slot)
+{
+	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+
+	if(slot == NULL)
+		return;
+
+	kfree(slot->hotplug_slot->info);
+	kfree(slot->hotplug_slot->name);
+	kfree(slot->hotplug_slot);
+	kfree(slot);
+}
+
 #define SLOT_NAME_SIZE	6
 static void
 make_slot_name(struct slot *slot)
@@ -346,6 +359,7 @@
 		slot->devfn = PCI_DEVFN(i, 0);
 
 		hotplug_slot->private = slot;
+		hotplug_slot->release = &release_slot;
 		make_slot_name(slot);
 		hotplug_slot->ops = &cpci_hotplug_slot_ops;
 
@@ -382,6 +396,7 @@
 {
 	struct slot *slot;
 	struct list_head *tmp;
+	struct list_head *next;
 	int status;
 
 	if(!bus) {
@@ -393,7 +408,7 @@
 		spin_unlock(&list_lock);
 		return -1;
 	}
-	list_for_each(tmp, &slot_list) {
+	list_for_each_safe(tmp, next, &slot_list) {
 		slot = list_entry(tmp, struct slot, slot_list);
 		if(slot->bus == bus) {
 			dbg("deregistering slot %s", slot->hotplug_slot->name);
@@ -405,11 +420,6 @@
 			}
 
 			list_del(&slot->slot_list);
-			kfree(slot->hotplug_slot->info);
-			kfree(slot->hotplug_slot->name);
-			kfree(slot->hotplug_slot);
-			kfree(slot);
-
 			slots--;
 		}
 	}
diff -urN linux-2.5.73-bk4/drivers/pci/hotplug/cpqphp_core.c linux-2.5.73-bk5/drivers/pci/hotplug/cpqphp_core.c
--- linux-2.5.73-bk4/drivers/pci/hotplug/cpqphp_core.c	2003-06-22 11:32:27.000000000 -0700
+++ linux-2.5.73-bk5/drivers/pci/hotplug/cpqphp_core.c	2003-06-27 04:49:35.000000000 -0700
@@ -312,6 +312,20 @@
 	return previous;
 }
 
+static void release_slot(struct hotplug_slot *hotplug_slot)
+{
+	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	
+	if (slot == NULL)
+		return;
+	
+	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+
+	kfree(slot->hotplug_slot->info);
+	kfree(slot->hotplug_slot->name);
+	kfree(slot->hotplug_slot);
+	kfree(slot);
+}
 
 static int ctrl_slot_setup (struct controller * ctrl, void *smbios_start, void *smbios_table)
 {
@@ -401,6 +415,7 @@
 		new_slot->capabilities |= ((read_slot_enable(ctrl) << 2) >> ctrl_slot) & 0x04;
 
 		/* register this slot with the hotplug pci core */
+		new_slot->hotplug_slot->release = &release_slot;
 		new_slot->hotplug_slot->private = new_slot;
 		make_slot_name (new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot);
 		new_slot->hotplug_slot->ops = &cpqphp_hotplug_slot_ops;
@@ -415,10 +430,7 @@
 		result = pci_hp_register (new_slot->hotplug_slot);
 		if (result) {
 			err ("pci_hp_register failed with error %d\n", result);
-			kfree (new_slot->hotplug_slot->info);
-			kfree (new_slot->hotplug_slot->name);
-			kfree (new_slot->hotplug_slot);
-			kfree (new_slot);
+			release_slot(new_slot->hotplug_slot);
 			return result;
 		}
 		
@@ -430,10 +442,9 @@
 		slot_number++;
 	}
 
-	return(0);
+	return 0;
 }
 
-
 static int ctrl_slot_cleanup (struct controller * ctrl)
 {
 	struct slot *old_slot, *next_slot;
@@ -442,12 +453,9 @@
 	ctrl->slot = NULL;
 
 	while (old_slot) {
+		/* memory will be freed by the release_slot callback */
 		next_slot = old_slot->next;
 		pci_hp_deregister (old_slot->hotplug_slot);
-		kfree(old_slot->hotplug_slot->info);
-		kfree(old_slot->hotplug_slot->name);
-		kfree(old_slot->hotplug_slot);
-		kfree(old_slot);
 		old_slot = next_slot;
 	}
 
@@ -498,7 +506,7 @@
 	       sizeof(struct irq_routing_table)) / sizeof(struct irq_info);
 	// Make sure I got at least one entry
 	if (len == 0) {
-		if (PCIIRQRoutingInfoLength != NULL) kfree(PCIIRQRoutingInfoLength );
+		kfree(PCIIRQRoutingInfoLength);
 		return -1;
 	}
 
@@ -509,9 +517,7 @@
 
 		if ((tbus == bus_num) && (tdevice == dev_num)) {
 			*slot = tslot;
-
-			if (PCIIRQRoutingInfoLength != NULL)
-				kfree(PCIIRQRoutingInfoLength);
+			kfree(PCIIRQRoutingInfoLength);
 			return 0;
 		} else {
 			// Didn't get a match on the target PCI device. Check if the
@@ -540,10 +546,10 @@
 	// slot number for the bridge.
 	if (bridgeSlot != 0xFF) {
 		*slot = bridgeSlot;
-		if (PCIIRQRoutingInfoLength != NULL) kfree(PCIIRQRoutingInfoLength );
+		kfree(PCIIRQRoutingInfoLength);
 		return 0;
 	}
-	if (PCIIRQRoutingInfoLength != NULL) kfree(PCIIRQRoutingInfoLength );
+	kfree(PCIIRQRoutingInfoLength);
 	// Couldn't find an entry in the routing table for this PCI device
 	return -1;
 }
diff -urN linux-2.5.73-bk4/drivers/pci/hotplug/ibmphp.h linux-2.5.73-bk5/drivers/pci/hotplug/ibmphp.h
--- linux-2.5.73-bk4/drivers/pci/hotplug/ibmphp.h	2003-06-22 11:32:33.000000000 -0700
+++ linux-2.5.73-bk5/drivers/pci/hotplug/ibmphp.h	2003-06-27 04:49:35.000000000 -0700
@@ -7,7 +7,7 @@
  * Written By: Jyoti Shah, Tong Yu, Irene Zubarev, IBM Corporation
  *
  * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
- * Copyright (c) 2001,2002 IBM Corp.
+ * Copyright (c) 2001-2003 IBM Corp.
  *
  * All rights reserved.
  *
@@ -398,7 +398,6 @@
 extern int ibmphp_hpc_writeslot (struct slot *, u8);
 extern void ibmphp_lock_operations (void);
 extern void ibmphp_unlock_operations (void);
-extern int ibmphp_hpc_fillhpslotinfo (struct hotplug_slot *);
 extern int ibmphp_hpc_start_poll_thread (void);
 extern void ibmphp_hpc_stop_poll_thread (void);
 
diff -urN linux-2.5.73-bk4/drivers/pci/hotplug/ibmphp_core.c linux-2.5.73-bk5/drivers/pci/hotplug/ibmphp_core.c
--- linux-2.5.73-bk4/drivers/pci/hotplug/ibmphp_core.c	2003-06-22 11:33:36.000000000 -0700
+++ linux-2.5.73-bk5/drivers/pci/hotplug/ibmphp_core.c	2003-06-27 04:49:35.000000000 -0700
@@ -3,8 +3,8 @@
  *
  * Written By: Chuck Cole, Jyoti Shah, Tong Yu, Irene Zubarev, IBM Corporation
  *
- * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
- * Copyright (c) 2001,2002 IBM Corp.
+ * Copyright (c) 2001,2003 Greg Kroah-Hartman (greg@kroah.com)
+ * Copyright (c) 2001-2003 IBM Corp.
  *
  * All rights reserved.
  *
@@ -739,26 +739,8 @@
 	debug ("%s -- enter\n", __FUNCTION__);
 
 	list_for_each_safe (tmp, next, &ibmphp_slot_head) {
-	
 		slot_cur = list_entry (tmp, struct slot, ibm_slot_list);
-
 		pci_hp_deregister (slot_cur->hotplug_slot);
-
-		if (slot_cur->hotplug_slot) {
-			kfree (slot_cur->hotplug_slot);
-			slot_cur->hotplug_slot = NULL;
-		}
-
-		if (slot_cur->ctrl) 
-			slot_cur->ctrl = NULL;
-		
-		if (slot_cur->bus_on) 
-			slot_cur->bus_on = NULL;
-
-		ibmphp_unconfigure_card (&slot_cur, -1);  /* we don't want to actually remove the resources, since free_resources will do just that */
-
-		kfree (slot_cur);
-		slot_cur = NULL;
 	}
 	debug ("%s -- exit\n", __FUNCTION__);
 }
@@ -1221,7 +1203,6 @@
 {
 	int rc;
 	u8 flag;
-	int parm = 0;
 
 	debug ("DISABLING SLOT... \n"); 
 		
@@ -1270,7 +1251,7 @@
 		return 0;
 	}
 
-	rc = ibmphp_unconfigure_card (&slot_cur, parm);
+	rc = ibmphp_unconfigure_card (&slot_cur, 0);
 	slot_cur->func = NULL;
 	debug ("in disable_slot. after unconfigure_card\n");
 	if (rc) {
diff -urN linux-2.5.73-bk4/drivers/pci/hotplug/ibmphp_ebda.c linux-2.5.73-bk5/drivers/pci/hotplug/ibmphp_ebda.c
--- linux-2.5.73-bk4/drivers/pci/hotplug/ibmphp_ebda.c	2003-06-22 11:32:34.000000000 -0700
+++ linux-2.5.73-bk5/drivers/pci/hotplug/ibmphp_ebda.c	2003-06-27 04:49:35.000000000 -0700
@@ -3,8 +3,8 @@
  *
  * Written By: Tong Yu, IBM Corporation
  *
- * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
- * Copyright (c) 2001,2002 IBM Corp.
+ * Copyright (c) 2001,2003 Greg Kroah-Hartman (greg@kroah.com)
+ * Copyright (c) 2001-2003 IBM Corp.
  *
  * All rights reserved.
  *
@@ -727,6 +727,64 @@
 	return str;
 }
 
+static int fillslotinfo(struct hotplug_slot *hotplug_slot)
+{
+	struct slot *slot;
+	int rc = 0;
+
+	if (!hotplug_slot || !hotplug_slot->private)
+		return -EINVAL;
+
+	slot = hotplug_slot->private;
+	rc = ibmphp_hpc_readslot(slot, READ_ALLSTAT, NULL);
+	if (rc)
+		return rc;
+
+	// power - enabled:1  not:0
+	hotplug_slot->info->power_status = SLOT_POWER(slot->status);
+
+	// attention - off:0, on:1, blinking:2
+	hotplug_slot->info->attention_status = SLOT_ATTN(slot->status, slot->ext_status);
+
+	// latch - open:1 closed:0
+	hotplug_slot->info->latch_status = SLOT_LATCH(slot->status);
+
+	// pci board - present:1 not:0
+	if (SLOT_PRESENT (slot->status))
+		hotplug_slot->info->adapter_status = 1;
+	else
+		hotplug_slot->info->adapter_status = 0;
+/*
+	if (slot->bus_on->supported_bus_mode
+		&& (slot->bus_on->supported_speed == BUS_SPEED_66))
+		hotplug_slot->info->max_bus_speed_status = BUS_SPEED_66PCIX;
+	else
+		hotplug_slot->info->max_bus_speed_status = slot->bus_on->supported_speed;
+*/
+
+	return rc;
+}
+
+static void release_slot(struct hotplug_slot *hotplug_slot)
+{
+	struct slot *slot;
+
+	if (!hotplug_slot || !hotplug_slot->private)
+		return;
+
+	slot = hotplug_slot->private;
+	kfree(slot->hotplug_slot->info);
+	kfree(slot->hotplug_slot->name);
+	kfree(slot->hotplug_slot);
+	slot->ctrl = NULL;
+	slot->bus_on = NULL;
+
+	/* we don't want to actually remove the resources, since free_resources will do just that */
+	ibmphp_unconfigure_card(&slot, -1);
+
+	kfree (slot);
+}
+
 static struct pci_driver ibmphp_driver;
 
 /*
@@ -900,32 +958,32 @@
 		// register slots with hpc core as well as create linked list of ibm slot
 		for (index = 0; index < hpc_ptr->slot_count; index++) {
 
-			hp_slot_ptr = (struct hotplug_slot *) kmalloc (sizeof (struct hotplug_slot), GFP_KERNEL);
+			hp_slot_ptr = kmalloc(sizeof(*hp_slot_ptr), GFP_KERNEL);
 			if (!hp_slot_ptr) {
 				rc = -ENOMEM;
 				goto error_no_hp_slot;
 			}
-			memset (hp_slot_ptr, 0, sizeof (struct hotplug_slot));
+			memset(hp_slot_ptr, 0, sizeof(*hp_slot_ptr));
 
-			hp_slot_ptr->info = (struct hotplug_slot_info *) kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
+			hp_slot_ptr->info = kmalloc (sizeof(struct hotplug_slot_info), GFP_KERNEL);
 			if (!hp_slot_ptr->info) {
 				rc = -ENOMEM;
 				goto error_no_hp_info;
 			}
-			memset (hp_slot_ptr->info, 0, sizeof (struct hotplug_slot_info));
+			memset(hp_slot_ptr->info, 0, sizeof(struct hotplug_slot_info));
 
-			hp_slot_ptr->name = (char *) kmalloc (30, GFP_KERNEL);
+			hp_slot_ptr->name = kmalloc(30, GFP_KERNEL);
 			if (!hp_slot_ptr->name) {
 				rc = -ENOMEM;
 				goto error_no_hp_name;
 			}
 
-			tmp_slot = kmalloc (sizeof (struct slot), GFP_KERNEL);
+			tmp_slot = kmalloc(sizeof(*tmp_slot), GFP_KERNEL);
 			if (!tmp_slot) {
 				rc = -ENOMEM;
 				goto error_no_slot;
 			}
-			memset (tmp_slot, 0, sizeof (*tmp_slot));
+			memset(tmp_slot, 0, sizeof(*tmp_slot));
 
 			tmp_slot->flag = TRUE;
 
@@ -959,8 +1017,9 @@
 			tmp_slot->hotplug_slot = hp_slot_ptr;
 
 			hp_slot_ptr->private = tmp_slot;
+			hp_slot_ptr->release = release_slot;
 
-			rc = ibmphp_hpc_fillhpslotinfo (hp_slot_ptr);
+			rc = fillslotinfo(hp_slot_ptr);
 			if (rc)
 				goto error;
 
diff -urN linux-2.5.73-bk4/drivers/pci/hotplug/ibmphp_hpc.c linux-2.5.73-bk5/drivers/pci/hotplug/ibmphp_hpc.c
--- linux-2.5.73-bk4/drivers/pci/hotplug/ibmphp_hpc.c	2003-06-27 04:49:30.000000000 -0700
+++ linux-2.5.73-bk5/drivers/pci/hotplug/ibmphp_hpc.c	2003-06-27 04:49:35.000000000 -0700
@@ -3,7 +3,7 @@
  *
  * Written By: Jyoti Shah, IBM Corporation
  *
- * Copyright (c) 2001-2002 IBM Corp.
+ * Copyright (c) 2001-2003 IBM Corp.
  *
  * All rights reserved.
  *
@@ -114,7 +114,6 @@
 static void get_hpc_access (void);
 static void free_hpc_access (void);
 static void poll_hpc (void);
-static int update_slot (struct slot *, u8);
 static int process_changeinstatus (struct slot *, struct slot *);
 static int process_changeinlatch (u8, u8, struct controller *);
 static int hpc_poll_thread (void *);
@@ -917,71 +916,6 @@
 }
 
 
-/* ----------------------------------------------------------------------
- *  Name:    ibmphp_hpc_fillhpslotinfo(hotplug_slot * phpslot)
- *
- *  Action:  fill out the hotplug_slot info
- *
- *  Input:   pointer to hotplug_slot
- *
- *  Return
- *  Value:   0 or error codes
- *-----------------------------------------------------------------------*/
-int ibmphp_hpc_fillhpslotinfo (struct hotplug_slot *phpslot)
-{
-	int rc = 0;
-	struct slot *pslot;
-
-	if (phpslot && phpslot->private) {
-		pslot = (struct slot *) phpslot->private;
-		rc = update_slot (pslot, (u8) TRUE);
-		if (!rc) {
-
-			// power - enabled:1  not:0
-			phpslot->info->power_status = SLOT_POWER (pslot->status);
-
-			// attention - off:0, on:1, blinking:2
-			phpslot->info->attention_status = SLOT_ATTN (pslot->status, pslot->ext_status);
-
-			// latch - open:1 closed:0
-			phpslot->info->latch_status = SLOT_LATCH (pslot->status);
-
-			// pci board - present:1 not:0
-			if (SLOT_PRESENT (pslot->status))
-				phpslot->info->adapter_status = 1;
-			else
-				phpslot->info->adapter_status = 0;
-/*
-			if (pslot->bus_on->supported_bus_mode
-				&& (pslot->bus_on->supported_speed == BUS_SPEED_66))
-				phpslot->info->max_bus_speed_status = BUS_SPEED_66PCIX;
-			else
-				phpslot->info->max_bus_speed_status = pslot->bus_on->supported_speed;
-*/		} else
-			rc = -EINVAL;
-	} else
-		rc = -EINVAL;
-
-	return rc;
-}
-
-/*----------------------------------------------------------------------
-* Name:    update_slot
-*
-* Action:  fill out slot status and extended status, controller status
-*
-* Input:   pointer to slot struct
-*---------------------------------------------------------------------*/
-static int update_slot (struct slot *pslot, u8 update)
-{
-	int rc = 0;
-
-	debug ("%s - Entry pslot[%p]\n", __FUNCTION__, pslot);
-	rc = ibmphp_hpc_readslot (pslot, READ_ALLSTAT, NULL);
-	debug ("%s - Exit rc[%d]\n", __FUNCTION__, rc);
-	return rc;
-}
-
 /*----------------------------------------------------------------------
 * Name:    process_changeinstatus
 *
diff -urN linux-2.5.73-bk4/drivers/pci/hotplug/pcihp_skeleton.c linux-2.5.73-bk5/drivers/pci/hotplug/pcihp_skeleton.c
--- linux-2.5.73-bk4/drivers/pci/hotplug/pcihp_skeleton.c	2003-06-22 11:32:55.000000000 -0700
+++ linux-2.5.73-bk5/drivers/pci/hotplug/pcihp_skeleton.c	2003-06-27 04:49:35.000000000 -0700
@@ -1,8 +1,8 @@
 /*
- * PCI Hot Plug Controller Skeleton Driver - 0.1
+ * PCI Hot Plug Controller Skeleton Driver - 0.2
  *
- * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
- * Copyright (c) 2001 IBM Corp.
+ * Copyright (c) 2001,2003 Greg Kroah-Hartman (greg@kroah.com)
+ * Copyright (c) 2001,2003 IBM Corp.
  *
  * All rights reserved.
  *
@@ -69,7 +69,7 @@
 static int debug;
 static int num_slots;
 
-#define DRIVER_VERSION	"0.1"
+#define DRIVER_VERSION	"0.2"
 #define DRIVER_AUTHOR	"Greg Kroah-Hartman <greg@kroah.com>"
 #define DRIVER_DESC	"Hot Plug PCI Controller Skeleton Driver"
 
@@ -288,6 +288,21 @@
 	return retval;
 }
 
+static void release_slots(struct hotplug_slot *hotplug_slot)
+{
+	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+	int retval = 0;
+
+	if (slot == NULL)
+		return -ENODEV;
+
+	dbg(__FUNCTION__" - physical_slot = %s\n", hotplug_slot->name);
+	kfree(slot->hotplug_slot->info);
+	kfree(slot->hotplug_slot->name);
+	kfree(slot->hotplug_slot);
+	kfree(slot);
+}
+
 #define SLOT_NAME_SIZE	10
 static void make_slot_name (struct slot *slot)
 {
@@ -347,6 +362,7 @@
 		slot->number = i;
 
 		hotplug_slot->private = slot;
+		hotplug_slot->release = &release_slot;
 		make_slot_name (slot);
 		hotplug_slot->ops = &skel_hotplug_slot_ops;
 		
@@ -376,27 +392,23 @@
 
 	return retval;
 }
-		
-static void cleanup_slots (void)
+
+static void cleanup_slots(void)
 {
 	struct list_head *tmp;
+	struct list_head *next;
 	struct slot *slot;
 
 	/*
-	 * Unregister all of our slots with the pci_hotplug subsystem,
-	 * and free up all memory that we had allocated.
+	 * Unregister all of our slots with the pci_hotplug subsystem.
+	 * Memory will be freed in release_slot() callback after slot's
+	 * lifespan is finished.
 	 */
-	list_for_each (tmp, &slot_list) {
+	list_for_each_safe (tmp, next, &slot_list) {
 		slot = list_entry (tmp, struct slot, slot_list);
 		list_del (&slot->slot_list);
 		pci_hp_deregister (slot->hotplug_slot);
-		kfree (slot->hotplug_slot->info);
-		kfree (slot->hotplug_slot->name);
-		kfree (slot->hotplug_slot);
-		kfree (slot);
 	}
-
-	return;
 }
 		
 static int __init pcihp_skel_init(void)
diff -urN linux-2.5.73-bk4/drivers/pci/probe.c linux-2.5.73-bk5/drivers/pci/probe.c
--- linux-2.5.73-bk4/drivers/pci/probe.c	2003-06-27 04:49:30.000000000 -0700
+++ linux-2.5.73-bk5/drivers/pci/probe.c	2003-06-27 04:49:35.000000000 -0700
@@ -109,7 +109,7 @@
 						(((unsigned long) ~sz) << 32);
 #else
 			if (l) {
-				printk(KERN_ERR "PCI: Unable to handle 64-bit address for device %s\n", dev->slot_name);
+				printk(KERN_ERR "PCI: Unable to handle 64-bit address for device %s\n", pci_name(dev));
 				res->start = 0;
 				res->flags = 0;
 				continue;
@@ -304,7 +304,7 @@
 	pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses);
 
 	DBG("Scanning behind PCI bridge %s, config %06x, pass %d\n",
-	    dev->slot_name, buses & 0xffffff, pass);
+	    pci_name(dev), buses & 0xffffff, pass);
 
 	if ((buses & 0xffff00) && !pcibios_assign_all_busses() && !is_cardbus) {
 		unsigned int cmax;
@@ -403,8 +403,9 @@
 {
 	u32 class;
 
-	sprintf(dev->slot_name, "%02x:%02x.%d", dev->bus->number,
-		PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
+	dev->slot_name = dev->dev.bus_id;
+	sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus),
+		dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
 	sprintf(dev->dev.name, "PCI device %04x:%04x",
 		dev->vendor, dev->device);
 
@@ -452,12 +453,12 @@
 
 	default:				    /* unknown header */
 		printk(KERN_ERR "PCI: device %s has unknown header type %02x, ignoring.\n",
-			dev->slot_name, dev->hdr_type);
+			pci_name(dev), dev->hdr_type);
 		return -1;
 
 	bad:
 		printk(KERN_ERR "PCI: %s: class %x doesn't match header type %02x. Ignoring class.\n",
-		       dev->slot_name, class, dev->hdr_type);
+		       pci_name(dev), class, dev->hdr_type);
 		dev->class = PCI_CLASS_NOT_DEFINED;
 	}
 
@@ -531,9 +532,6 @@
 
 	pci_name_device(dev);
 
-	/* now put in global tree */
-	sprintf(dev->dev.bus_id, "%04x:%s", pci_domain_nr(bus),
-			dev->slot_name);
 	dev->dev.dma_mask = &dev->dma_mask;
 
 	return dev;
diff -urN linux-2.5.73-bk4/drivers/scsi/Kconfig linux-2.5.73-bk5/drivers/scsi/Kconfig
--- linux-2.5.73-bk4/drivers/scsi/Kconfig	2003-06-22 11:33:16.000000000 -0700
+++ linux-2.5.73-bk5/drivers/scsi/Kconfig	2003-06-27 04:49:35.000000000 -0700
@@ -1,3 +1,27 @@
+menu "SCSI device support"
+
+config SCSI
+	tristate "SCSI device support"
+	---help---
+	  If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
+	  any other SCSI device under Linux, say Y and make sure that you know
+	  the name of your SCSI host adapter (the card inside your computer
+	  that "speaks" the SCSI protocol, also called SCSI controller),
+	  because you will be asked for it.
+
+	  You also need to say Y here if you have a device which speaks
+	  the SCSI protocol.  Examples of this include the parallel port
+	  version of the IOMEGA ZIP drive, USB storage devices, Fibre
+	  Channel, FireWire storage and the IDE-SCSI emulation driver.
+
+	  This driver is also available as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want).
+	  The module will be called scsi_mod.  If you want to compile it as
+	  a module, say M here and read <file:Documentation/modules.txt> and
+	  <file:Documentation/scsi/scsi.txt>.  However, do not compile this as a
+	  module if your root file system (the one containing the directory /)
+	  is located on a SCSI device.
+
 comment "SCSI support type (disk, tape, CD-ROM)"
 	depends on SCSI
 
@@ -5,9 +29,10 @@
 	tristate "SCSI disk support"
 	depends on SCSI
 	---help---
-	  If you want to use a SCSI hard disk or the SCSI or parallel port
-	  version of the IOMEGA ZIP drive under Linux, say Y and read the
-	  SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from
+	  If you want to use SCSI hard disks, Fibre Channel disks,
+	  USB storage or the SCSI or parallel port version of
+	  the IOMEGA ZIP drive, say Y and read the SCSI-HOWTO,
+	  the Disk-HOWTO and the Multi-Disk-HOWTO, available from
 	  <http://www.tldp.org/docs.html#howto>. This is NOT for SCSI
 	  CD-ROMs.
 
@@ -65,10 +90,10 @@
 	tristate "SCSI CDROM support"
 	depends on SCSI
 	---help---
-	  If you want to use a SCSI CD-ROM under Linux, say Y and read the
-	  SCSI-HOWTO and the CD-ROM-HOWTO at
-	  <http://www.tldp.org/docs.html#howto>. Also make sure to say Y
-	  or M to "ISO 9660 CD-ROM file system support" later.
+	  If you want to use a SCSI or FireWire CD-ROM under Linux,
+	  say Y and read the SCSI-HOWTO and the CDROM-HOWTO at
+	  <http://www.tldp.org/docs.html#howto>. Also make sure to say
+	  Y or M to "ISO 9660 CD-ROM file system support" later.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1823,3 +1848,4 @@
 
 source "drivers/scsi/pcmcia/Kconfig"
 
+endmenu
diff -urN linux-2.5.73-bk4/include/asm-arm26/processor.h linux-2.5.73-bk5/include/asm-arm26/processor.h
--- linux-2.5.73-bk4/include/asm-arm26/processor.h	2003-06-22 11:32:56.000000000 -0700
+++ linux-2.5.73-bk5/include/asm-arm26/processor.h	2003-06-27 04:49:36.000000000 -0700
@@ -100,10 +100,6 @@
 /* Free all resources held by a thread. */
 extern void release_thread(struct task_struct *);
 
-/* Copy and release all segment info associated with a VM */
-#define copy_segments(tsk, mm)		do { } while (0)
-#define release_segments(mm)		do { } while (0)
-
 unsigned long get_wchan(struct task_struct *p);
 
 #define cpu_relax()			barrier()
diff -urN linux-2.5.73-bk4/include/asm-h8300/processor.h linux-2.5.73-bk5/include/asm-h8300/processor.h
--- linux-2.5.73-bk4/include/asm-h8300/processor.h	2003-06-22 11:32:33.000000000 -0700
+++ linux-2.5.73-bk5/include/asm-h8300/processor.h	2003-06-27 04:49:36.000000000 -0700
@@ -89,9 +89,6 @@
 
 extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
 
-#define copy_segments(tsk, mm)	do { } while (0)
-#define release_segments(mm)	do { } while (0)
-#define forget_segments()	do { } while (0)
 #define prepare_to_copy(tsk)	do { } while (0)
 
 /*
diff -urN linux-2.5.73-bk4/include/asm-sparc/bug.h linux-2.5.73-bk5/include/asm-sparc/bug.h
--- linux-2.5.73-bk4/include/asm-sparc/bug.h	2003-06-22 11:33:36.000000000 -0700
+++ linux-2.5.73-bk5/include/asm-sparc/bug.h	2003-06-27 04:49:36.000000000 -0700
@@ -2,14 +2,19 @@
 #ifndef _SPARC_BUG_H
 #define _SPARC_BUG_H
 
+/* Only use the inline asm until a gcc release that can handle __builtin_trap
+ * -rob 2003-06-25 */
+#define __bug_trap()					\
+	__asm__ __volatile__ ("t 0x5\n\t" : : )
+
 #ifdef CONFIG_DEBUG_BUGVERBOSE
 extern void do_BUG(const char *file, int line);
 #define BUG() do {					\
 	do_BUG(__FILE__, __LINE__);			\
-	__builtin_trap();				\
+	__bug_trap();				\
 } while (0)
 #else
-#define BUG()		__builtin_trap()
+#define BUG()		__bug_trap()
 #endif
 
 #define BUG_ON(condition) do { \
diff -urN linux-2.5.73-bk4/include/asm-x86_64/floppy.h linux-2.5.73-bk5/include/asm-x86_64/floppy.h
--- linux-2.5.73-bk4/include/asm-x86_64/floppy.h	2003-06-22 11:32:38.000000000 -0700
+++ linux-2.5.73-bk5/include/asm-x86_64/floppy.h	2003-06-27 04:49:36.000000000 -0700
@@ -22,7 +22,7 @@
  * floppy accesses go through the track buffer.
  */
 #define _CROSS_64KB(a,s,vdma) \
-(!vdma && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
+(!(vdma) && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
 
 #define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1)
 
@@ -62,10 +62,8 @@
 	static int bytes=0;
 	static int dma_wait=0;
 #endif
-	if(!doing_pdma) {
-		floppy_interrupt(irq, dev_id, regs);
-		return IRQ_HANDLED;
-	}
+	if (!doing_pdma)
+		return floppy_interrupt(irq, dev_id, regs);
 
 #ifdef TRACE_FLPY_INT
 	if(!calls)
@@ -115,7 +113,6 @@
 	if(!virtual_dma_count)
 		dma_wait++;
 #endif
-
 	return IRQ_HANDLED;
 }
 
diff -urN linux-2.5.73-bk4/include/asm-x86_64/mtrr.h linux-2.5.73-bk5/include/asm-x86_64/mtrr.h
--- linux-2.5.73-bk4/include/asm-x86_64/mtrr.h	2003-06-22 11:32:35.000000000 -0700
+++ linux-2.5.73-bk5/include/asm-x86_64/mtrr.h	2003-06-27 04:49:36.000000000 -0700
@@ -104,7 +104,7 @@
     return -ENODEV;
 }
 
-static __inline__ void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi) {;}
+static __inline__ void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi) {}
 
 #  endif
 
diff -urN linux-2.5.73-bk4/include/asm-x86_64/pgtable.h linux-2.5.73-bk5/include/asm-x86_64/pgtable.h
--- linux-2.5.73-bk4/include/asm-x86_64/pgtable.h	2003-06-22 11:33:02.000000000 -0700
+++ linux-2.5.73-bk5/include/asm-x86_64/pgtable.h	2003-06-27 04:49:36.000000000 -0700
@@ -401,6 +401,9 @@
 #define pgtable_cache_init()   do { } while (0)
 #define check_pgt_cache()      do { } while (0)
 
+#define PAGE_AGP    PAGE_KERNEL_NOCACHE
+#define HAVE_PAGE_AGP 1
+
 /* fs/proc/kcore.c */
 #define	kc_vaddr_to_offset(v) ((v) & __VIRTUAL_MASK)
 #define	kc_offset_to_vaddr(o) \
diff -urN linux-2.5.73-bk4/include/asm-x86_64/processor.h linux-2.5.73-bk5/include/asm-x86_64/processor.h
--- linux-2.5.73-bk4/include/asm-x86_64/processor.h	2003-06-22 11:33:33.000000000 -0700
+++ linux-2.5.73-bk5/include/asm-x86_64/processor.h	2003-06-27 04:49:36.000000000 -0700
@@ -280,8 +280,6 @@
  */
 extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
 
-static inline void release_segments(struct mm_struct *mm) { }
-
 /*
  * Return saved PC of a blocked thread.
  * What is this good for? it will be always the scheduler or ret_from_fork.
diff -urN linux-2.5.73-bk4/include/asm-x86_64/proto.h linux-2.5.73-bk5/include/asm-x86_64/proto.h
--- linux-2.5.73-bk4/include/asm-x86_64/proto.h	2003-06-22 11:33:15.000000000 -0700
+++ linux-2.5.73-bk5/include/asm-x86_64/proto.h	2003-06-27 04:49:36.000000000 -0700
@@ -52,7 +52,6 @@
 
 extern unsigned long cpu_initialized;
 
-extern void show_stack(unsigned long * rsp);
 extern void show_trace(unsigned long * rsp);
 extern void show_registers(struct pt_regs *regs);
 
diff -urN linux-2.5.73-bk4/include/asm-x86_64/unistd.h linux-2.5.73-bk5/include/asm-x86_64/unistd.h
--- linux-2.5.73-bk4/include/asm-x86_64/unistd.h	2003-06-22 11:32:58.000000000 -0700
+++ linux-2.5.73-bk5/include/asm-x86_64/unistd.h	2003-06-27 04:49:36.000000000 -0700
@@ -486,10 +486,10 @@
 __SYSCALL(__NR_lookup_dcookie, sys_lookup_dcookie)
 #define __NR_epoll_create	213
 __SYSCALL(__NR_epoll_create, sys_epoll_create)
-#define __NR_epoll_ctl	214
-__SYSCALL(__NR_epoll_ctl, sys_epoll_ctl)
-#define __NR_epoll_wait	215
-__SYSCALL(__NR_epoll_wait, sys_epoll_wait)
+#define __NR_epoll_ctl_old	214
+__SYSCALL(__NR_epoll_ctl_old, sys_ni_syscall)
+#define __NR_epoll_wait_old	215
+__SYSCALL(__NR_epoll_wait_old, sys_ni_syscall)
 #define __NR_remap_file_pages	216
 __SYSCALL(__NR_remap_file_pages, sys_remap_file_pages)
 #define __NR_getdents64	217
@@ -522,8 +522,12 @@
 __SYSCALL(__NR_clock_nanosleep, sys_clock_nanosleep)
 #define __NR_exit_group		231
 __SYSCALL(__NR_exit_group, sys_exit_group)
+#define __NR_epoll_wait		232
+__SYSCALL(__NR_epoll_wait, sys_epoll_wait)
+#define __NR_epoll_ctl		233
+__SYSCALL(__NR_epoll_ctl, sys_epoll_ctl)
 
-#define __NR_syscall_max __NR_exit_group
+#define __NR_syscall_max __NR_epoll_ctl
 #ifndef __NO_STUBS
 
 /* user-visible error numbers are in the range -1 - -4095 */
diff -urN linux-2.5.73-bk4/include/linux/eventpoll.h linux-2.5.73-bk5/include/linux/eventpoll.h
--- linux-2.5.73-bk4/include/linux/eventpoll.h	2003-06-22 11:32:43.000000000 -0700
+++ linux-2.5.73-bk5/include/linux/eventpoll.h	2003-06-27 04:49:36.000000000 -0700
@@ -23,10 +23,20 @@
 /* Set the Edge Triggered behaviour for the target file descriptor */
 #define EPOLLET (1 << 31)
 
+/* 
+ * On x86-64 make the 64bit structure have the same alignment as the
+ * 32bit structure. This makes 32bit emulation easier.
+ */
+#ifdef __x86_64__
+#define EPOLL_PACKED __attribute__((packed))
+#else
+#define EPOLL_PACKED
+#endif
+
 struct epoll_event {
 	__u32 events;
 	__u64 data;
-};
+} EPOLL_PACKED;
 
 #ifdef __KERNEL__
 
diff -urN linux-2.5.73-bk4/include/linux/mroute.h linux-2.5.73-bk5/include/linux/mroute.h
--- linux-2.5.73-bk4/include/linux/mroute.h	2003-06-22 11:32:45.000000000 -0700
+++ linux-2.5.73-bk5/include/linux/mroute.h	2003-06-27 04:49:36.000000000 -0700
@@ -217,7 +217,6 @@
 	__u32	flags;
 };
 
-extern int pim_rcv(struct sk_buff *);
 extern int pim_rcv_v1(struct sk_buff *);
 
 struct rtmsg;
diff -urN linux-2.5.73-bk4/include/linux/netdevice.h linux-2.5.73-bk5/include/linux/netdevice.h
--- linux-2.5.73-bk4/include/linux/netdevice.h	2003-06-22 11:33:18.000000000 -0700
+++ linux-2.5.73-bk5/include/linux/netdevice.h	2003-06-27 04:49:36.000000000 -0700
@@ -90,11 +90,6 @@
 #define MAX_HEADER (LL_MAX_HEADER + 48)
 #endif
 
-/* Reserve 16byte aligned hard_header_len, but at least 16.
- * Alternative is: dev->hard_header_len ? (dev->hard_header_len + 15)&~15 : 0
- */
-#define LL_RESERVED_SPACE(dev) (((dev)->hard_header_len&~15) + 16)
-
 /*
  *	Network device statistics. Akin to the 2.0 ether stats but
  *	with byte counters.
@@ -205,6 +200,17 @@
 	unsigned long	hh_data[HH_DATA_ALIGN(LL_MAX_HEADER)];
 };
 
+/* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much.
+ * Alternative is:
+ *   dev->hard_header_len ? (dev->hard_header_len +
+ *                           (HH_DATA_MOD - 1)) & ~(HH_DATA_MOD - 1) : 0
+ *
+ * We could use other alignment values, but we must maintain the
+ * relationship HH alignment <= LL alignment.
+ */
+#define LL_RESERVED_SPACE(dev) \
+	(((dev)->hard_header_len&~(HH_DATA_MOD - 1)) + HH_DATA_MOD)
+
 /* These flag bits are private to the generic network queueing
  * layer, they may not be explicitly referenced by any other
  * code.
diff -urN linux-2.5.73-bk4/include/linux/netfilter_arp/arpt_mangle.h linux-2.5.73-bk5/include/linux/netfilter_arp/arpt_mangle.h
--- linux-2.5.73-bk4/include/linux/netfilter_arp/arpt_mangle.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.73-bk5/include/linux/netfilter_arp/arpt_mangle.h	2003-06-27 04:49:36.000000000 -0700
@@ -0,0 +1,26 @@
+#ifndef _ARPT_MANGLE_H
+#define _ARPT_MANGLE_H
+#include <linux/netfilter_arp/arp_tables.h>
+
+#define ARPT_MANGLE_ADDR_LEN_MAX sizeof(struct in_addr)
+struct arpt_mangle
+{
+	char src_devaddr[ARPT_DEV_ADDR_LEN_MAX];
+	char tgt_devaddr[ARPT_DEV_ADDR_LEN_MAX];
+	union {
+		struct in_addr src_ip;
+	} u_s;
+	union {
+		struct in_addr tgt_ip;
+	} u_t;
+	u_int8_t flags;
+	int target;
+};
+
+#define ARPT_MANGLE_SDEV 0x01
+#define ARPT_MANGLE_TDEV 0x02
+#define ARPT_MANGLE_SIP 0x04
+#define ARPT_MANGLE_TIP 0x08
+#define ARPT_MANGLE_MASK 0x0f
+
+#endif /* _ARPT_MANGLE_H */
diff -urN linux-2.5.73-bk4/include/linux/pci.h linux-2.5.73-bk5/include/linux/pci.h
--- linux-2.5.73-bk4/include/linux/pci.h	2003-06-27 04:49:30.000000000 -0700
+++ linux-2.5.73-bk5/include/linux/pci.h	2003-06-27 04:49:36.000000000 -0700
@@ -414,7 +414,7 @@
 	struct resource dma_resource[DEVICE_COUNT_DMA];
 	struct resource irq_resource[DEVICE_COUNT_IRQ];
 
-	char		slot_name[8];	/* slot name */
+	char *		slot_name;	/* pointer to dev.bus_id */
 
 	/* These fields are used by common fixups */
 	unsigned int	transparent:1;	/* Transparent PCI bridge */
@@ -804,6 +804,14 @@
 	dev_set_drvdata(&pdev->dev, data);
 }
 
+/* If you want to know what to call your pci_dev, ask this function.
+ * Again, it's a wrapper around the generic device.
+ */
+static inline char *pci_name(struct pci_dev *pdev)
+{
+	return pdev->dev.bus_id;
+}
+
 /*
  *  The world is not perfect and supplies us with broken PCI devices.
  *  For at least a part of these bugs we need a work-around, so both
diff -urN linux-2.5.73-bk4/net/ipv4/igmp.c linux-2.5.73-bk5/net/ipv4/igmp.c
--- linux-2.5.73-bk4/net/ipv4/igmp.c	2003-06-27 04:49:30.000000000 -0700
+++ linux-2.5.73-bk5/net/ipv4/igmp.c	2003-06-27 04:49:36.000000000 -0700
@@ -757,9 +757,10 @@
 	read_unlock(&in_dev->lock);
 }
 
-static void igmp_heard_query(struct in_device *in_dev, struct igmphdr *ih,
+static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb,
 	int len)
 {
+	struct igmphdr 		*ih = skb->h.igmph;
 	struct igmpv3_query *ih3 = (struct igmpv3_query *)ih;
 	struct ip_mc_list	*im;
 	u32			group = ih->group;
@@ -790,6 +791,17 @@
 	} else if (len < 12) {
 		return;	/* ignore bogus packet; freed by caller */
 	} else { /* v3 */
+		if (!pskb_may_pull(skb, sizeof(struct igmpv3_query)))
+			return;
+		
+		ih3 = (struct igmpv3_query *) skb->h.raw;
+		if (ih3->nsrcs) {
+			if (!pskb_may_pull(skb, sizeof(struct igmpv3_query) 
+					   + ntohs(ih3->nsrcs)*sizeof(__u32)))
+				return;
+			ih3 = (struct igmpv3_query *) skb->h.raw;
+		}
+
 		max_delay = IGMPV3_MRC(ih3->code)*(HZ/IGMP_TIMER_SCALE);
 		if (!max_delay)
 			max_delay = 1;	/* can't mod w/ 0 */
@@ -838,7 +850,7 @@
 int igmp_rcv(struct sk_buff *skb)
 {
 	/* This basically follows the spec line by line -- see RFC1112 */
-	struct igmphdr *ih = skb->h.igmph;
+	struct igmphdr *ih;
 	struct in_device *in_dev = in_dev_get(skb->dev);
 	int len = skb->len;
 
@@ -847,23 +859,17 @@
 		return 0;
 	}
 
-	if (skb_is_nonlinear(skb)) {
-		if (skb_linearize(skb, GFP_ATOMIC) != 0) {
-			kfree_skb(skb);
-			return -ENOMEM;
-		}
-		ih = skb->h.igmph;
-	}
-
-	if (len < sizeof(struct igmphdr) || ip_compute_csum((void *)ih, len)) {
+	if (!pskb_may_pull(skb, sizeof(struct igmphdr)) || 
+	    (u16)csum_fold(skb_checksum(skb, 0, len, 0))) {
 		in_dev_put(in_dev);
 		kfree_skb(skb);
 		return 0;
 	}
 
+	ih = skb->h.igmph;
 	switch (ih->type) {
 	case IGMP_HOST_MEMBERSHIP_QUERY:
-		igmp_heard_query(in_dev, ih, len);
+		igmp_heard_query(in_dev, skb, len);
 		break;
 	case IGMP_HOST_MEMBERSHIP_REPORT:
 	case IGMPV2_HOST_MEMBERSHIP_REPORT:
diff -urN linux-2.5.73-bk4/net/ipv4/ipmr.c linux-2.5.73-bk5/net/ipv4/ipmr.c
--- linux-2.5.73-bk4/net/ipv4/ipmr.c	2003-06-22 11:32:45.000000000 -0700
+++ linux-2.5.73-bk5/net/ipv4/ipmr.c	2003-06-27 04:49:36.000000000 -0700
@@ -83,13 +83,13 @@
 
 #define VIF_EXISTS(idx) (vif_table[idx].dev != NULL)
 
-int mroute_do_assert;					/* Set in PIM assert	*/
-int mroute_do_pim;
+static int mroute_do_assert;				/* Set in PIM assert	*/
+static int mroute_do_pim;
 
 static struct mfc_cache *mfc_cache_array[MFC_LINES];	/* Forwarding cache	*/
 
 static struct mfc_cache *mfc_unres_queue;		/* Queue of unresolved entries */
-atomic_t cache_resolve_queue_len;			/* Size of unresolved	*/
+static atomic_t cache_resolve_queue_len;		/* Size of unresolved	*/
 
 /* Special spinlock for queue of unresolved entries */
 static spinlock_t mfc_unres_lock = SPIN_LOCK_UNLOCKED;
@@ -102,7 +102,7 @@
    In this case data path is free of exclusive locks at all.
  */
 
-kmem_cache_t *mrt_cachep;
+static kmem_cache_t *mrt_cachep;
 
 static int ip_mr_forward(struct sk_buff *skb, struct mfc_cache *cache, int local);
 static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert);
@@ -158,6 +158,10 @@
 	return dev;
 
 failure:
+	/* allow the register to be completed before unregistering. */
+	rtnl_unlock();
+	rtnl_lock();
+
 	unregister_netdevice(dev);
 	return NULL;
 }
@@ -182,35 +186,23 @@
 	return (struct net_device_stats*)dev->priv;
 }
 
-static void vif_dev_destructor(struct net_device *dev)
-{
-	kfree(dev);
-}
-
-static
-struct net_device *ipmr_reg_vif(struct vifctl *v)
+static void reg_vif_setup(struct net_device *dev)
 {
-	struct net_device  *dev;
-	struct in_device *in_dev;
-	int size;
-
-	size = sizeof(*dev) + sizeof(struct net_device_stats);
-	dev = kmalloc(size, GFP_KERNEL);
-	if (!dev)
-		return NULL;
-
-	memset(dev, 0, size);
-
-	dev->priv = dev + 1;
-
-	strcpy(dev->name, "pimreg");
-
 	dev->type		= ARPHRD_PIMREG;
 	dev->mtu		= 1500 - sizeof(struct iphdr) - 8;
 	dev->flags		= IFF_NOARP;
 	dev->hard_start_xmit	= reg_vif_xmit;
 	dev->get_stats		= reg_vif_get_stats;
-	dev->destructor		= vif_dev_destructor;
+	dev->destructor		= (void (*)(struct net_device *)) kfree;
+}
+
+static struct net_device *ipmr_reg_vif(void)
+{
+	struct net_device *dev;
+	struct in_device *in_dev;
+
+	dev = alloc_netdev(sizeof(struct net_device_stats), "pimreg",
+			   reg_vif_setup);
 
 	if (register_netdevice(dev)) {
 		kfree(dev);
@@ -229,6 +221,10 @@
 	return dev;
 
 failure:
+	/* allow the register to be completed before unregistering. */
+	rtnl_unlock();
+	rtnl_lock();
+
 	unregister_netdevice(dev);
 	return NULL;
 }
@@ -316,7 +312,7 @@
 
 /* Single timer process for all the unresolved queue. */
 
-void ipmr_expire_process(unsigned long dummy)
+static void ipmr_expire_process(unsigned long dummy)
 {
 	unsigned long now;
 	unsigned long expires;
@@ -335,9 +331,8 @@
 	cp = &mfc_unres_queue;
 
 	while ((c=*cp) != NULL) {
-		long interval = c->mfc_un.unres.expires - now;
-
-		if (interval > 0) {
+		if (time_after(c->mfc_un.unres.expires, now)) {
+			unsigned long interval = c->mfc_un.unres.expires - now;
 			if (interval < expires)
 				expires = interval;
 			cp = &c->next;
@@ -397,7 +392,7 @@
 		 */
 		if (reg_vif_num >= 0)
 			return -EADDRINUSE;
-		dev = ipmr_reg_vif(vifc);
+		dev = ipmr_reg_vif();
 		if (!dev)
 			return -ENOBUFS;
 		break;
@@ -683,7 +678,7 @@
  *	MFC cache manipulation by user space mroute daemon
  */
 
-int ipmr_mfc_delete(struct mfcctl *mfc)
+static int ipmr_mfc_delete(struct mfcctl *mfc)
 {
 	int line;
 	struct mfc_cache *c, **cp;
@@ -704,7 +699,7 @@
 	return -ENOENT;
 }
 
-int ipmr_mfc_add(struct mfcctl *mfc, int mrtsock)
+static int ipmr_mfc_add(struct mfcctl *mfc, int mrtsock)
 {
 	int line;
 	struct mfc_cache *uc, *c, **cp;
@@ -1078,9 +1073,7 @@
 
 
 static struct notifier_block ip_mr_notifier={
-	ipmr_device_event,
-	NULL,
-	0
+	.notifier_call = ipmr_device_event,
 };
 
 /*
@@ -1234,7 +1227,7 @@
 		ipmr_forward_finish);
 }
 
-int ipmr_find_vif(struct net_device *dev)
+static int ipmr_find_vif(struct net_device *dev)
 {
 	int ct;
 	for (ct=maxvif-1; ct>=0; ct--) {
@@ -1246,7 +1239,7 @@
 
 /* "local" means that we should preserve one skb (for local delivery) */
 
-int ip_mr_forward(struct sk_buff *skb, struct mfc_cache *cache, int local)
+static int ip_mr_forward(struct sk_buff *skb, struct mfc_cache *cache, int local)
 {
 	int psend = -1;
 	int vif, ct;
@@ -1286,7 +1279,8 @@
 		       large chunk of pimd to kernel. Ough... --ANK
 		     */
 		    (mroute_do_pim || cache->mfc_un.res.ttls[true_vifi] < 255) &&
-		    jiffies - cache->mfc_un.res.last_assert > MFC_ASSERT_THRESH) {
+		    time_after(jiffies, 
+			       cache->mfc_un.res.last_assert + MFC_ASSERT_THRESH)) {
 			cache->mfc_un.res.last_assert = jiffies;
 			ipmr_cache_report(skb, true_vifi, IGMPMSG_WRONGVIF);
 		}
@@ -1406,24 +1400,19 @@
 
 int pim_rcv_v1(struct sk_buff * skb)
 {
-	struct igmphdr *pim = (struct igmphdr*)skb->h.raw;
+	struct igmphdr *pim;
 	struct iphdr   *encap;
 	struct net_device  *reg_dev = NULL;
 
-	if (skb_is_nonlinear(skb)) {
-		if (skb_linearize(skb, GFP_ATOMIC) != 0) {
-			kfree_skb(skb);
-			return -ENOMEM;
-		}
-		pim = (struct igmphdr*)skb->h.raw;
-	}
+	if (!pskb_may_pull(skb, sizeof(*pim) + sizeof(*encap))) 
+		goto drop;
+
+	pim = (struct igmphdr*)skb->h.raw;
 
         if (!mroute_do_pim ||
 	    skb->len < sizeof(*pim) + sizeof(*encap) ||
-	    pim->group != PIM_V1_VERSION || pim->code != PIM_V1_REGISTER) {
-		kfree_skb(skb);
-                return -EINVAL;
-        }
+	    pim->group != PIM_V1_VERSION || pim->code != PIM_V1_REGISTER) 
+		goto drop;
 
 	encap = (struct iphdr*)(skb->h.raw + sizeof(struct igmphdr));
 	/*
@@ -1433,11 +1422,9 @@
 	   c. packet is not truncated
 	 */
 	if (!MULTICAST(encap->daddr) ||
-	    ntohs(encap->tot_len) == 0 ||
-	    ntohs(encap->tot_len) + sizeof(*pim) > skb->len) {
-		kfree_skb(skb);
-		return -EINVAL;
-	}
+	    encap->tot_len == 0 ||
+	    ntohs(encap->tot_len) + sizeof(*pim) > skb->len) 
+		goto drop;
 
 	read_lock(&mrt_lock);
 	if (reg_vif_num >= 0)
@@ -1446,10 +1433,8 @@
 		dev_hold(reg_dev);
 	read_unlock(&mrt_lock);
 
-	if (reg_dev == NULL) {
-		kfree_skb(skb);
-		return -EINVAL;
-	}
+	if (reg_dev == NULL) 
+		goto drop;
 
 	skb->mac.raw = skb->nh.raw;
 	skb_pull(skb, (u8*)encap - skb->data);
@@ -1470,41 +1455,35 @@
 	netif_rx(skb);
 	dev_put(reg_dev);
 	return 0;
+ drop:
+	kfree_skb(skb);
+	return 0;
 }
 #endif
 
 #ifdef CONFIG_IP_PIMSM_V2
-int pim_rcv(struct sk_buff * skb)
+static int pim_rcv(struct sk_buff * skb)
 {
-	struct pimreghdr *pim = (struct pimreghdr*)skb->h.raw;
+	struct pimreghdr *pim;
 	struct iphdr   *encap;
 	struct net_device  *reg_dev = NULL;
 
-	if (skb_is_nonlinear(skb)) {
-		if (skb_linearize(skb, GFP_ATOMIC) != 0) {
-			kfree_skb(skb);
-			return -ENOMEM;
-		}
-		pim = (struct pimreghdr*)skb->h.raw;
-	}
+	if (!pskb_may_pull(skb, sizeof(*pim) + sizeof(*encap))) 
+		goto drop;
 
-        if (skb->len < sizeof(*pim) + sizeof(*encap) ||
-	    pim->type != ((PIM_VERSION<<4)|(PIM_REGISTER)) ||
+	pim = (struct pimreghdr*)skb->h.raw;
+        if (pim->type != ((PIM_VERSION<<4)|(PIM_REGISTER)) ||
 	    (pim->flags&PIM_NULL_REGISTER) ||
-	    (ip_compute_csum((void *)pim, sizeof(*pim)) != 0 &&
-	     ip_compute_csum((void *)pim, skb->len))) {
-		kfree_skb(skb);
-                return -EINVAL;
-        }
+	    (ip_compute_csum((void *)pim, sizeof(*pim)) != 0 && 
+	     (u16)csum_fold(skb_checksum(skb, 0, skb->len, 0)))) 
+		goto drop;
 
 	/* check if the inner packet is destined to mcast group */
 	encap = (struct iphdr*)(skb->h.raw + sizeof(struct pimreghdr));
 	if (!MULTICAST(encap->daddr) ||
-	    ntohs(encap->tot_len) == 0 ||
-	    ntohs(encap->tot_len) + sizeof(*pim) > skb->len) {
-		kfree_skb(skb);
-		return -EINVAL;
-	}
+	    encap->tot_len == 0 ||
+	    ntohs(encap->tot_len) + sizeof(*pim) > skb->len) 
+		goto drop;
 
 	read_lock(&mrt_lock);
 	if (reg_vif_num >= 0)
@@ -1513,10 +1492,8 @@
 		dev_hold(reg_dev);
 	read_unlock(&mrt_lock);
 
-	if (reg_dev == NULL) {
-		kfree_skb(skb);
-		return -EINVAL;
-	}
+	if (reg_dev == NULL) 
+		goto drop;
 
 	skb->mac.raw = skb->nh.raw;
 	skb_pull(skb, (u8*)encap - skb->data);
@@ -1537,6 +1514,9 @@
 	netif_rx(skb);
 	dev_put(reg_dev);
 	return 0;
+ drop:
+	kfree_skb(skb);
+	return 0;
 }
 #endif
 
diff -urN linux-2.5.73-bk4/net/ipv4/netfilter/Kconfig linux-2.5.73-bk5/net/ipv4/netfilter/Kconfig
--- linux-2.5.73-bk4/net/ipv4/netfilter/Kconfig	2003-06-27 04:49:30.000000000 -0700
+++ linux-2.5.73-bk5/net/ipv4/netfilter/Kconfig	2003-06-27 04:49:36.000000000 -0700
@@ -553,6 +553,13 @@
 	tristate "ARP packet filtering"
 	depends on IP_NF_ARPTABLES
 
+config IP_NF_ARP_MANGLE
+	tristate "ARP payload mangling"
+	depends on IP_NF_ARPTABLES
+	help
+	  Allows altering the ARP packet payload: source and destination
+	  hardware and network addresses.
+
 # Backwards compatibility modules: only if you don't build in the others.
 config IP_NF_COMPAT_IPCHAINS
 	tristate "ipchains (2.2-style) support"
diff -urN linux-2.5.73-bk4/net/ipv4/netfilter/Makefile linux-2.5.73-bk5/net/ipv4/netfilter/Makefile
--- linux-2.5.73-bk4/net/ipv4/netfilter/Makefile	2003-06-27 04:49:30.000000000 -0700
+++ linux-2.5.73-bk5/net/ipv4/netfilter/Makefile	2003-06-27 04:49:36.000000000 -0700
@@ -82,6 +82,7 @@
 
 # generic ARP tables
 obj-$(CONFIG_IP_NF_ARPTABLES) += arp_tables.o
+obj-$(CONFIG_IP_NF_ARP_MANGLE) += arpt_mangle.o
 
 # just filtering instance of ARP tables for now
 obj-$(CONFIG_IP_NF_ARPFILTER) += arptable_filter.o
diff -urN linux-2.5.73-bk4/net/ipv4/netfilter/arp_tables.c linux-2.5.73-bk5/net/ipv4/netfilter/arp_tables.c
--- linux-2.5.73-bk4/net/ipv4/netfilter/arp_tables.c	2003-06-22 11:33:07.000000000 -0700
+++ linux-2.5.73-bk5/net/ipv4/netfilter/arp_tables.c	2003-06-27 04:49:36.000000000 -0700
@@ -136,6 +136,7 @@
 		dprintf("ARP hardware address length mismatch.\n");
 		dprintf("ar_hln: %02x info->arhln: %02x info->arhln_mask: %02x\n",
 			arphdr->ar_hln, arpinfo->arhln, arpinfo->arhln_mask);
+		return 0;
 	}
 
 	src_devaddr = arpptr;
diff -urN linux-2.5.73-bk4/net/ipv4/netfilter/arpt_mangle.c linux-2.5.73-bk5/net/ipv4/netfilter/arpt_mangle.c
--- linux-2.5.73-bk4/net/ipv4/netfilter/arpt_mangle.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.73-bk5/net/ipv4/netfilter/arpt_mangle.c	2003-06-27 04:49:36.000000000 -0700
@@ -0,0 +1,101 @@
+/* module that allows mangling of the arp payload */
+#include <linux/module.h>
+#include <linux/netfilter_arp/arpt_mangle.h>
+#include <net/sock.h>
+
+static unsigned int
+target(struct sk_buff **pskb, unsigned int hooknum, const struct net_device *in,
+   const struct net_device *out, const void *targinfo, void *userinfo)
+{
+	const struct arpt_mangle *mangle = targinfo;
+	struct arphdr *arp;
+	unsigned char *arpptr;
+	int pln, hln;
+
+	if (skb_shared(*pskb) || skb_cloned(*pskb)) {
+		struct sk_buff *nskb;
+
+		nskb = skb_copy(*pskb, GFP_ATOMIC);
+		if (!nskb)
+			return NF_DROP;
+		if ((*pskb)->sk)
+			skb_set_owner_w(nskb, (*pskb)->sk);
+		kfree_skb(*pskb);
+		*pskb = nskb;
+	}
+
+	arp = (*pskb)->nh.arph;
+	arpptr = (*pskb)->nh.raw + sizeof(*arp);
+	pln = arp->ar_pln;
+	hln = arp->ar_hln;
+	/* We assume that pln and hln were checked in the match */
+	if (mangle->flags & ARPT_MANGLE_SDEV) {
+		if (ARPT_DEV_ADDR_LEN_MAX < hln ||
+		   (arpptr + hln > (**pskb).tail))
+			return NF_DROP;
+		memcpy(arpptr, mangle->src_devaddr, hln);
+	}
+	arpptr += hln;
+	if (mangle->flags & ARPT_MANGLE_SIP) {
+		if (ARPT_MANGLE_ADDR_LEN_MAX < pln ||
+		   (arpptr + pln > (**pskb).tail))
+			return NF_DROP;
+		memcpy(arpptr, &mangle->u_s.src_ip, pln);
+	}
+	arpptr += pln;
+	if (mangle->flags & ARPT_MANGLE_TDEV) {
+		if (ARPT_DEV_ADDR_LEN_MAX < hln ||
+		   (arpptr + hln > (**pskb).tail))
+			return NF_DROP;
+		memcpy(arpptr, mangle->tgt_devaddr, hln);
+	}
+	arpptr += hln;
+	if (mangle->flags & ARPT_MANGLE_TIP) {
+		if (ARPT_MANGLE_ADDR_LEN_MAX < pln ||
+		   (arpptr + pln > (**pskb).tail))
+			return NF_DROP;
+		memcpy(arpptr, &mangle->u_t.tgt_ip, pln);
+	}
+	return mangle->target;
+}
+
+static int
+checkentry(const char *tablename, const struct arpt_entry *e, void *targinfo,
+   unsigned int targinfosize, unsigned int hook_mask)
+{
+	const struct arpt_mangle *mangle = targinfo;
+
+	if (mangle->flags & ~ARPT_MANGLE_MASK ||
+	    !(mangle->flags & ARPT_MANGLE_MASK))
+		return 0;
+
+	if (mangle->target != NF_DROP && mangle->target != NF_ACCEPT &&
+	   mangle->target != ARPT_CONTINUE)
+		return 0;
+	return 1;
+}
+
+static struct arpt_target arpt_mangle_reg
+= {
+        .name		= "mangle",
+        .target		= target,
+        .checkentry	= checkentry,
+        .me		= THIS_MODULE,
+};
+
+static int __init init(void)
+{
+	if (arpt_register_target(&arpt_mangle_reg))
+		return -EINVAL;
+
+	return 0;
+}
+
+static void __exit fini(void)
+{
+	arpt_unregister_target(&arpt_mangle_reg);
+}
+
+module_init(init);
+module_exit(fini);
+MODULE_LICENSE("GPL");
diff -urN linux-2.5.73-bk4/net/ipv4/netfilter/ipt_recent.c linux-2.5.73-bk5/net/ipv4/netfilter/ipt_recent.c
--- linux-2.5.73-bk4/net/ipv4/netfilter/ipt_recent.c	2003-06-27 04:49:30.000000000 -0700
+++ linux-2.5.73-bk5/net/ipv4/netfilter/ipt_recent.c	2003-06-27 04:49:36.000000000 -0700
@@ -300,9 +300,15 @@
 	info->name[IPT_RECENT_NAME_LEN-1] = '\0';
 
 	skb = kmalloc(sizeof(struct sk_buff),GFP_KERNEL);
-	if(!skb) { return -ENOMEM; }
+	if (!skb) {
+		used = -ENOMEM;
+		goto out_free_info;
+	}
 	skb->nh.iph = kmalloc(sizeof(struct iphdr),GFP_KERNEL);
-	if(!skb->nh.iph) { return -ENOMEM; }
+	if (!skb->nh.iph) {
+		used = -ENOMEM;
+		goto out_free_skb;
+	}
 
 	skb->nh.iph->saddr = addr;
 	skb->nh.iph->daddr = 0;
@@ -311,7 +317,9 @@
 	match(skb,NULL,NULL,info,0,NULL);
 
 	kfree(skb->nh.iph);
+out_free_skb:
 	kfree(skb);
+out_free_info:
 	kfree(info);
 
 #ifdef DEBUG
diff -urN linux-2.5.73-bk4/net/ipv6/ndisc.c linux-2.5.73-bk5/net/ipv6/ndisc.c
--- linux-2.5.73-bk4/net/ipv6/ndisc.c	2003-06-22 11:32:56.000000000 -0700
+++ linux-2.5.73-bk5/net/ipv6/ndisc.c	2003-06-27 04:49:37.000000000 -0700
@@ -423,7 +423,7 @@
 		   struct in6_addr *daddr, struct in6_addr *solicited_addr,
 	 	   int router, int solicited, int override, int inc_opt) 
 {
-	static struct in6_addr tmpaddr;
+	struct in6_addr tmpaddr;
 	struct inet6_ifaddr *ifp;
 	struct inet6_dev *idev;
 	struct flowi fl;
@@ -713,6 +713,7 @@
 	struct net_device *dev = skb->dev;
 	struct inet6_ifaddr *ifp;
 	struct neighbour *neigh;
+	int addr_type = ipv6_addr_type(saddr);
 
 	if (ipv6_addr_type(&msg->target)&IPV6_ADDR_MULTICAST) {
 		if (net_ratelimit())
@@ -720,6 +721,20 @@
 		return;
 	}
 
+	/*
+	 * RFC2461 7.1.1:
+	 * DAD has to be destined for solicited node multicast address.
+	 */
+	if (addr_type == IPV6_ADDR_ANY &&
+	    !(daddr->s6_addr32[0] == htonl(0xff020000) &&
+	      daddr->s6_addr32[1] == htonl(0x00000000) &&
+	      daddr->s6_addr32[2] == htonl(0x00000001) &&
+	      daddr->s6_addr [12] == 0xff )) {
+		if (net_ratelimit())
+			printk(KERN_DEBUG "ICMP6 NS: bad DAD packet (wrong destination)\n");
+		return;
+	}
+
 	if (!ndisc_parse_options(msg->opt, ndoptlen, &ndopts)) {
 		if (net_ratelimit())
 			printk(KERN_WARNING "ICMP NS: invalid ND option, ignored.\n");
@@ -734,23 +749,20 @@
 				printk(KERN_WARNING "ICMP NS: bad lladdr length.\n");
 			return;
 		}
-	}
 
-	/* XXX: RFC2461 7.1.1:
-	 * 	If the IP source address is the unspecified address, there
-	 *	MUST NOT be source link-layer address option in the message.
-	 *
-	 *	NOTE! Linux kernel < 2.4.4 broke this rule.
-	 */
-		 	
-	/* XXX: RFC2461 7.1.1:
-	 *	If the IP source address is the unspecified address, the IP
-      	 *	destination address MUST be a solicited-node multicast address.
-	 */
+		/* XXX: RFC2461 7.1.1:
+	 	 *	If the IP source address is the unspecified address, 
+		 *	there MUST NOT be source link-layer address option 
+		 *	in the message.
+		 */
+		if (addr_type == IPV6_ADDR_ANY) {
+			if (net_ratelimit())
+				printk(KERN_WARNING "ICMP6 NS: bad DAD packet (link-layer address option)\n");
+			return;
+		}
+	}
 
 	if ((ifp = ipv6_get_ifaddr(&msg->target, dev)) != NULL) {
-		int addr_type = ipv6_addr_type(saddr);
-
 		if (ifp->flags & IFA_F_TENTATIVE) {
 			/* Address is tentative. If the source
 			   is unspecified address, it is someone
@@ -816,7 +828,6 @@
 		in6_ifa_put(ifp);
 	} else if (ipv6_chk_acast_addr(dev, &msg->target)) {
 		struct inet6_dev *idev = in6_dev_get(dev);
-		int addr_type = ipv6_addr_type(saddr);
 	
 		/* anycast */
 	
