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

diff -urN linux-2.4.23-pre7/CREDITS linux-2.4.23-pre8/CREDITS
--- linux-2.4.23-pre7/CREDITS	2003-10-23 03:33:13.000000000 -0700
+++ linux-2.4.23-pre8/CREDITS	2003-10-23 03:33:16.000000000 -0700
@@ -2975,7 +2975,6 @@
 S: USA
 
 N: Marcelo W. Tosatti
-E: marcelo@parcelfarce.linux.theplanet.co.uk
 E: marcelo.tosatti@cyclades.com
 D: Miscellaneous kernel hacker (mostly VM/MM work)
 D: 2.4 maintainer
diff -urN linux-2.4.23-pre7/Documentation/Configure.help linux-2.4.23-pre8/Documentation/Configure.help
--- linux-2.4.23-pre7/Documentation/Configure.help	2003-10-23 03:33:13.000000000 -0700
+++ linux-2.4.23-pre8/Documentation/Configure.help	2003-10-23 03:33:16.000000000 -0700
@@ -8395,7 +8395,7 @@
   If you want to compile the driver as a module ( = code which can be
   inserted in and removed from the running kernel whenever you want),
   say M here and read <file:Documentation/modules.txt>.  The module
-  will be called sym53c8xx.o.
+  will be called sym53c8xx_2.o.
 
 PCI DMA addressing mode
 CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
@@ -19587,30 +19587,8 @@
   The ACPI Sourceforge project may also be of interest:
   <http://sf.net/projects/acpi/>
 
-ACPI Processor Enumeration for HT
-CONFIG_ACPI_HT_ONLY
-  ACPI enumerates both logical (a.k.a. Hyper-Threaded -- HT)
-  and physical processors.  It is designed to obsolete several older
-  specifications, including the MultiProcessor Specification (MPS),
-  which supported only physical processors.
-
-  CONFIG_ACPI_HT_ONLY includes just the minimal ACPI boot-time code
-  necessary to enumerate logical processors and enable HT.
-
-  CONFIG_ACPI includes this code, plus IO APIC enumeration,
-  and the hooks to run the ACPI AML interpreter for run-time events.
-
-  When CONFIG_ACPI is selected, the command-line option "acpi=ht"
-  is available to run just the ACPI boot-time code -- just as if
-  only CONFIG_ACPI_HT_ONLY were selected.
-
   Note that "acpi=off" can be used to disable all ACPI code in the kernel.
 
-Enable ACPI 2.0 with errata 1.3
-CONFIG_ACPI20
-  Enable support for the 2.0 version of the ACPI interpreter.  See the
-  help for ACPI for caveats and discussion.
-
 ACPI kernel configuration manager
 CONFIG_ACPI_KERNEL_CONFIG
   If you say `Y' here, Linux's ACPI support will use the
@@ -19630,23 +19608,6 @@
   particular, many Toshiba laptops require this for correct operation
   of the AC module.
 
-ACPI Bus Manager
-CONFIG_ACPI_BUSMGR
-  The ACPI Bus Manager enumerates devices in the ACPI namespace, and
-  handles PnP messages.  All ACPI devices use its services, so using
-  them requires saying Y here.
-
-ACPI System Driver
-CONFIG_ACPI_SYS
-  This driver will enable your system to shut down using ACPI, and
-  dump your ACPI DSDT table using /proc/acpi/dsdt.
-
-ACPI Processor Driver
-CONFIG_ACPI_CPU
-  This driver installs ACPI as the idle handler for Linux, and uses
-  ACPI C2 and C3 processor states to save power, on systems that
-  support it.
-
 ACPI Button
 CONFIG_ACPI_BUTTON
   This driver registers for events based on buttons, such as the
@@ -19681,11 +19642,6 @@
   the battery and thermal drivers.  If you are compiling for a laptop,
   say Y.
 
-ACPI Control Method Battery
-CONFIG_ACPI_CMBATT
-  This driver adds support for battery information through
-  /proc/acpi/battery. If you have a laptop with a battery, say Y.
-
 ACPI Thermal
 CONFIG_ACPI_THERMAL
   This driver handles overheating conditions on laptops. It is HIGHLY
diff -urN linux-2.4.23-pre7/Makefile linux-2.4.23-pre8/Makefile
--- linux-2.4.23-pre7/Makefile	2003-10-23 03:33:13.000000000 -0700
+++ linux-2.4.23-pre8/Makefile	2003-10-23 03:33:17.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 23
-EXTRAVERSION = -pre7
+EXTRAVERSION = -pre8
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
@@ -28,7 +28,7 @@
 AS		= $(CROSS_COMPILE)as
 LD		= $(CROSS_COMPILE)ld
 CC		= $(CROSS_COMPILE)gcc
-CPP		= $(CC) -E
+PP		= $(CC) -E
 AR		= $(CROSS_COMPILE)ar
 NM		= $(CROSS_COMPILE)nm
 STRIP		= $(CROSS_COMPILE)strip
diff -urN linux-2.4.23-pre7/arch/alpha/kernel/irq.c linux-2.4.23-pre8/arch/alpha/kernel/irq.c
--- linux-2.4.23-pre7/arch/alpha/kernel/irq.c	2003-06-13 07:51:29.000000000 -0700
+++ linux-2.4.23-pre8/arch/alpha/kernel/irq.c	2003-10-23 03:33:17.000000000 -0700
@@ -214,7 +214,7 @@
 
 	if (!shared) {
 		desc->depth = 0;
-		desc->status &= ~IRQ_DISABLED;
+		desc->status &= ~(IRQ_DISABLED | IRQ_INPROGRESS);
 		desc->handler->startup(irq);
 	}
 	spin_unlock_irqrestore(&desc->lock,flags);
diff -urN linux-2.4.23-pre7/arch/i386/kernel/acpi.c linux-2.4.23-pre8/arch/i386/kernel/acpi.c
--- linux-2.4.23-pre7/arch/i386/kernel/acpi.c	2003-10-23 03:33:13.000000000 -0700
+++ linux-2.4.23-pre8/arch/i386/kernel/acpi.c	2003-10-23 03:33:17.000000000 -0700
@@ -470,6 +470,34 @@
 
 #endif /*CONFIG_ACPI_BOOT*/
 
+#ifdef	CONFIG_ACPI_BUS
+/*
+ * Set specified PIC IRQ to level triggered mode.
+ *
+ * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
+ * for the 8259 PIC.  bit[n] = 1 means irq[n] is Level, otherwise Edge.
+ * ECLR1 is IRQ's 0-7 (IRQ 0, 1, 2 must be 0)
+ * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
+ *
+ * As the BIOS should have done this for us,
+ * print a warning if the IRQ wasn't already set to level.
+ */
+
+void acpi_pic_set_level_irq(unsigned int irq)
+{
+	unsigned char mask = 1 << (irq & 7);
+	unsigned int port = 0x4d0 + (irq >> 3);
+	unsigned char val = inb(port);
+
+	if (!(val & mask)) {
+		printk(KERN_WARNING PREFIX "IRQ %d was Edge Triggered, "
+			"setting to Level Triggerd\n", irq);
+		outb(val | mask, port);
+	}
+}
+#endif /* CONFIG_ACPI_BUS */
+
+
 
 /* --------------------------------------------------------------------------
                               Low-Level Sleep Support
diff -urN linux-2.4.23-pre7/arch/i386/kernel/apic.c linux-2.4.23-pre8/arch/i386/kernel/apic.c
--- linux-2.4.23-pre7/arch/i386/kernel/apic.c	2003-10-23 03:33:13.000000000 -0700
+++ linux-2.4.23-pre8/arch/i386/kernel/apic.c	2003-10-23 03:33:17.000000000 -0700
@@ -502,10 +502,18 @@
 
 	__save_flags(flags);
 	__cli();
+
+	/*
+	 * Make sure the APICBASE points to the right address
+	 *
+	 * FIXME! This will be wrong if we ever support suspend on
+	 * SMP! We'll need to do this as part of the CPU restore!
+	 */
 	rdmsr(MSR_IA32_APICBASE, l, h);
 	l &= ~MSR_IA32_APICBASE_BASE;
-	l |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE;
+	l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr;
 	wrmsr(MSR_IA32_APICBASE, l, h);
+
 	apic_write(APIC_LVTERR, ERROR_APIC_VECTOR | APIC_LVT_MASKED);
 	apic_write(APIC_ID, apic_pm_state.apic_id);
 	apic_write(APIC_DFR, apic_pm_state.apic_dfr);
@@ -674,6 +682,12 @@
 	}
 	set_bit(X86_FEATURE_APIC, &boot_cpu_data.x86_capability);
 	mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
+
+	/* The BIOS may have set up the APIC at some other address */
+	rdmsr(MSR_IA32_APICBASE, l, h);
+	if (l & MSR_IA32_APICBASE_ENABLE)
+		mp_lapic_addr = l & MSR_IA32_APICBASE_BASE;
+
 	if (nmi_watchdog != NMI_NONE)
 		nmi_watchdog = NMI_LOCAL_APIC;
 
diff -urN linux-2.4.23-pre7/arch/i386/kernel/dmi_scan.c linux-2.4.23-pre8/arch/i386/kernel/dmi_scan.c
--- linux-2.4.23-pre7/arch/i386/kernel/dmi_scan.c	2003-10-23 03:33:13.000000000 -0700
+++ linux-2.4.23-pre8/arch/i386/kernel/dmi_scan.c	2003-10-23 03:33:17.000000000 -0700
@@ -481,7 +481,7 @@
 
 
 #ifdef	CONFIG_ACPI_BOOT
-extern int acpi_disabled, use_acpi_pci, acpi_force, acpi_ht;
+extern int acpi_disabled, acpi_force, acpi_ht;
 
 static __init __attribute__((unused)) int acpi_disable(struct dmi_blacklist *d) 
 { 
@@ -511,14 +511,18 @@
 	}
 	return 0;
 } 
+#endif	/* CONFIG_ACPI_BOOT */
 
+#ifdef	CONFIG_ACPI_PCI
 static __init int disable_acpi_pci(struct dmi_blacklist *d) 
 { 
-	printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n", d->ident); 	
-	use_acpi_pci = 0; 
+	extern __init void pci_disable_acpi(void) ;
+
+	printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n", d->ident);
+	pci_disable_acpi();
 	return 0;
 } 
-#endif
+#endif	/* CONFIG_ACPI_PCI */
 
 /*
  *	Process the DMI blacklists
@@ -920,6 +924,8 @@
 			MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"),
 			NO_MATCH, NO_MATCH }},
 
+#endif	/* CONFIG_ACPI_BOOT */
+#ifdef	CONFIG_ACPI_PCI
 	/*
 	 *	Boxes that need ACPI PCI IRQ routing disabled
 	 */
@@ -930,7 +936,7 @@
 			/* newer BIOS, Revision 1011, does work */
 			MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"),
 			NO_MATCH }},
-#endif	// CONFIG_ACPI_BOOT
+#endif	/* CONFIG_ACPI_PCI */
 
 	{ NULL, }
 };
diff -urN linux-2.4.23-pre7/arch/i386/kernel/irq.c linux-2.4.23-pre8/arch/i386/kernel/irq.c
--- linux-2.4.23-pre7/arch/i386/kernel/irq.c	2003-10-23 03:33:13.000000000 -0700
+++ linux-2.4.23-pre8/arch/i386/kernel/irq.c	2003-10-23 03:33:17.000000000 -0700
@@ -1036,7 +1036,7 @@
 
 	if (!shared) {
 		desc->depth = 0;
-		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING);
+		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);
 		desc->handler->startup(irq);
 	}
 	spin_unlock_irqrestore(&desc->lock,flags);
diff -urN linux-2.4.23-pre7/arch/i386/kernel/pci-pc.c linux-2.4.23-pre8/arch/i386/kernel/pci-pc.c
--- linux-2.4.23-pre7/arch/i386/kernel/pci-pc.c	2003-10-23 03:33:13.000000000 -0700
+++ linux-2.4.23-pre8/arch/i386/kernel/pci-pc.c	2003-10-23 03:33:17.000000000 -0700
@@ -1415,7 +1415,13 @@
 	return;
 }
 
-int use_acpi_pci __initdata = 1;
+static int use_acpi_pci __initdata = 1;
+
+__init void pci_disable_acpi(void)
+{
+	use_acpi_pci = 0;
+	return;
+}
 
 void __init pcibios_init(void)
 {
@@ -1505,7 +1511,7 @@
 		pcibios_last_bus = simple_strtol(str+8, NULL, 0);
 		return NULL;
 	} else if (!strncmp(str, "noacpi", 6)) {
-		use_acpi_pci = 0;
+		pci_disable_acpi();
 		return NULL;
 	}
 	return str;
diff -urN linux-2.4.23-pre7/arch/mips/kernel/irq.c linux-2.4.23-pre8/arch/mips/kernel/irq.c
--- linux-2.4.23-pre7/arch/mips/kernel/irq.c	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.23-pre8/arch/mips/kernel/irq.c	2003-10-23 03:33:17.000000000 -0700
@@ -870,7 +870,7 @@
 
 	if (!shared) {
 		desc->depth = 0;
-		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING);
+		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);
 		desc->handler->startup(irq);
 	}
 	spin_unlock_irqrestore(&desc->lock,flags);
diff -urN linux-2.4.23-pre7/arch/mips64/kernel/irq.c linux-2.4.23-pre8/arch/mips64/kernel/irq.c
--- linux-2.4.23-pre7/arch/mips64/kernel/irq.c	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.23-pre8/arch/mips64/kernel/irq.c	2003-10-23 03:33:17.000000000 -0700
@@ -870,7 +870,7 @@
 
 	if (!shared) {
 		desc->depth = 0;
-		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING);
+		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);
 		desc->handler->startup(irq);
 	}
 	spin_unlock_irqrestore(&desc->lock,flags);
diff -urN linux-2.4.23-pre7/arch/sh/kernel/irq_intc2.c linux-2.4.23-pre8/arch/sh/kernel/irq_intc2.c
--- linux-2.4.23-pre7/arch/sh/kernel/irq_intc2.c	2003-06-13 07:51:32.000000000 -0700
+++ linux-2.4.23-pre8/arch/sh/kernel/irq_intc2.c	2003-10-23 03:33:17.000000000 -0700
@@ -12,6 +12,8 @@
  * Hitachi 7751 and the STM ST40 STB1.
  */
 
+#include <linux/config.h>
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/irq.h>
@@ -22,8 +24,11 @@
 
 
 struct intc2_data {
-	unsigned int addr;	/* Address of Interrupt Priority Register */
-	int mask; /*Mask to apply */
+	unsigned char msk_offset;
+	unsigned char msk_shift;
+#ifdef CONFIG_CPU_SUBTYPE_ST40
+	int (*clear_irq) (int);
+#endif
 };
 
 
@@ -56,33 +61,34 @@
 
 static void disable_intc2_irq(unsigned int irq)
 {
-	unsigned addr;
-	int offset=irq-INTC2_FIRST_IRQ;
-	unsigned val,flags;
+	int irq_offset = irq - INTC2_FIRST_IRQ;
+	int msk_shift, msk_offset;
 
 	// Sanity check
-	if(offset<0 || offset>=NR_INTC2_IRQS) return;
-
-	addr=intc2_data[offset].addr+INTC2_INTMSK_OFFSET;
+	if((irq_offset<0) || (irq_offset>=NR_INTC2_IRQS))
+		return;
 
-	save_and_cli(flags);
-	val=ctrl_inl(addr);
-	val|=intc2_data[offset].mask;
-	ctrl_outl(val,addr);
+	msk_shift = intc2_data[irq_offset].msk_shift;
+	msk_offset = intc2_data[irq_offset].msk_offset;
 
-	restore_flags(flags);
+	ctrl_outl(1<<msk_shift,
+		  INTC2_BASE+INTC2_INTMSK_OFFSET+msk_offset);
 }
 
 static void enable_intc2_irq(unsigned int irq)
 {
-	int offset=irq-INTC2_FIRST_IRQ;
+	int irq_offset = irq - INTC2_FIRST_IRQ;
+	int msk_shift, msk_offset;
 
-	// Sanity check
-	if(offset<0 || offset>=NR_INTC2_IRQS) return;
+	/* Sanity check */
+	if((irq_offset<0) || (irq_offset>=NR_INTC2_IRQS))
+		return;
 
-	ctrl_outl(intc2_data[offset].mask,
-		  intc2_data[offset].addr+INTC2_INTMSKCLR_OFFSET);
+	msk_shift = intc2_data[irq_offset].msk_shift;
+	msk_offset = intc2_data[irq_offset].msk_offset;
 
+	ctrl_outl(1<<msk_shift,
+		  INTC2_BASE+INTC2_INTMSKCLR_OFFSET+msk_offset);
 }
 
 static void mask_and_ack_intc2(unsigned int irq)
@@ -94,28 +100,50 @@
 {
 	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
 		enable_intc2_irq(irq);
+
+#ifdef CONFIG_CPU_SUBTYPE_ST40
+	if (intc2_data[irq - INTC2_FIRST_IRQ].clear_irq)
+		intc2_data[irq - INTC2_FIRST_IRQ].clear_irq (irq);
+#endif
 }
 
-void make_intc2_irq(unsigned int irq, unsigned int addr, 
-		    unsigned int group,int pos, int priority)
+/*
+ * Setup an INTC2 style interrupt.
+ * NOTE: Unlike IPR interrupts, parameters are not shifted by this code,
+ * allowing the use of the numbers straight out of the datasheet.
+ * For example:
+ *    PIO1 which is INTPRI00[19,16] and INTMSK00[13]
+ * would be:               ^     ^             ^  ^
+ *                         |     |             |  |
+ *    make_intc2_irq(84,   0,   16,            0, 13);
+ */
+void make_intc2_irq(unsigned int irq,
+		    unsigned int ipr_offset, unsigned int ipr_shift,
+		    unsigned int msk_offset, unsigned int msk_shift,
+		    unsigned int priority)
 {
-	int offset=irq-INTC2_FIRST_IRQ;
-	unsigned flags,val;
+	int irq_offset = irq - INTC2_FIRST_IRQ;
+	unsigned int flags;
+	unsigned long ipr;
 
-	if(offset<0 || offset>=NR_INTC2_IRQS) {
+	if((irq_offset<0) || (irq_offset>=NR_INTC2_IRQS))
 		return;
-	}
+
 
 	disable_irq_nosync(irq);
-	/* Fill the data we need */
-	intc2_data[offset].addr=addr;
-	intc2_data[offset].mask=1<<pos;
-		
+
+	intc2_data[irq_offset].msk_offset = msk_offset;
+	intc2_data[irq_offset].msk_shift  = msk_shift;
+#ifdef CONFIG_CPU_SUBTYPE_ST40
+	intc2_data[irq_offset].clear_irq = NULL;
+#endif
+
 	/* Set the priority level */
 	save_and_cli(flags);
-	val=ctrl_inl(addr+INTC2_INTPRI_OFFSET);
-	val|=(priority)<< (group<<4);
-	ctrl_outl(val,addr+INTC2_INTPRI_OFFSET);
+	ipr=ctrl_inl(INTC2_BASE+INTC2_INTPRI_OFFSET+ipr_offset);
+	ipr&=~(0xf<<ipr_shift);
+	ipr|=(priority)<<ipr_shift;
+	ctrl_outl(ipr, INTC2_BASE+INTC2_INTPRI_OFFSET+ipr_offset);
 	restore_flags(flags);
 
 	irq_desc[irq].handler=&intc2_irq_type;
@@ -123,5 +151,70 @@
 	disable_intc2_irq(irq);
 }
 
+#ifdef CONFIG_CPU_SUBTYPE_ST40
 
+struct intc2_init {
+	unsigned short irq;
+	unsigned char ipr_offset, ipr_shift;
+	unsigned char msk_offset, msk_shift;
+};
+
+static struct intc2_init intc2_init_data[]  __initdata = {
+	{64,  0,  0, 0,  0},	/* PCI serr */
+	{65,  0,  4, 0,  1},	/* PCI err */
+	{66,  0,  4, 0,  2},	/* PCI ad */
+	{67,  0,  4, 0,  3},	/* PCI pwd down */
+	{72,  0,  8, 0,  5},	/* DMAC INT0 */
+	{73,  0,  8, 0,  6},	/* DMAC INT1 */
+	{74,  0,  8, 0,  7},	/* DMAC INT2 */
+	{75,  0,  8, 0,  8},	/* DMAC INT3 */
+	{76,  0,  8, 0,  9},	/* DMAC INT4 */
+	{78,  0,  8, 0, 11},	/* DMAC ERR */
+	{80,  0, 12, 0, 12},	/* PIO0 */
+	{84,  0, 16, 0, 13},	/* PIO1 */
+	{88,  0, 20, 0, 14},	/* PIO2 */
+	{112, 4,  0, 4,  0},	/* Mailbox */
+#ifdef CONFIG_CPU_SUBTYPE_ST40GX1
+	{116, 4,  4, 4,  4},	/* SSC0 */
+	{120, 4,  8, 4,  8},	/* IR Blaster */
+	{124, 4, 12, 4, 12},	/* USB host */
+	{128, 4, 16, 4, 16},	/* Video processor BLITTER */
+	{132, 4, 20, 4, 20},	/* UART0 */
+	{134, 4, 20, 4, 22},	/* UART2 */
+	{136, 4, 24, 4, 24},	/* IO_PIO0 */
+	{140, 4, 28, 4, 28},	/* EMPI */
+	{144, 8,  0, 8,  0},	/* MAFE */
+	{148, 8,  4, 8,  4},	/* PWM */
+	{152, 8,  8, 8,  8},	/* SSC1 */
+	{156, 8, 12, 8, 12},	/* IO_PIO1 */
+	{160, 8, 16, 8, 16},	/* USB target */
+	{164, 8, 20, 8, 20},	/* UART1 */
+	{168, 8, 24, 8, 24},	/* Teletext */
+	{172, 8, 28, 8, 28},	/* VideoSync VTG */
+	{173, 8, 28, 8, 29},	/* VideoSync DVP0 */
+	{174, 8, 28, 8, 30},	/* VideoSync DVP1 */
+#endif
+};
+
+void __init init_IRQ_intc2(void)
+{
+	struct intc2_init *p;	
+
+	for (p = intc2_init_data;
+	     p<intc2_init_data+ARRAY_SIZE(intc2_init_data);
+	     p++) {
+		make_intc2_irq(p->irq, p->ipr_offset, p->ipr_shift,
+			       p-> msk_offset, p->msk_shift, 13);
+	}
+}
+
+/* Adds a termination callback to the interrupt */
+void intc2_add_clear_irq(int irq, int (*fn)(int))
+{
+	if (irq < INTC2_FIRST_IRQ)
+		return;
+
+	intc2_data[irq - INTC2_FIRST_IRQ].clear_irq = fn;
+}
 
+#endif /* CONFIG_CPU_SUBTYPE_ST40 */
diff -urN linux-2.4.23-pre7/arch/sh/kernel/irq_ipr.c linux-2.4.23-pre8/arch/sh/kernel/irq_ipr.c
--- linux-2.4.23-pre7/arch/sh/kernel/irq_ipr.c	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.23-pre8/arch/sh/kernel/irq_ipr.c	2003-10-23 03:33:17.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: irq_ipr.c,v 1.1.1.1.2.1 2003/07/16 18:41:20 yoshii Exp $
+/* $Id: irq_ipr.c,v 1.1.1.1.2.2 2003/10/14 16:46:10 trent Exp $
  *
  * linux/arch/sh/kernel/irq_ipr.c
  *
@@ -274,6 +274,10 @@
 #endif
 #endif /* CONFIG_CPU_SUBTYPE_SH7300 || CONFIG_CPU_SUBTYPE_SH7707 || CONFIG_CPU_SUBTYPE_SH7709 */
 
+#ifdef CONFIG_CPU_SUBTYPE_ST40
+	init_IRQ_intc2();
+#endif
+
 	/* Perform the machine specific initialisation */
 	if (sh_mv.mv_init_irq != NULL) {
 		sh_mv.mv_init_irq();
diff -urN linux-2.4.23-pre7/arch/sh/kernel/signal.c linux-2.4.23-pre8/arch/sh/kernel/signal.c
--- linux-2.4.23-pre7/arch/sh/kernel/signal.c	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.23-pre8/arch/sh/kernel/signal.c	2003-10-23 03:33:17.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: signal.c,v 1.1.1.1.2.11 2002/10/23 00:57:46 mrbrown Exp $
+/* $Id: signal.c,v 1.1.1.1.2.12 2003/10/01 10:54:28 kkojima Exp $
  *
  *  linux/arch/sh/kernel/signal.c
  *
@@ -168,21 +168,22 @@
  * Do a signal return; undo the signal stack.
  */
 
-#define MOVW(n)	(0x9300|((n)-2))	/* Move mem word at PC+n to R3 */
-#define TRAP16	0xc310			/* Syscall w/no args (NR in R3) */
+#define MOVW(n)	 (0x9300|((n)-2))	/* Move mem word at PC+n to R3 */
+#define TRAP16	 0xc310			/* Syscall w/no args (NR in R3) */
+#define OR_R0_R0 0x200b			/* or r0,r0 (insert to avoid hardware bug) */
 
 struct sigframe
 {
 	struct sigcontext sc;
 	unsigned long extramask[_NSIG_WORDS-1];
-	u16 retcode[3];
+	u16 retcode[8];
 };
 
 struct rt_sigframe
 {
 	struct siginfo info;
 	struct ucontext uc;
-	u16 retcode[3];
+	u16 retcode[8];
 };
 
 #if defined(__SH4__)
@@ -397,9 +398,14 @@
 		regs->pr = (unsigned long) ka->sa.sa_restorer;
 	} else {
 		/* Generate return code (system call to sigreturn) */
-		err |= __put_user(MOVW(2), &frame->retcode[0]);
+		err |= __put_user(MOVW(7), &frame->retcode[0]);
 		err |= __put_user(TRAP16, &frame->retcode[1]);
-		err |= __put_user((__NR_sigreturn), &frame->retcode[2]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[2]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[3]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[4]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[5]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[6]);
+		err |= __put_user((__NR_sigreturn), &frame->retcode[7]);
 		regs->pr = (unsigned long) frame->retcode;
 	}
 
@@ -409,6 +415,8 @@
 	/* Set up registers for signal handler */
 	regs->regs[15] = (unsigned long) frame;
 	regs->regs[4] = signal; /* Arg for signal handler */
+	regs->regs[5] = 0;
+	regs->regs[6] = (unsigned long) &frame->sc;
 	regs->pc = (unsigned long) ka->sa.sa_handler;
 
 	set_fs(USER_DS);
@@ -419,6 +427,8 @@
 #endif
 
 	flush_cache_sigtramp(regs->pr);
+	if ((-regs->pr & (L1_CACHE_BYTES-1)) < sizeof(frame->retcode))
+		flush_cache_sigtramp(regs->pr + L1_CACHE_BYTES);
 	return;
 
 give_sigsegv:
@@ -465,9 +475,14 @@
 		regs->pr = (unsigned long) ka->sa.sa_restorer;
 	} else {
 		/* Generate return code (system call to rt_sigreturn) */
-		err |= __put_user(MOVW(2), &frame->retcode[0]);
+		err |= __put_user(MOVW(7), &frame->retcode[0]);
 		err |= __put_user(TRAP16, &frame->retcode[1]);
-		err |= __put_user((__NR_rt_sigreturn), &frame->retcode[2]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[2]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[3]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[4]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[5]);
+		err |= __put_user(OR_R0_R0, &frame->retcode[6]);
+		err |= __put_user((__NR_rt_sigreturn), &frame->retcode[7]);
 		regs->pr = (unsigned long) frame->retcode;
 	}
 
@@ -489,6 +504,8 @@
 #endif
 
 	flush_cache_sigtramp(regs->pr);
+	if ((-regs->pr & (L1_CACHE_BYTES-1)) < sizeof(frame->retcode))
+		flush_cache_sigtramp(regs->pr + L1_CACHE_BYTES);
 	return;
 
 give_sigsegv:
diff -urN linux-2.4.23-pre7/arch/sparc/kernel/devices.c linux-2.4.23-pre8/arch/sparc/kernel/devices.c
--- linux-2.4.23-pre7/arch/sparc/kernel/devices.c	2002-11-28 15:53:12.000000000 -0800
+++ linux-2.4.23-pre8/arch/sparc/kernel/devices.c	2003-10-23 03:33:17.000000000 -0700
@@ -15,7 +15,7 @@
 #include <asm/smp.h>
 #include <asm/system.h>
 
-struct prom_cpuinfo linux_cpus[32];
+struct prom_cpuinfo linux_cpus[NR_CPUS];
 int linux_num_cpus = 0;
 
 extern void cpu_probe(void);
diff -urN linux-2.4.23-pre7/arch/sparc64/defconfig linux-2.4.23-pre8/arch/sparc64/defconfig
--- linux-2.4.23-pre7/arch/sparc64/defconfig	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/arch/sparc64/defconfig	2003-10-23 03:33:17.000000000 -0700
@@ -21,6 +21,7 @@
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_SMP=y
+CONFIG_NR_CPUS=32
 CONFIG_SPARC64=y
 CONFIG_HOTPLUG=y
 CONFIG_HAVE_DEC_LOCK=y
@@ -58,7 +59,6 @@
 CONFIG_BINFMT_MISC=m
 # CONFIG_SUNOS_EMUL is not set
 CONFIG_SOLARIS_EMUL=m
-CONFIG_NR_CPUS=32
 
 #
 # Parallel port support
@@ -255,6 +255,32 @@
 CONFIG_IP_NF_NAT_NEEDED=y
 CONFIG_IP_NF_COMPAT_IPFWADM=m
 CONFIG_IP_NF_NAT_NEEDED=y
+
+#
+#   IP: Virtual Server Configuration
+#
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
 CONFIG_IPV6=m
 
 #
@@ -280,6 +306,15 @@
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_MARK=m
 # CONFIG_KHTTPD is not set
+
+#
+#    SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IPV6_SCTP__=m
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_ADLER32 is not set
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
 # CONFIG_ATM is not set
 CONFIG_VLAN_8021Q=m
 
@@ -566,6 +601,7 @@
 # CONFIG_AMD8111_ETH is not set
 CONFIG_ADAPTEC_STARFIRE=m
 # CONFIG_APRICOT is not set
+CONFIG_B44=m
 # CONFIG_CS89x0 is not set
 CONFIG_TULIP=m
 # CONFIG_TULIP_MWI is not set
@@ -593,7 +629,6 @@
 CONFIG_SUNDANCE=m
 CONFIG_SUNDANCE_MMIO=y
 # CONFIG_TLAN is not set
-# CONFIG_TC35815 is not set
 CONFIG_VIA_RHINE=m
 # CONFIG_VIA_RHINE_MMIO is not set
 CONFIG_WINBOND_840=m
@@ -845,6 +880,8 @@
 # CONFIG_MIDI_VIA82CXXX is not set
 # CONFIG_SOUND_OSS is not set
 # CONFIG_SOUND_TVMIXER is not set
+CONFIG_SOUND_AD1980=m
+CONFIG_SOUND_WM97XX=m
 
 #
 # USB support
@@ -984,7 +1021,17 @@
 CONFIG_USB_TIGL=m
 # CONFIG_USB_BRLVGER is not set
 CONFIG_USB_LCD=m
-# CONFIG_USB_SPEEDTOUCH is not set
+
+#
+# Support for USB gadgets
+#
+CONFIG_USB_GADGET=y
+
+#
+# USB Peripheral Controller Drivers
+#
+# CONFIG_USB_NET2280 is not set
+# CONFIG_USB_GADGET_CONTROLLER is not set
 
 #
 # Bluetooth support
@@ -997,7 +1044,6 @@
 CONFIG_BLUEZ_BNEP=m
 CONFIG_BLUEZ_BNEP_MC_FILTER=y
 CONFIG_BLUEZ_BNEP_PROTO_FILTER=y
-CONFIG_BLUEZ_CMTP=m
 
 #
 # Bluetooth device drivers
@@ -1009,6 +1055,7 @@
 CONFIG_BLUEZ_HCIUART_H4=y
 CONFIG_BLUEZ_HCIUART_BCSP=y
 CONFIG_BLUEZ_HCIUART_BCSP_TXCRC=y
+CONFIG_BLUEZ_HCIBFUSB=m
 # CONFIG_BLUEZ_HCIDTL1 is not set
 # CONFIG_BLUEZ_HCIBT3C is not set
 # CONFIG_BLUEZ_HCIBLUECARD is not set
@@ -1030,6 +1077,7 @@
 # CONFIG_DEBUG_BUGVERBOSE is not set
 # CONFIG_DEBUG_DCFLUSH is not set
 # CONFIG_STACK_DEBUG is not set
+CONFIG_LOG_BUF_SHIFT=0
 
 #
 # Cryptographic options
@@ -1047,6 +1095,7 @@
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_SERPENT=m
 CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_DEFLATE=y
 # CONFIG_CRYPTO_TEST is not set
 
@@ -1056,3 +1105,4 @@
 CONFIG_CRC32=y
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
+CONFIG_FW_LOADER=m
diff -urN linux-2.4.23-pre7/arch/sparc64/kernel/entry.S linux-2.4.23-pre8/arch/sparc64/kernel/entry.S
--- linux-2.4.23-pre7/arch/sparc64/kernel/entry.S	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/arch/sparc64/kernel/entry.S	2003-10-23 03:33:17.000000000 -0700
@@ -1754,8 +1754,8 @@
 	cmp		%o0, -ENOIOCTLCMD
 	sllx		%g2, 32, %g2
 	bgeu,pn		%xcc, 1f
-
 	 andcc		%l0, 0x02, %l6	
+80:
 	andn		%g3, %g2, %g3		/* System call success, clear Carry condition code. */
 	stx		%g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]	
 	bne,pn		%icc, linux_syscall_trace2
@@ -1765,9 +1765,21 @@
 	 stx		%l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
 
 1:
+	/* Really a failure?  Check if force_successful_syscall_return()
+	 * was invoked.
+	 */
+	ldx		[%curptr + AOFF_task_thread + AOFF_thread_flags], %l0
+	andcc		%l0, SPARC_FLAG_SYS_SUCCESS, %g0
+	be,pt		%icc, 1f
+	 andcc		%l6, 0x02, %g0
+	andn		%l0, SPARC_FLAG_SYS_SUCCESS, %l0
+	ba,pt		%xcc, 80b
+	 stx		%l0, [%curptr + AOFF_task_thread + AOFF_thread_flags]
+
 	/* System call failure, set Carry condition code.
 	 * Also, get abs(errno) to return to the process.
 	 */
+1:
 	sub		%g0, %o0, %o0
 	or		%g3, %g2, %g3
 	stx		%o0, [%sp + PTREGS_OFF + PT_V9_I0]
diff -urN linux-2.4.23-pre7/drivers/acpi/asus_acpi.c linux-2.4.23-pre8/drivers/acpi/asus_acpi.c
--- linux-2.4.23-pre7/drivers/acpi/asus_acpi.c	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/asus_acpi.c	2003-10-23 03:33:17.000000000 -0700
@@ -33,10 +33,6 @@
  */
 
 #include <linux/config.h>
-#if defined (CONFIG_MODVERSIONS) && !defined (MODVERSIONS) && defined (MODULE)
-#include <linux/modversions.h>
-#endif
-
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
diff -urN linux-2.4.23-pre7/drivers/acpi/battery.c linux-2.4.23-pre8/drivers/acpi/battery.c
--- linux-2.4.23-pre7/drivers/acpi/battery.c	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/battery.c	2003-10-23 03:33:17.000000000 -0700
@@ -348,7 +348,7 @@
 
 	ACPI_FUNCTION_TRACE("acpi_battery_read_info");
 
-	if (!battery)
+	if (!battery || (off != 0))
 		goto end;
 
 	if (battery->flags.present)
@@ -447,7 +447,7 @@
 
 	ACPI_FUNCTION_TRACE("acpi_battery_read_state");
 
-	if (!battery)
+	if (!battery || (off != 0))
 		goto end;
 
 	if (battery->flags.present)
@@ -531,7 +531,7 @@
 
 	ACPI_FUNCTION_TRACE("acpi_battery_read_alarm");
 
-	if (!battery)
+	if (!battery || (off != 0))
 		goto end;
 
 	if (!battery->flags.present) {
diff -urN linux-2.4.23-pre7/drivers/acpi/bus.c linux-2.4.23-pre8/drivers/acpi/bus.c
--- linux-2.4.23-pre7/drivers/acpi/bus.c	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/bus.c	2003-10-23 03:33:17.000000000 -0700
@@ -49,7 +49,7 @@
 
 #define	PREFIX			"ACPI: "
 
-extern void eisa_set_level_irq(unsigned int irq);
+extern void acpi_pic_set_level_irq(unsigned int irq);
 
 extern int			acpi_disabled;
 
@@ -1881,7 +1881,7 @@
         if (acpi_ioapic)
          	mp_config_ioapic_for_sci(acpi_fadt.sci_int);
 	else
-                eisa_set_level_irq(acpi_fadt.sci_int);
+		acpi_pic_set_level_irq(acpi_fadt.sci_int);
 #endif
 
 	status = acpi_enable_subsystem(ACPI_FULL_INITIALIZATION);
diff -urN linux-2.4.23-pre7/drivers/acpi/button.c linux-2.4.23-pre8/drivers/acpi/button.c
--- linux-2.4.23-pre7/drivers/acpi/button.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/button.c	2003-10-23 03:33:17.000000000 -0700
@@ -85,7 +85,7 @@
 
 	ACPI_FUNCTION_TRACE("acpi_button_read_info");
 
-	if (!button || !button->device)
+	if (!button || !button->device || (off != 0))
 		goto end;
 
 	p += sprintf(p, "type:                    %s\n", 
@@ -119,7 +119,7 @@
 
 	ACPI_FUNCTION_TRACE("acpi_button_lid_read_state");
 
-	if (!button || !button->device)
+	if (!button || !button->device || (off != 0))
 		goto end;
 
 	status=acpi_evaluate_integer(button->handle,"_LID",NULL,&state);
diff -urN linux-2.4.23-pre7/drivers/acpi/ec.c linux-2.4.23-pre8/drivers/acpi/ec.c
--- linux-2.4.23-pre7/drivers/acpi/ec.c	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/ec.c	2003-10-23 03:33:17.000000000 -0700
@@ -90,6 +90,13 @@
 /* External interfaces use first EC only, so remember */
 static struct acpi_device *first_ec;
 
+/*
+ * We use kernel thread to handle ec's gpe query, so the query may defer.
+ * The query need a context, which can be freed when we replace ec_ecdt
+ * with EC device. So defered query may have a wrong context.
+ * We use an indication to avoid it
+ */
+static int ec_device_init = 0;
 /* --------------------------------------------------------------------------
                              Transaction Management
    -------------------------------------------------------------------------- */
@@ -389,8 +396,11 @@
 
 	acpi_disable_gpe(NULL, ec->gpe_bit, ACPI_ISR);
 
-	status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE,
-		acpi_ec_gpe_query, ec);
+	if (!ec_device_init)
+		acpi_ec_gpe_query(ec); /* directly query when device didn't init */
+	else
+		status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE,
+			acpi_ec_gpe_query, ec);
 }
 
 /* --------------------------------------------------------------------------
@@ -585,6 +595,8 @@
 	   we now have the *real* EC info, so kill the makeshift one.*/
 	acpi_evaluate_integer(ec->handle, "_UID", NULL, &uid);
 	if (ec_ecdt && ec_ecdt->uid == uid) {
+		acpi_disable_gpe(NULL, ec_ecdt->gpe_bit, ACPI_NOT_ISR);
+		ec_device_init = 1;
 		acpi_remove_address_space_handler(ACPI_ROOT_OBJECT,
 			ACPI_ADR_SPACE_EC, &acpi_ec_space_handler);
 	
diff -urN linux-2.4.23-pre7/drivers/acpi/events/evgpe.c linux-2.4.23-pre8/drivers/acpi/events/evgpe.c
--- linux-2.4.23-pre7/drivers/acpi/events/evgpe.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/events/evgpe.c	2003-10-23 03:33:17.000000000 -0700
@@ -218,7 +218,7 @@
 
 					int_status |= acpi_ev_gpe_dispatch (
 							  &gpe_block->event_info[gpe_number],
-							  gpe_number + gpe_block->register_info[gpe_number].base_gpe_number);
+							  j + gpe_register_info->base_gpe_number);
 				}
 			}
 		}
diff -urN linux-2.4.23-pre7/drivers/acpi/executer/exconfig.c linux-2.4.23-pre8/drivers/acpi/executer/exconfig.c
--- linux-2.4.23-pre7/drivers/acpi/executer/exconfig.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/executer/exconfig.c	2003-10-23 03:33:17.000000000 -0700
@@ -92,6 +92,9 @@
 
 	/* Install the new table into the local data structures */
 
+	ACPI_MEMSET (&table_info, 0, sizeof (struct acpi_table_desc));
+
+	table_info.type        = 5;
 	table_info.pointer     = table;
 	table_info.length      = (acpi_size) table->length;
 	table_info.allocation  = ACPI_MEM_ALLOCATED;
@@ -178,7 +181,7 @@
 			return_ACPI_STATUS (status);
 		}
 
-		/* Not found, return an Integer=0 and AE_OK */
+		/* Table not found, return an Integer=0 and AE_OK */
 
 		ddb_handle = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
 		if (!ddb_handle) {
@@ -248,9 +251,11 @@
 				 walk_state);
 		if (ACPI_FAILURE (status)) {
 			(void) acpi_ex_unload_table (ddb_handle);
+			return_ACPI_STATUS (status);
 		}
 	}
 
+	*return_desc = ddb_handle;
 	return_ACPI_STATUS  (status);
 }
 
@@ -417,7 +422,7 @@
 acpi_ex_unload_table (
 	union acpi_operand_object       *ddb_handle)
 {
-	acpi_status                     status = AE_NOT_IMPLEMENTED;
+	acpi_status                     status = AE_OK;
 	union acpi_operand_object       *table_desc = ddb_handle;
 	struct acpi_table_desc          *table_info;
 
diff -urN linux-2.4.23-pre7/drivers/acpi/executer/exfield.c linux-2.4.23-pre8/drivers/acpi/executer/exfield.c
--- linux-2.4.23-pre7/drivers/acpi/executer/exfield.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/executer/exfield.c	2003-10-23 03:33:17.000000000 -0700
@@ -160,10 +160,10 @@
 	}
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-		"Obj=%p Type=%X Buf=%p Len=%X\n",
+		"field_read [TO]:  Obj %p, Type %X, Buf %p, byte_len %X\n",
 		obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc), buffer, (u32) length));
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-		"field_write: bit_len=%X bit_off=%X byte_off=%X\n",
+		"field_read [FROM]: bit_len %X, bit_off %X, byte_off %X\n",
 		obj_desc->common_field.bit_length,
 		obj_desc->common_field.start_field_bit_offset,
 		obj_desc->common_field.base_byte_offset));
@@ -335,10 +335,13 @@
 	}
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-		"Obj=%p Type=%X Buf=%p Len=%X\n",
-		obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc), buffer, length));
+		"field_write [FROM]: Obj %p (%s:%X), Buf %p, byte_len %X\n",
+		source_desc, acpi_ut_get_type_name (ACPI_GET_OBJECT_TYPE (source_desc)),
+		ACPI_GET_OBJECT_TYPE (source_desc), buffer, length));
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-		"field_read: bit_len=%X bit_off=%X byte_off=%X\n",
+		"field_write [TO]:  Obj %p (%s:%X), bit_len %X, bit_off %X, byte_off %X\n",
+		obj_desc, acpi_ut_get_type_name (ACPI_GET_OBJECT_TYPE (obj_desc)),
+		ACPI_GET_OBJECT_TYPE (obj_desc),
 		obj_desc->common_field.bit_length,
 		obj_desc->common_field.start_field_bit_offset,
 		obj_desc->common_field.base_byte_offset));
diff -urN linux-2.4.23-pre7/drivers/acpi/executer/exfldio.c linux-2.4.23-pre8/drivers/acpi/executer/exfldio.c
--- linux-2.4.23-pre7/drivers/acpi/executer/exfldio.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/executer/exfldio.c	2003-10-23 03:33:17.000000000 -0700
@@ -64,7 +64,8 @@
  * RETURN:      Status
  *
  * DESCRIPTION: Common processing for acpi_ex_extract_from_field and
- *              acpi_ex_insert_into_field. Initialize the
+ *              acpi_ex_insert_into_field. Initialize the Region if necessary and
+ *              validate the request.
  *
  ******************************************************************************/
 
@@ -96,7 +97,7 @@
 	 * If the Region Address and Length have not been previously evaluated,
 	 * evaluate them now and save the results.
 	 */
-	if (!(rgn_desc->region.flags & AOPOBJ_DATA_VALID)) {
+	if (!(rgn_desc->common.flags & AOPOBJ_DATA_VALID)) {
 		status = acpi_ds_get_region_arguments (rgn_desc);
 		if (ACPI_FAILURE (status)) {
 			return_ACPI_STATUS (status);
@@ -109,6 +110,18 @@
 		return_ACPI_STATUS (AE_OK);
 	}
 
+#ifdef ACPI_UNDER_DEVELOPMENT
+	/*
+	 * If the Field access is any_acc, we can now compute the optimal
+	 * access (because we know know the length of the parent region)
+	 */
+	if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) {
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
+	}
+#endif
+
 	/*
 	 * Validate the request.  The entire request from the byte offset for a
 	 * length of one field datum (access width) must fit within the region.
@@ -242,7 +255,7 @@
 	}
 
 	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_BFIELD,
-		" Region[%s-%X] Access %X Base:Off %X:%X at %8.8X%8.8X\n",
+		" Region [%s:%X], Width %X, byte_base %X, Offset %X at %8.8X%8.8X\n",
 		acpi_ut_get_region_name (rgn_desc->region.space_id),
 		rgn_desc->region.space_id,
 		obj_desc->common_field.access_byte_width,
@@ -365,10 +378,10 @@
 	/*
 	 * The four types of fields are:
 	 *
-	 * buffer_fields - Read/write from/to a Buffer
-	 * region_fields - Read/write from/to a Operation Region.
-	 * bank_fields  - Write to a Bank Register, then read/write from/to an op_region
-	 * index_fields - Write to an Index Register, then read/write from/to a Data Register
+	 * buffer_field - Read/write from/to a Buffer
+	 * region_field - Read/write from/to a Operation Region.
+	 * bank_field  - Write to a Bank Register, then read/write from/to an op_region
+	 * index_field - Write to an Index Register, then read/write from/to a Data Register
 	 */
 	switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
 	case ACPI_TYPE_BUFFER_FIELD:
@@ -458,24 +471,34 @@
 
 		/* Write the index value to the index_register (itself a region_field) */
 
+		field_datum_byte_offset += obj_desc->index_field.value;
+
+		ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+				"Write to Index Register: Value %8.8X\n",
+				field_datum_byte_offset));
+
 		status = acpi_ex_insert_into_field (obj_desc->index_field.index_obj,
-				 &obj_desc->index_field.value,
-				 sizeof (obj_desc->index_field.value));
+				 &field_datum_byte_offset,
+				 sizeof (field_datum_byte_offset));
 		if (ACPI_FAILURE (status)) {
 			return_ACPI_STATUS (status);
 		}
 
+		ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+				"I/O to Data Register: value_ptr %p\n",
+				value));
+
 		if (read_write == ACPI_READ) {
 			/* Read the datum from the data_register */
 
 			status = acpi_ex_extract_from_field (obj_desc->index_field.data_obj,
-					  value, obj_desc->common_field.access_byte_width);
+					  value, sizeof (acpi_integer));
 		}
 		else {
-			/* Write the datum to the Data register */
+			/* Write the datum to the data_register */
 
 			status = acpi_ex_insert_into_field (obj_desc->index_field.data_obj,
-					  value, obj_desc->common_field.access_byte_width);
+					  value, sizeof (acpi_integer));
 		}
 		break;
 
@@ -490,12 +513,14 @@
 
 	if (ACPI_SUCCESS (status)) {
 		if (read_write == ACPI_READ) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Read=%8.8X%8.8X\n",
-					   ACPI_HIDWORD (*value), ACPI_LODWORD (*value)));
+			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Read %8.8X%8.8X, Width %d\n",
+					   ACPI_HIDWORD (*value), ACPI_LODWORD (*value),
+					   obj_desc->common_field.access_byte_width));
 		}
 		else {
-			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Written=%8.8X%8.8X\n",
-					   ACPI_HIDWORD (*value), ACPI_LODWORD (*value)));
+			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Written %8.8X%8.8X, Width %d\n",
+					   ACPI_HIDWORD (*value), ACPI_LODWORD (*value),
+					   obj_desc->common_field.access_byte_width));
 		}
 	}
 
@@ -554,6 +579,10 @@
 				 */
 				status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
 						  &current_value, ACPI_READ);
+				if (ACPI_FAILURE (status)) {
+					return_ACPI_STATUS (status);
+				}
+
 				merged_value |= (current_value & ~mask);
 			}
 			break;
@@ -573,6 +602,7 @@
 			break;
 
 		default:
+
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 				"write_with_update_rule: Unknown update_rule setting: %X\n",
 				(obj_desc->common_field.field_flags & AML_FIELD_UPDATE_RULE_MASK)));
@@ -580,18 +610,19 @@
 		}
 	}
 
-	/* Write the merged value */
-
-	status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
-			  &merged_value, ACPI_WRITE);
-
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-		"Mask %8.8X%8.8X datum_offset %X Value %8.8X%8.8X, merged_value %8.8X%8.8X\n",
+		"Mask %8.8X%8.8X, datum_offset %X, Width %X, Value %8.8X%8.8X, merged_value %8.8X%8.8X\n",
 		ACPI_HIDWORD (mask), ACPI_LODWORD (mask),
 		field_datum_byte_offset,
+		obj_desc->common_field.access_byte_width,
 		ACPI_HIDWORD (field_value), ACPI_LODWORD (field_value),
 		ACPI_HIDWORD (merged_value),ACPI_LODWORD (merged_value)));
 
+	/* Write the merged value */
+
+	status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
+			  &merged_value, ACPI_WRITE);
+
 	return_ACPI_STATUS (status);
 }
 
@@ -625,7 +656,7 @@
 	u32                             index;
 
 
-	ACPI_FUNCTION_ENTRY ();
+	ACPI_FUNCTION_TRACE_U32 ("ex_get_buffer_datum", byte_granularity);
 
 
 	/* Get proper index into buffer (handles big/little endian) */
@@ -659,6 +690,8 @@
 		/* Should not get here */
 		break;
 	}
+
+	return_VOID;
 }
 
 
@@ -690,7 +723,8 @@
 {
 	u32                             index;
 
-	ACPI_FUNCTION_ENTRY ();
+
+	ACPI_FUNCTION_TRACE_U32 ("ex_set_buffer_datum", byte_granularity);
 
 
 	/* Get proper index into buffer (handles big/little endian) */
@@ -724,6 +758,8 @@
 		/* Should not get here */
 		break;
 	}
+
+	return_VOID;
 }
 
 
@@ -777,7 +813,7 @@
 			   obj_desc->common_field.access_byte_width);
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-		"byte_len=%X, datum_len=%X, byte_gran=%X\n",
+		"byte_len %X, datum_len %X, byte_gran %X\n",
 		byte_field_length, datum_count,obj_desc->common_field.access_byte_width));
 
 	/*
@@ -942,20 +978,27 @@
 	 * larger than the field, this typically happens when an integer is
 	 * written to a field that is actually smaller than an integer.
 	 */
-	byte_field_length = ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->common_field.bit_length);
+	byte_field_length = ACPI_ROUND_BITS_UP_TO_BYTES (
+			 obj_desc->common_field.bit_length);
 	if (buffer_length < byte_field_length) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Buffer length %X too small for field %X\n",
+		ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+			"Buffer length %X too small for field %X\n",
 			buffer_length, byte_field_length));
 
 		return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
 	}
 
+	byte_field_length = ACPI_ROUND_BITS_UP_TO_BYTES (
+			 obj_desc->common_field.start_field_bit_offset +
+			 obj_desc->common_field.bit_length);
+
 	/* Convert byte count to datum count, round up if necessary */
 
-	datum_count = ACPI_ROUND_UP_TO (byte_field_length, obj_desc->common_field.access_byte_width);
+	datum_count = ACPI_ROUND_UP_TO (byte_field_length,
+			  obj_desc->common_field.access_byte_width);
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-		"byte_len=%X, datum_len=%X, byte_gran=%X\n",
+		"Bytes %X, Datums %X, byte_gran %X\n",
 		byte_field_length, datum_count, obj_desc->common_field.access_byte_width));
 
 	/*
@@ -1006,6 +1049,10 @@
 		return_ACPI_STATUS (status);
 	}
 
+	/* We just wrote the first datum */
+
+	datum_offset++;
+
 	/* If the entire field fits within one datum, we are done. */
 
 	if ((datum_count == 1) &&
@@ -1025,7 +1072,6 @@
 	 * applied in Part3 below.
 	 */
 	while (datum_offset < datum_count) {
-		datum_offset++;
 		field_datum_byte_offset += obj_desc->common_field.access_byte_width;
 
 		/*
@@ -1057,33 +1103,34 @@
 		 * a datum boundary.  Update Rule must be applied to the bits outside
 		 * the field.
 		 */
-		if (datum_offset == datum_count) {
+		datum_offset++;
+		if ((datum_offset == datum_count) &&
+			(obj_desc->common_field.end_field_valid_bits)) {
 			/*
 			 * If there are dangling non-aligned bits, perform one more merged write
 			 * Else - field is aligned at the end, no need for any more writes
 			 */
-			if (obj_desc->common_field.end_field_valid_bits) {
-				/*
-				 * Part3:
-				 * This is the last datum and the field does not end on a datum boundary.
-				 * Build the partial datum and write with the update rule.
-				 *
-				 * Mask off the unused bits above (after) the end-of-field
-				 */
-				mask = ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits);
-				merged_datum &= mask;
 
-				/* Write the last datum with the update rule */
+			/*
+			 * Part3:
+			 * This is the last datum and the field does not end on a datum boundary.
+			 * Build the partial datum and write with the update rule.
+			 *
+			 * Mask off the unused bits above (after) the end-of-field
+			 */
+			mask = ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits);
+			merged_datum &= mask;
+
+			/* Write the last datum with the update rule */
 
-				status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum,
-						   field_datum_byte_offset);
-				if (ACPI_FAILURE (status)) {
-					return_ACPI_STATUS (status);
-				}
+			status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum,
+					   field_datum_byte_offset);
+			if (ACPI_FAILURE (status)) {
+				return_ACPI_STATUS (status);
 			}
 		}
 		else {
-			/* Normal case -- write the completed datum */
+			/* Normal (aligned) case -- write the completed datum */
 
 			status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
 					  &merged_datum, ACPI_WRITE);
diff -urN linux-2.4.23-pre7/drivers/acpi/executer/exoparg1.c linux-2.4.23-pre8/drivers/acpi/executer/exoparg1.c
--- linux-2.4.23-pre7/drivers/acpi/executer/exoparg1.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/executer/exoparg1.c	2003-10-23 03:33:17.000000000 -0700
@@ -524,7 +524,7 @@
 	acpi_integer                    value;
 
 
-	ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
+	ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
 
 
 	/* Examine the AML opcode */
diff -urN linux-2.4.23-pre7/drivers/acpi/executer/exprep.c linux-2.4.23-pre8/drivers/acpi/executer/exprep.c
--- linux-2.4.23-pre7/drivers/acpi/executer/exprep.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/executer/exprep.c	2003-10-23 03:33:17.000000000 -0700
@@ -53,6 +53,133 @@
 	 ACPI_MODULE_NAME    ("exprep")
 
 
+#ifdef ACPI_UNDER_DEVELOPMENT
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ex_generate_access
+ *
+ * PARAMETERS:  field_bit_offset    - Start of field within parent region/buffer
+ *              field_bit_length    - Length of field in bits
+ *              region_length       - Length of parent in bytes
+ *
+ * RETURN:      Field granularity (8, 16, 32 or 64) and
+ *              byte_alignment (1, 2, 3, or 4)
+ *
+ * DESCRIPTION: Generate an optimal access width for fields defined with the
+ *              any_acc keyword.
+ *
+ * NOTE: Need to have the region_length in order to check for boundary
+ *       conditions (end-of-region).  However, the region_length is a deferred
+ *       operation.  Therefore, to complete this implementation, the generation
+ *       of this access width must be deferred until the region length has
+ *       been evaluated.
+ *
+ ******************************************************************************/
+
+static u32
+acpi_ex_generate_access (
+	u32                             field_bit_offset,
+	u32                             field_bit_length,
+	u32                             region_length)
+{
+	u32                             field_byte_length;
+	u32                             field_byte_offset;
+	u32                             field_byte_end_offset;
+	u32                             access_byte_width;
+	u32                             field_start_offset;
+	u32                             field_end_offset;
+	u32                             minimum_access_width = 0xFFFFFFFF;
+	u32                             minimum_accesses = 0xFFFFFFFF;
+	u32                             accesses;
+
+
+	ACPI_FUNCTION_TRACE ("ex_generate_access");
+
+
+	/* Round Field start offset and length to "minimal" byte boundaries */
+
+	field_byte_offset  = ACPI_DIV_8 (ACPI_ROUND_DOWN (field_bit_offset, 8));
+	field_byte_end_offset = ACPI_DIV_8 (ACPI_ROUND_UP (field_bit_length + field_bit_offset, 8));
+	field_byte_length  = field_byte_end_offset - field_byte_offset;
+
+	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+			"Bit length %d, Bit offset %d\n",
+			field_bit_length, field_bit_offset));
+	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+			"Byte Length %d, Byte Offset %d, End Offset %d\n",
+			field_byte_length, field_byte_offset, field_byte_end_offset));
+
+	/*
+	 * Iterative search for the maximum access width that is both aligned
+	 * and does not go beyond the end of the region
+	 *
+	 * Start at byte_acc and work upwards to qword_acc max. (1,2,4,8 bytes)
+	 */
+	for (access_byte_width = 1; access_byte_width <= 8; access_byte_width <<= 1) {
+		/*
+		 * 1) Round end offset up to next access boundary and make sure that this
+		 *    does not go beyond the end of the parent region.
+		 * 2) When the Access width is greater than the field_byte_length, we are done.
+		 *    (This does not optimize for the perfectly aligned case yet).
+		 */
+		if (ACPI_ROUND_UP (field_byte_end_offset, access_byte_width) <= region_length) {
+			field_start_offset = ACPI_ROUND_DOWN (field_byte_offset, access_byte_width) /
+					  access_byte_width;
+			field_end_offset = ACPI_ROUND_UP   ((field_byte_length + field_byte_offset),
+					  access_byte_width) / access_byte_width;
+			accesses         = field_end_offset - field_start_offset;
+
+			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+					"access_width %d end is within region\n", access_byte_width));
+			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+					"Field Start %d, Field End %d -- requires %d accesses\n",
+					field_start_offset, field_end_offset, accesses));
+
+			/* Single access is optimal */
+
+			if (accesses <= 1) {
+				ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+						"Entire field can be accessed with one operation of size %d\n",
+						access_byte_width));
+				return_VALUE (access_byte_width);
+			}
+
+			/*
+			 * Fits in the region, but requires more than one read/write.
+			 * try the next wider access on next iteration
+			 */
+			if (accesses < minimum_accesses) {
+				minimum_accesses   = accesses;
+				minimum_access_width = access_byte_width;
+			}
+		}
+		else {
+			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+					"access_width %d end is NOT within region\n", access_byte_width));
+			if (access_byte_width == 1) {
+				ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+						"Field goes beyond end-of-region!\n"));
+				return_VALUE (0);     /* Field does not fit in the region at all */
+			}
+
+			/* This width goes beyond the end-of-region, back off to previous access */
+
+			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+					"Backing off to previous optimal access width of %d\n",
+					minimum_access_width));
+			return_VALUE (minimum_access_width);
+		}
+	}
+
+	/* Could not read/write field with one operation, just use max access width */
+
+	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+			"Cannot access field in one operation, using width 8\n"));
+	return_VALUE (8);
+}
+#endif /* ACPI_UNDER_DEVELOPMENT */
+
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ex_decode_field_access
@@ -74,12 +201,11 @@
 	u32                             *return_byte_alignment)
 {
 	u32                             access;
-	u8                              byte_alignment;
-	u8                              bit_length;
-/*    u32                             Length; */
+	u32                             byte_alignment;
+	u32                             bit_length;
 
 
-	ACPI_FUNCTION_NAME ("ex_decode_field_access");
+	ACPI_FUNCTION_TRACE ("ex_decode_field_access");
 
 
 	access = (field_flags & AML_FIELD_ACCESS_TYPE_MASK);
@@ -87,41 +213,15 @@
 	switch (access) {
 	case AML_FIELD_ACCESS_ANY:
 
+#ifdef ACPI_UNDER_DEVELOPMENT
+		byte_alignment = acpi_ex_generate_access (obj_desc->common_field.start_field_bit_offset,
+				 obj_desc->common_field.bit_length,
+				 0xFFFFFFFF /* Temp until we pass region_length as param */);
+		bit_length = byte_alignment * 8;
+#endif
+
 		byte_alignment = 1;
 		bit_length = 8;
-
-#if 0
-		/*
-		 * TBD: optimize
-		 *
-		 * Any attempt to optimize the access size to the size of the field
-		 * must take into consideration the length of the region and take
-		 * care that an access to the field will not attempt to access
-		 * beyond the end of the region.
-		 */
-
-		/* Use the length to set the access type */
-
-		length = obj_desc->common_field.bit_length;
-
-		if (length <= 8) {
-			bit_length = 8;
-		}
-		else if (length <= 16) {
-			bit_length = 16;
-		}
-		else if (length <= 32) {
-			bit_length = 32;
-		}
-		else if (length <= 64) {
-			bit_length = 64;
-		}
-		else {
-			/* Larger than Qword - just use byte-size chunks */
-
-			bit_length = 8;
-		}
-#endif
 		break;
 
 	case AML_FIELD_ACCESS_BYTE:
@@ -151,7 +251,7 @@
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 			"Unknown field access type %X\n",
 			access));
-		return (0);
+		return_VALUE (0);
 	}
 
 	if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_BUFFER_FIELD) {
@@ -164,7 +264,7 @@
 	}
 
 	*return_byte_alignment = byte_alignment;
-	return (bit_length);
+	return_VALUE (bit_length);
 }
 
 
@@ -336,7 +436,7 @@
 		type = acpi_ns_get_type (info->region_node);
 		if (type != ACPI_TYPE_REGION) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"Needed Region, found type %X %s\n",
+				"Needed Region, found type %X (%s)\n",
 				type, acpi_ut_get_type_name (type)));
 
 			return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -372,7 +472,7 @@
 		acpi_ut_add_reference (obj_desc->field.region_obj);
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-			"region_field: Bitoff=%X Off=%X Gran=%X Region %p\n",
+			"region_field: bit_off %X, Off %X, Gran %X, Region %p\n",
 			obj_desc->field.start_field_bit_offset, obj_desc->field.base_byte_offset,
 			obj_desc->field.access_byte_width, obj_desc->field.region_obj));
 		break;
@@ -390,7 +490,7 @@
 		acpi_ut_add_reference (obj_desc->bank_field.bank_obj);
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-			"Bank Field: bit_off=%X Off=%X Gran=%X Region %p bank_reg %p\n",
+			"Bank Field: bit_off %X, Off %X, Gran %X, Region %p, bank_reg %p\n",
 			obj_desc->bank_field.start_field_bit_offset,
 			obj_desc->bank_field.base_byte_offset,
 			obj_desc->field.access_byte_width,
@@ -417,9 +517,10 @@
 		acpi_ut_add_reference (obj_desc->index_field.index_obj);
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-			"index_field: bitoff=%X off=%X gran=%X Index %p Data %p\n",
+			"index_field: bit_off %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n",
 			obj_desc->index_field.start_field_bit_offset,
 			obj_desc->index_field.base_byte_offset,
+			obj_desc->index_field.value,
 			obj_desc->field.access_byte_width,
 			obj_desc->index_field.index_obj,
 			obj_desc->index_field.data_obj));
@@ -437,7 +538,7 @@
 	status = acpi_ns_attach_object (info->field_node, obj_desc,
 			  acpi_ns_get_type (info->field_node));
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "set named_obj %p (%4.4s) val = %p\n",
+	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Set named_obj %p [%4.4s], obj_desc %p\n",
 			info->field_node, info->field_node->name.ascii, obj_desc));
 
 	/* Remove local reference to the object */
diff -urN linux-2.4.23-pre7/drivers/acpi/executer/exresnte.c linux-2.4.23-pre8/drivers/acpi/executer/exresnte.c
--- linux-2.4.23-pre7/drivers/acpi/executer/exresnte.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/executer/exresnte.c	2003-10-23 03:33:17.000000000 -0700
@@ -47,6 +47,8 @@
 #include <acpi/acdispat.h>
 #include <acpi/acinterp.h>
 #include <acpi/acnamesp.h>
+#include <acpi/acparser.h>
+#include <acpi/amlcode.h>
 
 
 #define _COMPONENT          ACPI_EXECUTER
@@ -243,12 +245,26 @@
 
 	case ACPI_TYPE_LOCAL_REFERENCE:
 
-		/* No named references are allowed here */
+		switch (source_desc->reference.opcode) {
+		case AML_LOAD_OP:
 
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unsupported Reference opcode %X\n",
-			source_desc->reference.opcode));
+			/* This is a ddb_handle */
+			/* Return an additional reference to the object */
 
-		return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
+			obj_desc = source_desc;
+			acpi_ut_add_reference (obj_desc);
+			break;
+
+		default:
+			/* No named references are allowed here */
+
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unsupported Reference opcode %X (%s)\n",
+				source_desc->reference.opcode,
+				acpi_ps_get_opcode_name (source_desc->reference.opcode)));
+
+			return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
+		}
+		break;
 
 
 	/* Default case is for unknown types */
diff -urN linux-2.4.23-pre7/drivers/acpi/executer/exresolv.c linux-2.4.23-pre8/drivers/acpi/executer/exresolv.c
--- linux-2.4.23-pre7/drivers/acpi/executer/exresolv.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/executer/exresolv.c	2003-10-23 03:33:17.000000000 -0700
@@ -48,6 +48,7 @@
 #include <acpi/acdispat.h>
 #include <acpi/acinterp.h>
 #include <acpi/acnamesp.h>
+#include <acpi/acparser.h>
 
 
 #define _COMPONENT          ACPI_EXECUTER
@@ -248,6 +249,7 @@
 
 		case AML_REF_OF_OP:
 		case AML_DEBUG_OP:
+		case AML_LOAD_OP:
 
 			/* Just leave the object as-is */
 
@@ -256,8 +258,8 @@
 
 		default:
 
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Reference opcode %X in %p\n",
-				opcode, stack_desc));
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Reference opcode %X (%s) in %p\n",
+				opcode, acpi_ps_get_opcode_name (opcode), stack_desc));
 			status = AE_AML_INTERNAL;
 			break;
 		}
diff -urN linux-2.4.23-pre7/drivers/acpi/executer/exresop.c linux-2.4.23-pre8/drivers/acpi/executer/exresop.c
--- linux-2.4.23-pre7/drivers/acpi/executer/exresop.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/executer/exresop.c	2003-10-23 03:33:17.000000000 -0700
@@ -224,6 +224,7 @@
 				case AML_REF_OF_OP:
 				case AML_ARG_OP:
 				case AML_LOCAL_OP:
+				case AML_LOAD_OP:   /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */
 
 					ACPI_DEBUG_ONLY_MEMBERS (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
 						"Reference Opcode: %s\n", op_info->name)));
@@ -231,8 +232,9 @@
 
 				default:
 					ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-						"Unknown Reference Opcode %X\n",
-						obj_desc->reference.opcode));
+						"Unknown Reference Opcode %X [%s]\n",
+						obj_desc->reference.opcode,
+						(acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name));
 
 					return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
 				}
@@ -378,6 +380,13 @@
 			type_needed = ACPI_TYPE_ANY;
 			break;
 
+		case ARGI_DDBHANDLE:
+
+			/* Need an operand of type ACPI_TYPE_DDB_HANDLE */
+
+			type_needed = ACPI_TYPE_LOCAL_REFERENCE;
+			break;
+
 
 		/*
 		 * The more complex cases allow multiple resolved object types
diff -urN linux-2.4.23-pre7/drivers/acpi/executer/exstoren.c linux-2.4.23-pre8/drivers/acpi/executer/exstoren.c
--- linux-2.4.23-pre7/drivers/acpi/executer/exstoren.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/executer/exstoren.c	2003-10-23 03:33:17.000000000 -0700
@@ -46,6 +46,7 @@
 
 #include <acpi/acpi.h>
 #include <acpi/acinterp.h>
+#include <acpi/amlcode.h>
 
 
 #define _COMPONENT          ACPI_EXECUTER
@@ -114,9 +115,10 @@
 		/*
 		 * Must have a Integer, Buffer, or String
 		 */
-		if ((ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_INTEGER)    &&
-			(ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_BUFFER)     &&
-			(ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_STRING)) {
+		if ((ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_INTEGER)   &&
+			(ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_BUFFER)    &&
+			(ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_STRING)    &&
+			!((ACPI_GET_OBJECT_TYPE (source_desc) == ACPI_TYPE_LOCAL_REFERENCE) && (source_desc->reference.opcode == AML_LOAD_OP))) {
 			/*
 			 * Conversion successful but still not a valid type
 			 */
diff -urN linux-2.4.23-pre7/drivers/acpi/executer/exsystem.c linux-2.4.23-pre8/drivers/acpi/executer/exsystem.c
--- linux-2.4.23-pre7/drivers/acpi/executer/exsystem.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/executer/exsystem.c	2003-10-23 03:33:17.000000000 -0700
@@ -129,18 +129,13 @@
 	ACPI_FUNCTION_ENTRY ();
 
 
-	if (how_long > 1000) /* 1 millisecond */ {
-		/* Since this thread will sleep, we must release the interpreter */
-
-		acpi_ex_exit_interpreter ();
-
-		acpi_os_sleep (0, (how_long / 1000) + 1);
-
-		/* And now we must get the interpreter again */
-
-		status = acpi_ex_enter_interpreter ();
+	if (how_long > 100) /* 100 microseconds */ {
+		/*
+		 * Longer than 100 usec, use sleep instead
+		 * (according to ACPI specification)
+		 */
+		status = acpi_ex_system_do_suspend ((how_long / 1000) + 1);
 	}
-
 	else {
 		acpi_os_stall (how_long);
 	}
diff -urN linux-2.4.23-pre7/drivers/acpi/hardware/hwacpi.c linux-2.4.23-pre8/drivers/acpi/hardware/hwacpi.c
--- linux-2.4.23-pre7/drivers/acpi/hardware/hwacpi.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/hardware/hwacpi.c	2003-10-23 03:33:17.000000000 -0700
@@ -212,6 +212,15 @@
 	if (!acpi_gbl_FADT->smi_cmd)
 		return_VALUE (ACPI_SYS_MODE_ACPI);
 
+
+	/*
+	 * ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
+	 * system does not support mode transition.
+	 */
+	if (!acpi_gbl_FADT->smi_cmd) {
+		return_VALUE (ACPI_SYS_MODE_ACPI);
+	}
+
 	status = acpi_get_register (ACPI_BITREG_SCI_ENABLE, &value, ACPI_MTX_LOCK);
 	if (ACPI_FAILURE (status)) {
 		return_VALUE (ACPI_SYS_MODE_LEGACY);
diff -urN linux-2.4.23-pre7/drivers/acpi/power.c linux-2.4.23-pre8/drivers/acpi/power.c
--- linux-2.4.23-pre7/drivers/acpi/power.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/power.c	2003-10-23 03:33:17.000000000 -0700
@@ -323,6 +323,9 @@
 	if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))
 		return_VALUE(-EINVAL);
 
+	if ((device->power.state < ACPI_STATE_D0) || (device->power.state > ACPI_STATE_D3))
+		return_VALUE(-ENODEV);
+
 	cl = &device->power.states[device->power.state].resources;
 	tl = &device->power.states[state].resources;
 
@@ -345,8 +348,6 @@
 			goto end;
 	}
 
-	device->power.state = state;
-
 	/*
 	 * Then we dereference all power resources used in the current list.
 	 */
@@ -356,6 +357,8 @@
 			goto end;
 	}
 
+	/* We shouldn't change the state till all above operations succeed */
+	device->power.state = state;
 end:
 	if (result)
 		ACPI_DEBUG_PRINT((ACPI_DB_WARN, 
diff -urN linux-2.4.23-pre7/drivers/acpi/resources/rsaddr.c linux-2.4.23-pre8/drivers/acpi/resources/rsaddr.c
--- linux-2.4.23-pre7/drivers/acpi/resources/rsaddr.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/resources/rsaddr.c	2003-10-23 03:33:17.000000000 -0700
@@ -94,6 +94,12 @@
 	buffer += 1;
 	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
+	/* Validate minimum descriptor length */
+
+	if (temp16 < 13) {
+		return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
+	}
+
 	*bytes_consumed = temp16 + 3;
 	output_struct->id = ACPI_RSTYPE_ADDRESS16;
 
@@ -199,8 +205,11 @@
 	 * pointer to where the null terminated string goes:
 	 * Each Interrupt takes 32-bits + the 5 bytes of the
 	 * stream that are default.
+	 *
+	 * Note: Some resource descriptors will have an additional null, so
+	 * we add 1 to the length.
 	 */
-	if (*bytes_consumed > 16) {
+	if (*bytes_consumed > (16 + 1)) {
 		/* Dereference the Index */
 
 		temp8 = *buffer;
@@ -401,7 +410,7 @@
 
 		/*
 		 * Buffer needs to be set to the length of the sting + one for the
-		 *  terminating null
+		 * terminating null
 		 */
 		buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.address16.resource_source.string_ptr) + 1);
 	}
@@ -470,8 +479,14 @@
 	 */
 	buffer += 1;
 	ACPI_MOVE_16_TO_16 (&temp16, buffer);
-	*bytes_consumed = temp16 + 3;
 
+	/* Validate minimum descriptor length */
+
+	if (temp16 < 23) {
+		return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
+	}
+
+	*bytes_consumed = temp16 + 3;
 	output_struct->id = ACPI_RSTYPE_ADDRESS32;
 
 	/*
@@ -578,8 +593,11 @@
 	 * This will leave us pointing to the Resource Source Index
 	 * If it is present, then save it off and calculate the
 	 * pointer to where the null terminated string goes:
+	 *
+	 * Note: Some resource descriptors will have an additional null, so
+	 * we add 1 to the length.
 	 */
-	if (*bytes_consumed > 26) {
+	if (*bytes_consumed > (26 + 1)) {
 		/* Dereference the Index */
 
 		temp8 = *buffer;
@@ -616,8 +634,8 @@
 
 		/*
 		 * In order for the struct_size to fall on a 32-bit boundary,
-		 *  calculate the length of the string and expand the
-		 *  struct_size to the next 32-bit boundary.
+		 * calculate the length of the string and expand the
+		 * struct_size to the next 32-bit boundary.
 		 */
 		temp8 = (u8) (index + 1);
 		struct_size += ACPI_ROUND_UP_to_32_bITS (temp8);
@@ -848,6 +866,12 @@
 	buffer += 1;
 	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
+	/* Validate minimum descriptor length */
+
+	if (temp16 < 43) {
+		return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
+	}
+
 	*bytes_consumed = temp16 + 3;
 	output_struct->id = ACPI_RSTYPE_ADDRESS64;
 
@@ -958,8 +982,11 @@
 	 * pointer to where the null terminated string goes:
 	 * Each Interrupt takes 32-bits + the 5 bytes of the
 	 * stream that are default.
+	 *
+	 * Note: Some resource descriptors will have an additional null, so
+	 * we add 1 to the length.
 	 */
-	if (*bytes_consumed > 46) {
+	if (*bytes_consumed > (46 + 1)) {
 		/* Dereference the Index */
 
 		temp8 = *buffer;
@@ -992,7 +1019,6 @@
 		 * Add the terminating null
 		 */
 		*temp_ptr = 0x00;
-
 		output_struct->data.address64.resource_source.string_length = index + 1;
 
 		/*
@@ -1064,7 +1090,6 @@
 	/*
 	 * Set a pointer to the Length field - to be filled in later
 	 */
-
 	length_field = ACPI_CAST_PTR (u16, buffer);
 	buffer += 2;
 
@@ -1161,7 +1186,7 @@
 
 		/*
 		 * Buffer needs to be set to the length of the sting + one for the
-		 *  terminating null
+		 * terminating null
 		 */
 		buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.address64.resource_source.string_ptr) + 1);
 	}
diff -urN linux-2.4.23-pre7/drivers/acpi/resources/rsirq.c linux-2.4.23-pre8/drivers/acpi/resources/rsirq.c
--- linux-2.4.23-pre7/drivers/acpi/resources/rsirq.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/resources/rsirq.c	2003-10-23 03:33:17.000000000 -0700
@@ -319,6 +319,12 @@
 	buffer += 1;
 	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
+	/* Validate minimum descriptor length */
+
+	if (temp16 < 6) {
+		return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
+	}
+
 	*bytes_consumed = temp16 + 3;
 	output_struct->id = ACPI_RSTYPE_EXT_IRQ;
 
@@ -357,6 +363,12 @@
 	buffer += 1;
 	temp8 = *buffer;
 
+	/* Must have at least one IRQ */
+
+	if (temp8 < 1) {
+		return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
+	}
+
 	output_struct->data.extended_irq.number_of_interrupts = temp8;
 
 	/*
@@ -388,9 +400,12 @@
 	 * pointer to where the null terminated string goes:
 	 * Each Interrupt takes 32-bits + the 5 bytes of the
 	 * stream that are default.
+	 *
+	 * Note: Some resource descriptors will have an additional null, so
+	 * we add 1 to the length.
 	 */
 	if (*bytes_consumed >
-		((acpi_size) output_struct->data.extended_irq.number_of_interrupts * 4) + 5) {
+		((acpi_size) output_struct->data.extended_irq.number_of_interrupts * 4) + (5 + 1)) {
 		/* Dereference the Index */
 
 		temp8 = *buffer;
diff -urN linux-2.4.23-pre7/drivers/acpi/tables/tbconvrt.c linux-2.4.23-pre8/drivers/acpi/tables/tbconvrt.c
--- linux-2.4.23-pre7/drivers/acpi/tables/tbconvrt.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/tables/tbconvrt.c	2003-10-23 03:33:17.000000000 -0700
@@ -131,7 +131,7 @@
 	/* Copy the header and set the length */
 
 	ACPI_MEMCPY (new_table, table_info->pointer, sizeof (struct acpi_table_header));
-	new_table->header.length = (u32) table_size;
+	new_table->length = (u32) table_size;
 
 	/* Copy the table pointers */
 
@@ -430,17 +430,17 @@
 	 * FADT length and version validation.  The table must be at least as
 	 * long as the version 1.0 FADT
 	 */
-	if (acpi_gbl_FADT->header.length < sizeof (struct fadt_descriptor_rev1)) {
-		ACPI_REPORT_ERROR (("Invalid FADT table length: 0x%X\n", acpi_gbl_FADT->header.length));
+	if (acpi_gbl_FADT->length < sizeof (struct fadt_descriptor_rev1)) {
+		ACPI_REPORT_ERROR (("Invalid FADT table length: 0x%X\n", acpi_gbl_FADT->length));
 		return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH);
 	}
 
-	if (acpi_gbl_FADT->header.revision >= FADT2_REVISION_ID) {
-		if (acpi_gbl_FADT->header.length < sizeof (struct fadt_descriptor_rev2)) {
+	if (acpi_gbl_FADT->revision >= FADT2_REVISION_ID) {
+		if (acpi_gbl_FADT->length < sizeof (struct fadt_descriptor_rev2)) {
 			/* Length is too short to be a V2.0 table */
 
 			ACPI_REPORT_WARNING (("Inconsistent FADT length (0x%X) and revision (0x%X), using FADT V1.0 portion of table\n",
-					 acpi_gbl_FADT->header.length, acpi_gbl_FADT->header.revision));
+					 acpi_gbl_FADT->length, acpi_gbl_FADT->revision));
 
 			acpi_tb_convert_fadt1 (local_fadt, (void *) acpi_gbl_FADT);
 		}
@@ -460,7 +460,7 @@
 	 * Global FADT pointer will point to the new common V2.0 FADT
 	 */
 	acpi_gbl_FADT = local_fadt;
-	acpi_gbl_FADT->header.length = sizeof (FADT_DESCRIPTOR);
+	acpi_gbl_FADT->length = sizeof (FADT_DESCRIPTOR);
 
 	/* Free the original table */
 
@@ -477,8 +477,8 @@
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
 		"Hex dump of common internal FADT, size %d (%X)\n",
-		acpi_gbl_FADT->header.length, acpi_gbl_FADT->header.length));
-	ACPI_DUMP_BUFFER ((u8 *) (acpi_gbl_FADT), acpi_gbl_FADT->header.length);
+		acpi_gbl_FADT->length, acpi_gbl_FADT->length));
+	ACPI_DUMP_BUFFER ((u8 *) (acpi_gbl_FADT), acpi_gbl_FADT->length);
 
 	return_ACPI_STATUS (AE_OK);
 }
diff -urN linux-2.4.23-pre7/drivers/acpi/tables/tbinstal.c linux-2.4.23-pre8/drivers/acpi/tables/tbinstal.c
--- linux-2.4.23-pre7/drivers/acpi/tables/tbinstal.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/tables/tbinstal.c	2003-10-23 03:33:17.000000000 -0700
@@ -350,7 +350,7 @@
 void
 acpi_tb_delete_all_tables (void)
 {
-	acpi_table_type                     type;
+	acpi_table_type                 type;
 
 
 	/*
@@ -378,7 +378,7 @@
 
 void
 acpi_tb_delete_tables_by_type (
-	acpi_table_type                     type)
+	acpi_table_type                 type)
 {
 	struct acpi_table_desc          *table_desc;
 	u32                             count;
@@ -425,15 +425,16 @@
 		break;
 	}
 
-	/* Free the table */
-	/* Get the head of the list */
-
+	/*
+	 * Free the table
+	 * 1) Get the head of the list
+	 */
 	table_desc = acpi_gbl_table_lists[type].next;
 	count     = acpi_gbl_table_lists[type].count;
 
 	/*
-	 * Walk the entire list, deleting both the allocated tables
-	 * and the table descriptors
+	 * 2) Walk the entire list, deleting both the allocated tables
+	 *    and the table descriptors
 	 */
 	for (i = 0; i < count; i++) {
 		table_desc = acpi_tb_uninstall_table (table_desc);
diff -urN linux-2.4.23-pre7/drivers/acpi/utilities/utalloc.c linux-2.4.23-pre8/drivers/acpi/utilities/utalloc.c
--- linux-2.4.23-pre7/drivers/acpi/utilities/utalloc.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/utilities/utalloc.c	2003-10-23 03:33:17.000000000 -0700
@@ -795,7 +795,7 @@
 
 	ACPI_MEMSET (&allocation->user_space, 0xEA, allocation->size);
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size %X\n", allocation->size));
+	ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n", allocation->size));
 
 	status = acpi_ut_release_mutex (ACPI_MTX_MEMORY);
 	return_ACPI_STATUS (status);
diff -urN linux-2.4.23-pre7/drivers/acpi/utilities/utdelete.c linux-2.4.23-pre8/drivers/acpi/utilities/utdelete.c
--- linux-2.4.23-pre7/drivers/acpi/utilities/utdelete.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/utilities/utdelete.c	2003-10-23 03:33:17.000000000 -0700
@@ -416,7 +416,7 @@
 	u32                             i;
 	union acpi_generic_state         *state_list = NULL;
 	union acpi_generic_state         *state;
-
+	union acpi_operand_object        *tmp;
 
 	ACPI_FUNCTION_TRACE_PTR ("ut_update_object_reference", object);
 
@@ -448,8 +448,16 @@
 		switch (ACPI_GET_OBJECT_TYPE (object)) {
 		case ACPI_TYPE_DEVICE:
 
-			acpi_ut_update_ref_count (object->device.system_notify, action);
-			acpi_ut_update_ref_count (object->device.device_notify, action);
+			tmp = object->device.system_notify;
+			if (tmp && (tmp->common.reference_count <= 1) && action == REF_DECREMENT)
+				object->device.system_notify = NULL;
+			acpi_ut_update_ref_count (tmp, action);
+
+			tmp = object->device.device_notify;
+			if (tmp && (tmp->common.reference_count <= 1) && action == REF_DECREMENT)
+				object->device.device_notify = NULL;
+			acpi_ut_update_ref_count (tmp, action);
+
 			break;
 
 
@@ -470,6 +478,10 @@
 				if (ACPI_FAILURE (status)) {
 					goto error_exit;
 				}
+
+				tmp = object->package.elements[i];
+				if (tmp && (tmp->common.reference_count <= 1)  && action == REF_DECREMENT)
+					object->package.elements[i] = NULL;
 			}
 			break;
 
@@ -481,6 +493,10 @@
 			if (ACPI_FAILURE (status)) {
 				goto error_exit;
 			}
+
+			tmp = object->buffer_field.buffer_obj;
+			if ( tmp && (tmp->common.reference_count <= 1)  && action == REF_DECREMENT)
+				object->buffer_field.buffer_obj = NULL;
 			break;
 
 
@@ -491,6 +507,10 @@
 			if (ACPI_FAILURE (status)) {
 				goto error_exit;
 			}
+
+			tmp = object->field.region_obj;
+			if ( tmp && (tmp->common.reference_count <= 1)  && action == REF_DECREMENT)
+				object->field.region_obj = NULL;
 		   break;
 
 
@@ -502,11 +522,19 @@
 				goto error_exit;
 			}
 
+			tmp = object->bank_field.bank_obj;
+			if ( tmp && (tmp->common.reference_count <= 1)  && action == REF_DECREMENT)
+				object->bank_field.bank_obj = NULL;
+
 			status = acpi_ut_create_update_state_and_push (
 					 object->bank_field.region_obj, action, &state_list);
 			if (ACPI_FAILURE (status)) {
 				goto error_exit;
 			}
+
+			tmp = object->bank_field.region_obj;
+			if ( tmp && (tmp->common.reference_count <= 1)  && action == REF_DECREMENT)
+				object->bank_field.region_obj = NULL;
 			break;
 
 
@@ -518,11 +546,19 @@
 				goto error_exit;
 			}
 
+			tmp = object->index_field.index_obj;
+			if ( tmp && (tmp->common.reference_count <= 1)  && action == REF_DECREMENT)
+				object->index_field.index_obj = NULL;
+
 			status = acpi_ut_create_update_state_and_push (
 					 object->index_field.data_obj, action, &state_list);
 			if (ACPI_FAILURE (status)) {
 				goto error_exit;
 			}
+
+			tmp = object->index_field.data_obj;
+			if ( tmp && (tmp->common.reference_count <= 1)  && action == REF_DECREMENT)
+				object->index_field.data_obj = NULL;
 			break;
 
 
diff -urN linux-2.4.23-pre7/drivers/acpi/utilities/utglobal.c linux-2.4.23-pre8/drivers/acpi/utilities/utglobal.c
--- linux-2.4.23-pre7/drivers/acpi/utilities/utglobal.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/acpi/utilities/utglobal.c	2003-10-23 03:33:17.000000000 -0700
@@ -307,8 +307,8 @@
 	/***********    Name,   Signature, Global typed pointer     Signature size,      Type                  How many allowed?,    Contains valid AML? */
 
 	/* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL,                    sizeof (RSDP_SIG)-1, ACPI_TABLE_ROOT     | ACPI_TABLE_SINGLE},
-	/* DSDT 1 */ {DSDT_SIG,  DSDT_SIG, (void *) &acpi_gbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE  | ACPI_TABLE_EXECUTABLE},
-	/* FADT 2 */ {FADT_SIG,  FADT_SIG, (void *) &acpi_gbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE},
+	/* DSDT 1 */ {DSDT_SIG,  DSDT_SIG, (void *) &acpi_gbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE   | ACPI_TABLE_EXECUTABLE},
+	/* FADT 2 */ {FADT_SIG,  FADT_SIG, (void *) &acpi_gbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY  | ACPI_TABLE_SINGLE},
 	/* FACS 3 */ {FACS_SIG,  FACS_SIG, (void *) &acpi_gbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE},
 	/* PSDT 4 */ {PSDT_SIG,  PSDT_SIG, NULL,                    sizeof (PSDT_SIG)-1, ACPI_TABLE_PRIMARY  | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE},
 	/* SSDT 5 */ {SSDT_SIG,  SSDT_SIG, NULL,                    sizeof (SSDT_SIG)-1, ACPI_TABLE_PRIMARY  | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE},
diff -urN linux-2.4.23-pre7/drivers/atm/atmtcp.c linux-2.4.23-pre8/drivers/atm/atmtcp.c
--- linux-2.4.23-pre7/drivers/atm/atmtcp.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/atm/atmtcp.c	2003-10-23 03:33:17.000000000 -0700
@@ -153,9 +153,9 @@
 
 static int atmtcp_v_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 {
-	unsigned long flags;
 	struct atm_cirange ci;
 	struct atm_vcc *vcc;
+	struct sock *s;
 
 	if (cmd != ATM_SETCIRANGE) return -ENOIOCTLCMD;
 	if (copy_from_user(&ci,(void *) arg,sizeof(ci))) return -EFAULT;
@@ -163,14 +163,18 @@
 	if (ci.vci_bits == ATM_CI_MAX) ci.vci_bits = MAX_VCI_BITS;
 	if (ci.vpi_bits > MAX_VPI_BITS || ci.vpi_bits < 0 ||
 	    ci.vci_bits > MAX_VCI_BITS || ci.vci_bits < 0) return -EINVAL;
-	spin_lock_irqsave(&dev->lock, flags);
-	for (vcc = dev->vccs; vcc; vcc = vcc->next)
+	read_lock(&vcc_sklist_lock);
+	for (s = vcc_sklist; s; s = s->next) {
+		vcc = s->protinfo.af_atm;
+		if (vcc->dev != dev)
+			continue;
 		if ((vcc->vpi >> ci.vpi_bits) ||
 		    (vcc->vci >> ci.vci_bits)) {
-			spin_unlock_irqrestore(&dev->lock, flags);
+			read_unlock(&vcc_sklist_lock);
 			return -EBUSY;
 		}
-	spin_unlock_irqrestore(&dev->lock, flags);
+	}
+	read_unlock(&vcc_sklist_lock);
 	dev->ci_range = ci;
 	return 0;
 }
@@ -233,9 +237,9 @@
 
 static void atmtcp_c_close(struct atm_vcc *vcc)
 {
-	unsigned long flags;
 	struct atm_dev *atmtcp_dev;
 	struct atmtcp_dev_data *dev_data;
+	struct sock *s;
 	struct atm_vcc *walk;
 
 	atmtcp_dev = (struct atm_dev *) vcc->dev_data;
@@ -246,19 +250,23 @@
 	kfree(dev_data);
 	shutdown_atm_dev(atmtcp_dev);
 	vcc->dev_data = NULL;
-	spin_lock_irqsave(&atmtcp_dev->lock, flags);
-	for (walk = atmtcp_dev->vccs; walk; walk = walk->next)
+	read_lock(&vcc_sklist_lock);
+	for (s = vcc_sklist; s; s = s->next) {
+		walk = s->protinfo.af_atm;
+		if (walk->dev != atmtcp_dev)
+			continue;
 		wake_up(&walk->sleep);
-	spin_unlock_irqrestore(&atmtcp_dev->lock, flags);
+	}
+	read_unlock(&vcc_sklist_lock);
 }
 
 
 static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
 {
-	unsigned long flags;
 	struct atm_dev *dev;
 	struct atmtcp_hdr *hdr;
-	struct atm_vcc *out_vcc;
+	struct sock *s;
+	struct atm_vcc *out_vcc = NULL;
 	struct sk_buff *new_skb;
 	int result = 0;
 
@@ -270,13 +278,17 @@
 		    (struct atmtcp_control *) skb->data);
 		goto done;
 	}
-	spin_lock_irqsave(&dev->lock, flags);
-	for (out_vcc = dev->vccs; out_vcc; out_vcc = out_vcc->next)
+	read_lock(&vcc_sklist_lock);
+	for (s = vcc_sklist; s; s = s->next) {
+		out_vcc = s->protinfo.af_atm;
+		if (out_vcc->dev != dev)
+			continue;
 		if (out_vcc->vpi == ntohs(hdr->vpi) &&
 		    out_vcc->vci == ntohs(hdr->vci) &&
 		    out_vcc->qos.rxtp.traffic_class != ATM_NONE)
 			break;
-	spin_unlock_irqrestore(&dev->lock, flags);
+	}
+	read_unlock(&vcc_sklist_lock);
 	if (!out_vcc) {
 		atomic_inc(&vcc->stats->tx_err);
 		goto done;
@@ -366,7 +378,7 @@
 	if (itf != -1) dev = atm_dev_lookup(itf);
 	if (dev) {
 		if (dev->ops != &atmtcp_v_dev_ops) {
-			atm_dev_release(dev);
+			atm_dev_put(dev);
 			return -EMEDIUMTYPE;
 		}
 		if (PRIV(dev)->vcc) return -EBUSY;
@@ -378,7 +390,8 @@
 		if (error) return error;
 	}
 	PRIV(dev)->vcc = vcc;
-	bind_vcc(vcc,&atmtcp_control_dev);
+	vcc->dev = &atmtcp_control_dev;
+	vcc_insert_socket(vcc->sk);
 	set_bit(ATM_VF_META,&vcc->flags);
 	set_bit(ATM_VF_READY,&vcc->flags);
 	vcc->dev_data = dev;
@@ -402,7 +415,7 @@
 	dev = atm_dev_lookup(itf);
 	if (!dev) return -ENODEV;
 	if (dev->ops != &atmtcp_v_dev_ops) {
-		atm_dev_release(dev);
+		atm_dev_put(dev);
 		return -EMEDIUMTYPE;
 	}
 	dev_data = PRIV(dev);
@@ -410,7 +423,7 @@
 	dev_data->persist = 0;
 	if (PRIV(dev)->vcc) return 0;
 	kfree(dev_data);
-	atm_dev_release(dev);
+	atm_dev_put(dev);
 	shutdown_atm_dev(dev);
 	return 0;
 }
diff -urN linux-2.4.23-pre7/drivers/atm/eni.c linux-2.4.23-pre8/drivers/atm/eni.c
--- linux-2.4.23-pre7/drivers/atm/eni.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/atm/eni.c	2003-10-23 03:33:17.000000000 -0700
@@ -1887,10 +1887,10 @@
 
 static int get_ci(struct atm_vcc *vcc,short *vpi,int *vci)
 {
-	unsigned long flags;
+	struct sock *s;
 	struct atm_vcc *walk;
 
-	spin_lock_irqsave(&vcc->dev->lock, flags);
+	read_lock(&vcc_sklist_lock);
 	if (*vpi == ATM_VPI_ANY) *vpi = 0;
 	if (*vci == ATM_VCI_ANY) {
 		for (*vci = ATM_NOT_RSV_VCI; *vci < NR_VCI; (*vci)++) {
@@ -1898,40 +1898,47 @@
 			    ENI_DEV(vcc->dev)->rx_map[*vci])
 				continue;
 			if (vcc->qos.txtp.traffic_class != ATM_NONE) {
-				for (walk = vcc->dev->vccs; walk;
-				    walk = walk->next)
+				for (s = vcc_sklist; s; s = s->next) {
+					walk = s->protinfo.af_atm;
+					if (walk->dev != vcc->dev)
+						continue;
 					if (test_bit(ATM_VF_ADDR,&walk->flags)
 					    && walk->vci == *vci &&
 					    walk->qos.txtp.traffic_class !=
 					    ATM_NONE)
 						break;
-				if (walk) continue;
+				}
+				if (s) continue;
 			}
 			break;
 		}
-		spin_unlock_irqrestore(&vcc->dev->lock, flags);
+		read_unlock(&vcc_sklist_lock);
 		return *vci == NR_VCI ? -EADDRINUSE : 0;
 	}
 	if (*vci == ATM_VCI_UNSPEC) {
-		spin_unlock_irqrestore(&vcc->dev->lock, flags);
+		read_unlock(&vcc_sklist_lock);
 		return 0;
 	}
 	if (vcc->qos.rxtp.traffic_class != ATM_NONE &&
 	    ENI_DEV(vcc->dev)->rx_map[*vci]) {
-		spin_unlock_irqrestore(&vcc->dev->lock, flags);
+		read_unlock(&vcc_sklist_lock);
 		return -EADDRINUSE;
 	}
 	if (vcc->qos.txtp.traffic_class == ATM_NONE) {
-		spin_unlock_irqrestore(&vcc->dev->lock, flags);
+		read_unlock(&vcc_sklist_lock);
 		return 0;
 	}
-	for (walk = vcc->dev->vccs; walk; walk = walk->next)
+	for (s = vcc_sklist; s; s = s->next) {
+		walk = s->protinfo.af_atm;
+		if (walk->dev != vcc->dev)
+			continue;
 		if (test_bit(ATM_VF_ADDR,&walk->flags) && walk->vci == *vci &&
 		    walk->qos.txtp.traffic_class != ATM_NONE) {
-			spin_unlock_irqrestore(&vcc->dev->lock, flags);
+			read_unlock(&vcc_sklist_lock);
 			return -EADDRINUSE;
 		}
-	spin_unlock_irqrestore(&vcc->dev->lock, flags);
+	}
+	read_unlock(&vcc_sklist_lock);
 	return 0;
 }
 
@@ -2139,7 +2146,7 @@
 
 static int eni_proc_read(struct atm_dev *dev,loff_t *pos,char *page)
 {
-	unsigned long flags;
+	struct sock *s;
 	static const char *signal[] = { "LOST","unknown","okay" };
 	struct eni_dev *eni_dev = ENI_DEV(dev);
 	struct atm_vcc *vcc;
@@ -2212,11 +2219,15 @@
 		return sprintf(page,"%10sbacklog %u packets\n","",
 		    skb_queue_len(&tx->backlog));
 	}
-	spin_lock_irqsave(&dev->lock, flags);
-	for (vcc = dev->vccs; vcc; vcc = vcc->next) {
-		struct eni_vcc *eni_vcc = ENI_VCC(vcc);
+	read_lock(&vcc_sklist_lock);
+	for (s = vcc_sklist; s; s = s->next) {
+		struct eni_vcc *eni_vcc;
 		int length;
 
+		vcc = s->protinfo.af_atm;
+		if (vcc->dev != dev)
+			continue;
+		eni_vcc = ENI_VCC(vcc);
 		if (--left) continue;
 		length = sprintf(page,"vcc %4d: ",vcc->vci);
 		if (eni_vcc->rx) {
@@ -2231,10 +2242,10 @@
 			length += sprintf(page+length,"tx[%d], txing %d bytes",
 			    eni_vcc->tx->index,eni_vcc->txing);
 		page[length] = '\n';
-		spin_unlock_irqrestore(&dev->lock, flags);
+		read_unlock(&vcc_sklist_lock);
 		return length+1;
 	}
-	spin_unlock_irqrestore(&dev->lock, flags);
+	read_unlock(&vcc_sklist_lock);
 	for (i = 0; i < eni_dev->free_len; i++) {
 		struct eni_free *fe = eni_dev->free_list+i;
 		unsigned long offset;
diff -urN linux-2.4.23-pre7/drivers/atm/fore200e.c linux-2.4.23-pre8/drivers/atm/fore200e.c
--- linux-2.4.23-pre7/drivers/atm/fore200e.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/atm/fore200e.c	2003-10-23 03:33:17.000000000 -0700
@@ -1077,18 +1077,22 @@
 static struct atm_vcc* 
 fore200e_find_vcc(struct fore200e* fore200e, struct rpd* rpd)
 {
-    unsigned long flags;
+    struct sock *s;
     struct atm_vcc* vcc;
 
-    spin_lock_irqsave(&fore200e->atm_dev->lock, flags);
-    for (vcc = fore200e->atm_dev->vccs; vcc; vcc = vcc->next) {
-
-	if (vcc->vpi == rpd->atm_header.vpi && vcc->vci == rpd->atm_header.vci)
-	    break;
+    read_lock(&vcc_sklist_lock);
+    for(s = vcc_sklist; s; s = s->next) {
+	vcc = s->protinfo.af_atm;
+	if (vcc->dev != fore200e->atm_dev)
+		continue;
+	if (vcc->vpi == rpd->atm_header.vpi && vcc->vci == rpd->atm_header.vci) {
+            read_unlock(&vcc_sklist_lock);
+	    return vcc;
+	}
     }
-    spin_unlock_irqrestore(&fore200e->atm_dev->lock, flags);
-    
-    return vcc;
+    read_unlock(&vcc_sklist_lock);
+
+    return NULL;
 }
 
 
@@ -1357,20 +1361,23 @@
 static int
 fore200e_walk_vccs(struct atm_vcc *vcc, short *vpi, int *vci)
 {
-    unsigned long flags;
     struct atm_vcc* walk;
+    struct sock *s;
 
     /* find a free VPI */
 
-    spin_lock_irqsave(&vcc->dev->lock, flags);
+    read_lock(&vcc_sklist_lock);
 
     if (*vpi == ATM_VPI_ANY) {
 
-	for (*vpi = 0, walk = vcc->dev->vccs; walk; walk = walk->next) {
+	for (*vpi = 0, s = vcc_sklist; s; s = s->next) {
+	    walk = s->protinfo.af_atm;
+	    if (walk->dev != vcc->dev)
+		continue;
 
 	    if ((walk->vci == *vci) && (walk->vpi == *vpi)) {
 		(*vpi)++;
-		walk = vcc->dev->vccs;
+		s = vcc_sklist;
 	    }
 	}
     }
@@ -1378,16 +1385,19 @@
     /* find a free VCI */
     if (*vci == ATM_VCI_ANY) {
 	
-	for (*vci = ATM_NOT_RSV_VCI, walk = vcc->dev->vccs; walk; walk = walk->next) {
+	for (*vci = ATM_NOT_RSV_VCI, s = vcc_sklist; s; s = s->next) {
+	    walk = s->protinfo.af_atm;
+	    if (walk->dev != vcc->dev)
+		continue;
 
 	    if ((walk->vpi = *vpi) && (walk->vci == *vci)) {
 		*vci = walk->vci + 1;
-		walk = vcc->dev->vccs;
+		s = vcc_sklist;
 	    }
 	}
     }
 
-    spin_unlock_irqrestore(&vcc->dev->lock, flags);
+    read_unlock(&vcc_sklist_lock);
 
     return 0;
 }
@@ -2649,7 +2659,7 @@
 static int
 fore200e_proc_read(struct atm_dev *dev,loff_t* pos,char* page)
 {
-    unsigned long flags;
+    struct sock *s;
     struct fore200e* fore200e  = FORE200E_DEV(dev);
     int              len, left = *pos;
 
@@ -2896,8 +2906,12 @@
 	len = sprintf(page,"\n"    
 		      " VCCs:\n  address\tVPI.VCI:AAL\t(min/max tx PDU size) (min/max rx PDU size)\n");
 	
-	spin_lock_irqsave(&fore200e->atm_dev->lock, flags);
-	for (vcc = fore200e->atm_dev->vccs; vcc; vcc = vcc->next) {
+	read_lock(&vcc_sklist_lock);
+	for (s = vcc_sklist; s; s = s->next) {
+	    vcc = s->protinfo.af_atm;
+
+	    if (vcc->dev != fore200e->atm_dev)
+		    continue;
 
 	    fore200e_vcc = FORE200E_VCC(vcc);
 	    
@@ -2911,7 +2925,7 @@
 			   fore200e_vcc->rx_max_pdu
 		);
 	}
-	spin_unlock_irqrestore(&fore200e->atm_dev->lock, flags);
+	read_unlock(&vcc_sklist_lock);
 
 	return len;
     }
diff -urN linux-2.4.23-pre7/drivers/atm/he.c linux-2.4.23-pre8/drivers/atm/he.c
--- linux-2.4.23-pre7/drivers/atm/he.c	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/atm/he.c	2003-10-23 03:33:17.000000000 -0700
@@ -323,25 +323,25 @@
 		he_writel_rcm(dev, val, 0x00000 | (cid << 3) | 7)
 
 static __inline__ struct atm_vcc*
-he_find_vcc(struct he_dev *he_dev, unsigned cid)
+__find_vcc(struct he_dev *he_dev, unsigned cid)
 {
-	unsigned long flags;
 	struct atm_vcc *vcc;
+	struct sock *s;
 	short vpi;
 	int vci;
 
 	vpi = cid >> he_dev->vcibits;
 	vci = cid & ((1 << he_dev->vcibits) - 1);
 
-	spin_lock_irqsave(&he_dev->atm_dev->lock, flags);
-	for (vcc = he_dev->atm_dev->vccs; vcc; vcc = vcc->next)
-		if (vcc->vci == vci && vcc->vpi == vpi
-			&& vcc->qos.rxtp.traffic_class != ATM_NONE) {
-				spin_unlock_irqrestore(&he_dev->atm_dev->lock, flags);
-				return vcc;
-			}
+	for (s = vcc_sklist; s; s = s->next) {
+		vcc = s->protinfo.af_atm;
+		if (vcc->vci == vci && vcc->vpi == vpi &&
+		    vcc->dev == he_dev->atm_dev &&
+		    vcc->qos.rxtp.traffic_class != ATM_NONE) {
+			return vcc;
+		}
+	}
 
-	spin_unlock_irqrestore(&he_dev->atm_dev->lock, flags);
 	return NULL;
 }
 
@@ -1777,6 +1777,7 @@
 	int pdus_assembled = 0;
 	int updated = 0;
 
+	read_lock(&vcc_sklist_lock);
 	while (he_dev->rbrq_head != rbrq_tail) {
 		++updated;
 
@@ -1803,7 +1804,7 @@
 		cid = RBRQ_CID(he_dev->rbrq_head);
 
 		if (cid != lastcid)
-			vcc = he_find_vcc(he_dev, cid);
+			vcc = __find_vcc(he_dev, cid);
 		lastcid = cid;
 
 		if (vcc == NULL) {
@@ -1942,6 +1943,7 @@
 					RBRQ_MASK(++he_dev->rbrq_head));
 
 	}
+	read_unlock(&vcc_sklist_lock);
 
 	if (updated) {
 		if (updated > he_dev->rbrq_peak)
diff -urN linux-2.4.23-pre7/drivers/atm/idt77252.c linux-2.4.23-pre8/drivers/atm/idt77252.c
--- linux-2.4.23-pre7/drivers/atm/idt77252.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/atm/idt77252.c	2003-10-23 03:33:17.000000000 -0700
@@ -2404,37 +2404,43 @@
 static int
 idt77252_find_vcc(struct atm_vcc *vcc, short *vpi, int *vci)
 {
-	unsigned long flags;
+	struct sock *s;
 	struct atm_vcc *walk;
 
-	spin_lock_irqsave(&vcc->dev->lock, flags);
+	read_lock(&vcc_sklist_lock);
 	if (*vpi == ATM_VPI_ANY) {
 		*vpi = 0;
-		walk = vcc->dev->vccs;
-		while (walk) {
+		s = vcc_sklist;
+		while (s) {
+			walk = s->protinfo.af_atm;
+			if (walk->dev != vcc->dev)
+				continue;
 			if ((walk->vci == *vci) && (walk->vpi == *vpi)) {
 				(*vpi)++;
-				walk = vcc->dev->vccs;
+				s = vcc_sklist;
 				continue;
 			}
-			walk = walk->next;
+			s = s->next;
 		}
 	}
 
 	if (*vci == ATM_VCI_ANY) {
 		*vci = ATM_NOT_RSV_VCI;
-		walk = vcc->dev->vccs;
-		while (walk) {
+		s = vcc_sklist;
+		while (s) {
+			walk = s->protinfo.af_atm;
+			if (walk->dev != vcc->dev)
+				continue;
 			if ((walk->vci == *vci) && (walk->vpi == *vpi)) {
 				(*vci)++;
-				walk = vcc->dev->vccs;
+				s = vcc_sklist;
 				continue;
 			}
-			walk = walk->next;
+			s = s->next;
 		}
 	}
 
-	spin_unlock_irqrestore(&vcc->dev->lock, flags);
+	read_unlock(&vcc_sklist_lock);
 	return 0;
 }
 
diff -urN linux-2.4.23-pre7/drivers/char/sh-sci.h linux-2.4.23-pre8/drivers/char/sh-sci.h
--- linux-2.4.23-pre7/drivers/char/sh-sci.h	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/char/sh-sci.h	2003-10-23 03:33:17.000000000 -0700
@@ -432,4 +432,5 @@
 #define BPS_38400      SCBRR_VALUE(38400)
 #define BPS_57600      SCBRR_VALUE(57600)
 #define BPS_115200     SCBRR_VALUE(115200)
+#define BPS_230400     SCBRR_VALUE(230400)
 
diff -urN linux-2.4.23-pre7/drivers/char/tty_io.c linux-2.4.23-pre8/drivers/char/tty_io.c
--- linux-2.4.23-pre7/drivers/char/tty_io.c	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/char/tty_io.c	2003-10-23 03:33:17.000000000 -0700
@@ -455,8 +455,6 @@
 		redirect = NULL;
 	}
 	spin_unlock(&redirect_lock);
-	if (f)
-		fput(f);
 	
 	check_tty_count(tty, "do_tty_hangup");
 	file_list_lock();
@@ -543,6 +541,8 @@
 	} else if (tty->driver.hangup)
 		(tty->driver.hangup)(tty);
 	unlock_kernel();
+	if (f)
+		fput(f);
 }
 
 void tty_hangup(struct tty_struct * tty)
diff -urN linux-2.4.23-pre7/drivers/ide/ide-disk.c linux-2.4.23-pre8/drivers/ide/ide-disk.c
--- linux-2.4.23-pre7/drivers/ide/ide-disk.c	2003-06-13 07:51:33.000000000 -0700
+++ linux-2.4.23-pre8/drivers/ide/ide-disk.c	2003-10-23 03:33:17.000000000 -0700
@@ -1196,7 +1196,7 @@
 		drive->bios_cyl		= drive->cyl;
 		drive->capacity48	= capacity_2;
 		drive->capacity		= (unsigned long) capacity_2;
-		return;
+		goto check_capacity48;
 	/* Determine capacity, and use LBA if the drive properly supports it */
 	} else if ((id->capability & 2) && lba_capacity_is_ok(id)) {
 		capacity = id->lba_capacity;
@@ -1228,6 +1228,15 @@
 		drive->sect = 63;
 		drive->cyl = (unsigned long)(drive->capacity48) / (drive->head * drive->sect);
 	}
+
+check_capacity48:
+	/* Limit disk size to 137GB if LBA48 addressing is not supported */
+	if (drive->addressing == 0 && drive->capacity48 > (1ULL)<<28) {
+		printk("%s: cannot use LBA48 - capacity reset "
+			"from %llu to %llu\n",
+			drive->name, drive->capacity48, (1ULL)<<28);
+		drive->capacity48 = (1ULL)<<28;
+	}
 }
 
 static unsigned long idedisk_capacity (ide_drive_t *drive)
diff -urN linux-2.4.23-pre7/drivers/ide/pci/pdc202xx_old.c linux-2.4.23-pre8/drivers/ide/pci/pdc202xx_old.c
--- linux-2.4.23-pre7/drivers/ide/pci/pdc202xx_old.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre8/drivers/ide/pci/pdc202xx_old.c	2003-10-23 03:33:17.000000000 -0700
@@ -697,9 +697,6 @@
 	hwif->tuneproc  = &config_chipset_for_pio;
 	hwif->quirkproc = &pdc202xx_quirkproc;
 
-	if (hwif->pci_dev->device == PCI_DEVICE_ID_PROMISE_20265)
-		hwif->addressing = (hwif->channel) ? 0 : 1;
-
 	if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) {
 		hwif->busproc   = &pdc202xx_tristate;
 		hwif->resetproc = &pdc202xx_reset;
diff -urN linux-2.4.23-pre7/drivers/ide/pci/serverworks.c linux-2.4.23-pre8/drivers/ide/pci/serverworks.c
--- linux-2.4.23-pre7/drivers/ide/pci/serverworks.c	2003-06-13 07:51:33.000000000 -0700
+++ linux-2.4.23-pre8/drivers/ide/pci/serverworks.c	2003-10-23 03:33:17.000000000 -0700
@@ -273,7 +273,7 @@
 
 	ide_hwif_t *hwif	= HWIF(drive);
 	struct pci_dev *dev	= hwif->pci_dev;
-	u8 speed		= ide_rate_filter(svwks_ratemask(drive), xferspeed);
+	u8 speed;
 	u8 pio			= ide_get_best_pio_mode(drive, 255, 5, NULL);
 	u8 unit			= (drive->select.b.unit & 0x01);
 	u8 csb5			= svwks_csb_check(dev);
@@ -281,6 +281,11 @@
 	u8 dma_timing		= 0, pio_timing = 0;
 	u16 csb5_pio		= 0;
 
+	if (xferspeed == 255)	/* PIO auto-tuning */
+		speed = XFER_PIO_0 + pio;
+	else
+		speed = ide_rate_filter(svwks_ratemask(drive), xferspeed);
+
 	/* If we are about to put a disk into UDMA mode we screwed up.
 	   Our code assumes we never _ever_ do this on an OSB4 */
 	   
diff -urN linux-2.4.23-pre7/drivers/net/8139too.c linux-2.4.23-pre8/drivers/net/8139too.c
--- linux-2.4.23-pre7/drivers/net/8139too.c	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/net/8139too.c	2003-10-23 03:33:17.000000000 -0700
@@ -247,6 +247,8 @@
 	{0x14ea, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
 	{0x14ea, 0xab07, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
 	{0x11db, 0x1234, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
+	{0x1432, 0x9130, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
+	{0x02ac, 0x1012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
 
 #ifdef CONFIG_SH_SECUREEDGE5410
 	/* Bogus 8139 silicon reports 8129 without external PROM :-( */
diff -urN linux-2.4.23-pre7/drivers/net/b44.c linux-2.4.23-pre8/drivers/net/b44.c
--- linux-2.4.23-pre7/drivers/net/b44.c	2003-08-25 04:44:42.000000000 -0700
+++ linux-2.4.23-pre8/drivers/net/b44.c	2003-10-23 03:33:17.000000000 -0700
@@ -25,8 +25,8 @@
 
 #define DRV_MODULE_NAME		"b44"
 #define PFX DRV_MODULE_NAME	": "
-#define DRV_MODULE_VERSION	"0.9"
-#define DRV_MODULE_RELDATE	"Jul 14, 2003"
+#define DRV_MODULE_VERSION	"0.91"
+#define DRV_MODULE_RELDATE	"Oct 3, 2003"
 
 #define B44_DEF_MSG_ENABLE	  \
 	(NETIF_MSG_DRV		| \
@@ -80,16 +80,7 @@
 
 static int b44_debug = -1;	/* -1 == use B44_DEF_MSG_ENABLE as value */
 
-#ifndef PCI_DEVICE_ID_BCM4401
-#define PCI_DEVICE_ID_BCM4401      0x4401
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#define IRQ_RETVAL(x) 
-#define irqreturn_t void
-#endif
-
-static struct pci_device_id b44_pci_tbl[] __devinitdata = {
+static struct pci_device_id b44_pci_tbl[] = {
 	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4401,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
 	{ }	/* terminate list with empty entry */
@@ -870,6 +861,8 @@
 
 	spin_unlock_irq(&bp->lock);
 
+	b44_enable_ints(bp);
+
 	netif_wake_queue(dev);
 }
 
@@ -1393,7 +1386,7 @@
 		strcpy (info.driver, DRV_MODULE_NAME);
 		strcpy (info.version, DRV_MODULE_VERSION);
 		memset(&info.fw_version, 0, sizeof(info.fw_version));
-		strcpy (info.bus_info, pci_dev->slot_name);
+		strcpy (info.bus_info, pci_name(pci_dev));
 		info.eedump_len = 0;
 		info.regdump_len = 0;
 		if (copy_to_user (useraddr, &info, sizeof (info)))
@@ -1834,7 +1827,7 @@
 	iounmap((void *) bp->regs);
 
 err_out_free_dev:
-	kfree(dev);
+	free_netdev(dev);
 
 err_out_free_res:
 	pci_release_regions(pdev);
@@ -1852,7 +1845,7 @@
 	if (dev) {
 		unregister_netdev(dev);
 		iounmap((void *) ((struct b44 *)(dev->priv))->regs);
-		kfree(dev);
+		free_netdev(dev);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
 		pci_set_drvdata(pdev, NULL);
diff -urN linux-2.4.23-pre7/drivers/net/e1000/e1000_main.c linux-2.4.23-pre8/drivers/net/e1000/e1000_main.c
--- linux-2.4.23-pre7/drivers/net/e1000/e1000_main.c	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/net/e1000/e1000_main.c	2003-10-23 03:33:17.000000000 -0700
@@ -59,7 +59,7 @@
 
 char e1000_driver_name[] = "e1000";
 char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
-char e1000_driver_version[] = "5.2.16-k1";
+char e1000_driver_version[] = "5.2.16-k2";
 char e1000_copyright[] = "Copyright (c) 1999-2003 Intel Corporation.";
 
 /* e1000_pci_tbl - PCI Device ID Table
@@ -1532,6 +1532,7 @@
 	unsigned int first)
 {
 	struct e1000_desc_ring *tx_ring = &adapter->tx_ring;
+	struct e1000_tx_desc *tx_desc;
 	struct e1000_buffer *buffer_info;
 	unsigned int len = skb->len, max_per_txd = E1000_MAX_DATA_PER_TXD;
 	unsigned int offset = 0, size, count = 0, i;
@@ -1622,17 +1623,29 @@
 		}
 	}
 
-	if(E1000_DESC_UNUSED(&adapter->tx_ring) < count) {
+	if(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2) {
 
 		/* There aren't enough descriptors available to queue up
-		 * this send, so undo the mapping and abort the send. 
-		 * We could have done the check before we mapped the skb,
-		 * but because of all the workarounds (above), it's too
-		 * difficult to predict how many we're going to need.*/
-		i = first;
+		 * this send (need: count + 1 context desc + 1 desc gap
+		 * to keep tail from touching head), so undo the mapping
+		 * and abort the send.  We could have done the check before
+		 * we mapped the skb, but because of all the workarounds
+		 * (above), it's too difficult to predict how many we're
+		 * going to need.*/
+		i = adapter->tx_ring.next_to_use;
+
+		if(i == first) {
+			/* Cleanup after e1000_tx_[csum|tso] scribbling
+			 * on descriptors. */
+			tx_desc = E1000_TX_DESC(*tx_ring, first);
+			tx_desc->buffer_addr = 0;
+			tx_desc->lower.data = 0;
+			tx_desc->upper.data = 0;
+		}
 
 		while(count--) {
 			buffer_info = &tx_ring->buffer_info[i];
+
 			if(buffer_info->dma) {
 				pci_unmap_page(adapter->pdev,
 					       buffer_info->dma,
@@ -1640,9 +1653,12 @@
 					       PCI_DMA_TODEVICE);
 				buffer_info->dma = 0;
 			}
+
 			if(++i == tx_ring->count) i = 0;
 		}
 
+		adapter->tx_ring.next_to_use = first;
+
 		return 0;
 	}
 
diff -urN linux-2.4.23-pre7/drivers/net/irda/act200l.c linux-2.4.23-pre8/drivers/net/irda/act200l.c
--- linux-2.4.23-pre7/drivers/net/irda/act200l.c	2002-11-28 15:53:13.000000000 -0800
+++ linux-2.4.23-pre8/drivers/net/irda/act200l.c	2003-10-23 03:33:17.000000000 -0700
@@ -106,7 +106,7 @@
 
 static void act200l_open(dongle_t *self, struct qos_info *qos)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	/* Power on the dongle */
 	self->set_dtr_rts(self->dev, TRUE, TRUE);
@@ -120,7 +120,7 @@
 
 static void act200l_close(dongle_t *self)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	/* Power off the dongle */
 	self->set_dtr_rts(self->dev, FALSE, FALSE);
@@ -141,7 +141,7 @@
 	__u8 control[3];
 	int ret = 0;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	self->speed_task = task;
 
@@ -158,7 +158,7 @@
 		}
 		break;
 	case IRDA_TASK_CHILD_WAIT:
-		WARNING(__FUNCTION__ "(), resetting dongle timed out!\n");
+		WARNING("%s(), resetting dongle timed out!\n", __FUNCTION__);
 		ret = -1;
 		break;
 	case IRDA_TASK_CHILD_DONE:
@@ -203,7 +203,7 @@
 		self->speed_task = NULL;
 		break;
 	default:
-		ERROR(__FUNCTION__ "(), unknown state %d\n", task->state);
+		ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
 		irda_task_next_state(task, IRDA_TASK_DONE);
 		self->speed_task = NULL;
 		ret = -1;
@@ -233,7 +233,7 @@
 	};
 	int ret = 0;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	self->reset_task = task;
 
@@ -269,7 +269,7 @@
 		self->reset_task = NULL;
 		break;
 	default:
-		ERROR(__FUNCTION__ "(), unknown state %d\n", task->state);
+		ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
 		irda_task_next_state(task, IRDA_TASK_DONE);
 		self->reset_task = NULL;
 		ret = -1;
diff -urN linux-2.4.23-pre7/drivers/net/irda/irda-usb.c linux-2.4.23-pre8/drivers/net/irda/irda-usb.c
--- linux-2.4.23-pre7/drivers/net/irda/irda-usb.c	2003-08-25 04:44:42.000000000 -0700
+++ linux-2.4.23-pre8/drivers/net/irda/irda-usb.c	2003-10-23 03:33:17.000000000 -0700
@@ -339,7 +339,7 @@
 	int res, mtt;
 	int	err = 1;	/* Failed */
 
-	IRDA_DEBUG(4, __FUNCTION__ "() on %s\n", netdev->name);
+	IRDA_DEBUG(4, "%s() on %s\n",  __FUNCTION__, netdev->name);
 
 	netif_stop_queue(netdev);
 
@@ -542,7 +542,7 @@
 		    (self->new_xbofs != self->xbofs)) {
 			/* We haven't changed speed yet (because of
 			 * IUC_SPEED_BUG), so do it now - Jean II */
-			IRDA_DEBUG(1, __FUNCTION__ "(), Changing speed now...\n");
+			IRDA_DEBUG(1, "%s(), Changing speed now...\n", __FUNCTION__);
 			irda_usb_change_speed_xbofs(self);
 		} else {
 			/* New speed and xbof is now commited in hardware */
diff -urN linux-2.4.23-pre7/drivers/net/irda/ma600.c linux-2.4.23-pre8/drivers/net/irda/ma600.c
--- linux-2.4.23-pre7/drivers/net/irda/ma600.c	2003-08-25 04:44:42.000000000 -0700
+++ linux-2.4.23-pre8/drivers/net/irda/ma600.c	2003-10-23 03:33:17.000000000 -0700
@@ -86,13 +86,13 @@
 
 int __init ma600_init(void)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	return irda_device_register_dongle(&dongle);
 }
 
 void __exit ma600_cleanup(void)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	irda_device_unregister_dongle(&dongle);
 }
 
@@ -105,7 +105,7 @@
 */
 static void ma600_open(dongle_t *self, struct qos_info *qos)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	qos->baud_rate.bits &= IR_2400|IR_9600|IR_19200|IR_38400
 				|IR_57600|IR_115200;
@@ -123,7 +123,7 @@
 
 static void ma600_close(dongle_t *self)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	/* Power off dongle */
 	self->set_dtr_rts(self->dev, FALSE, FALSE);
@@ -184,12 +184,12 @@
 	__u8 byte_echo;
 	int ret = 0;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(task != NULL, return -1;);
 
 	if (self->speed_task && self->speed_task != task) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), busy!\n");
+		IRDA_DEBUG(0, "%s(), busy!\n", __FUNCTION__);
 		return MSECS_TO_JIFFIES(10);
 	} else {
 		self->speed_task = task;
@@ -215,7 +215,7 @@
 		break;
 
 	case IRDA_TASK_CHILD_WAIT:
-		WARNING(__FUNCTION__ "(), resetting dongle timed out!\n");
+		WARNING("%s(), resetting dongle timed out!\n", __FUNCTION__);
 		ret = -1;
 		break;
 
@@ -246,7 +246,7 @@
 
 		if(byte != byte_echo) {
 			/* if control byte != echo, I don't know what to do */
-			printk(KERN_WARNING __FUNCTION__ "() control byte written != read!\n");
+			printk(KERN_WARNING "%s() control byte written != read!\n", __FUNCTION__);
 			printk(KERN_WARNING "control byte = 0x%c%c\n", 
 			       hexTbl[(byte>>4)&0x0f], hexTbl[byte&0x0f]);
 			printk(KERN_WARNING "byte echo = 0x%c%c\n", 
@@ -254,7 +254,7 @@
 			       hexTbl[byte_echo & 0x0f]);
 		#ifndef NDEBUG
 		} else {
-			IRDA_DEBUG(2, __FUNCTION__ "() control byte write read OK\n");
+			IRDA_DEBUG(2, "%s() control byte write read OK\n", __FUNCTION__);
 		#endif
 		}
 
@@ -273,7 +273,7 @@
 		break;
 
 	default:
-		ERROR(__FUNCTION__ "(), unknown state %d\n", task->state);
+		ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
 		irda_task_next_state(task, IRDA_TASK_DONE);
 		self->speed_task = NULL;
 		ret = -1;
@@ -298,12 +298,12 @@
 	dongle_t *self = (dongle_t *) task->instance;
 	int ret = 0;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n",  __FUNCTION__);
 
 	ASSERT(task != NULL, return -1;);
 
 	if (self->reset_task && self->reset_task != task) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), busy!\n");
+		IRDA_DEBUG(0, "%s(), busy!\n", __FUNCTION__);
 		return MSECS_TO_JIFFIES(10);
 	} else
 		self->reset_task = task;
@@ -326,7 +326,7 @@
 		self->reset_task = NULL;
 		break;
 	default:
-		ERROR(__FUNCTION__ "(), unknown state %d\n", task->state);
+		ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
 		irda_task_next_state(task, IRDA_TASK_DONE);		
 		self->reset_task = NULL;
 		ret = -1;
diff -urN linux-2.4.23-pre7/drivers/net/irda/mcp2120.c linux-2.4.23-pre8/drivers/net/irda/mcp2120.c
--- linux-2.4.23-pre7/drivers/net/irda/mcp2120.c	2002-11-28 15:53:13.000000000 -0800
+++ linux-2.4.23-pre8/drivers/net/irda/mcp2120.c	2003-10-23 03:33:17.000000000 -0700
@@ -110,7 +110,7 @@
 		}
 		break;
 	case IRDA_TASK_CHILD_WAIT:
-		WARNING(__FUNCTION__ "(), resetting dongle timed out!\n");
+		WARNING("%s(), resetting dongle timed out!\n", __FUNCTION__);
 		ret = -1;
 		break;
 	case IRDA_TASK_CHILD_DONE:
@@ -158,7 +158,7 @@
                 //printk("mcp2120_change_speed irda_task_wait\n");
 		break;
 	default:
-		ERROR(__FUNCTION__ "(), unknown state %d\n", task->state);
+		ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
 		irda_task_next_state(task, IRDA_TASK_DONE);
 		self->speed_task = NULL;
 		ret = -1;
@@ -213,7 +213,7 @@
 		self->reset_task = NULL;
 		break;
 	default:
-		ERROR(__FUNCTION__ "(), unknown state %d\n", task->state);
+		ERROR("%s(), unknown state %d\n", __FUNCTION__ , task->state);
 		irda_task_next_state(task, IRDA_TASK_DONE);
 		self->reset_task = NULL;
 		ret = -1;
diff -urN linux-2.4.23-pre7/drivers/net/irda/nsc-ircc.c linux-2.4.23-pre8/drivers/net/irda/nsc-ircc.c
--- linux-2.4.23-pre7/drivers/net/irda/nsc-ircc.c	2002-11-28 15:53:13.000000000 -0800
+++ linux-2.4.23-pre8/drivers/net/irda/nsc-ircc.c	2003-10-23 03:33:17.000000000 -0700
@@ -700,7 +700,7 @@
 	switch_bank(iobase, BANK3);
 	version = inb(iobase+MID);
 
-	IRDA_DEBUG(2, __FUNCTION__  "() Driver %s Found chip version %02x\n",
+	IRDA_DEBUG(2, "%s() Driver %s Found chip version %02x\n", __FUNCTION__,
 		   driver_name, version);
 
 	/* Should be 0x2? */
diff -urN linux-2.4.23-pre7/drivers/net/natsemi.c linux-2.4.23-pre8/drivers/net/natsemi.c
--- linux-2.4.23-pre7/drivers/net/natsemi.c	2002-11-28 15:53:14.000000000 -0800
+++ linux-2.4.23-pre8/drivers/net/natsemi.c	2003-10-23 03:33:17.000000000 -0700
@@ -1528,7 +1528,7 @@
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		if (np->tx_skbuff[i]) {
 			pci_unmap_single(np->pci_dev,
-				np->rx_dma[i], np->rx_skbuff[i]->len,
+				np->tx_dma[i], np->tx_skbuff[i]->len,
 				PCI_DMA_TODEVICE);
 			dev_kfree_skb(np->tx_skbuff[i]);
 			np->stats.tx_dropped++;
diff -urN linux-2.4.23-pre7/drivers/net/pcmcia/xircom_cb.c linux-2.4.23-pre8/drivers/net/pcmcia/xircom_cb.c
--- linux-2.4.23-pre7/drivers/net/pcmcia/xircom_cb.c	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/net/pcmcia/xircom_cb.c	2003-10-23 03:33:17.000000000 -0700
@@ -14,10 +14,8 @@
  * 	$Id: xircom_cb.c,v 1.33 2001/03/19 14:02:07 arjanv Exp $
  */
 
-
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
@@ -30,12 +28,11 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/ethtool.h>
+
 #include <asm/uaccess.h>
 #include <asm/bitops.h>
 #include <asm/io.h>
 
-
-
 #ifdef DEBUG
 #define enter(x)   printk("Enter: %s, %s line %i\n",x,__FILE__,__LINE__)
 #define leave(x)   printk("Leave: %s, %s line %i\n",x,__FILE__,__LINE__)
@@ -114,7 +111,7 @@
 /* Function prototypes */
 static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id);
 static void xircom_remove(struct pci_dev *pdev);
-static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static int xircom_open(struct net_device *dev);
 static int xircom_close(struct net_device *dev);
@@ -124,7 +121,7 @@
 static void investigate_read_descriptor(struct net_device *dev,struct xircom_private *card, int descnr, unsigned int bufferoffset);
 static void investigate_write_descriptor(struct net_device *dev, struct xircom_private *card, int descnr, unsigned int bufferoffset);
 static void read_mac_address(struct xircom_private *card);
-static void tranceiver_voodoo(struct xircom_private *card);
+static void transceiver_voodoo(struct xircom_private *card);
 static void initialize_card(struct xircom_private *card);
 static void trigger_transmit(struct xircom_private *card);
 static void trigger_receive(struct xircom_private *card);
@@ -143,17 +140,19 @@
 
 
 
-static struct pci_device_id xircom_pci_table[] __devinitdata = {
+static struct pci_device_id xircom_pci_table[] = {
 	{0x115D, 0x0003, PCI_ANY_ID, PCI_ANY_ID,},
 	{0,},
 };
 MODULE_DEVICE_TABLE(pci, xircom_pci_table);
 
 static struct pci_driver xircom_ops = {
-	name:		"xircom_cb", 
-	id_table:	xircom_pci_table, 
-	probe:		xircom_probe, 
-	remove:		__devexit_p(xircom_remove),
+	.name		= "xircom_cb", 
+	.id_table	= xircom_pci_table, 
+	.probe		= xircom_probe, 
+	.remove		= xircom_remove, 
+	.suspend =NULL,
+	.resume =NULL
 };
 
 
@@ -226,40 +225,32 @@
 		return -ENODEV;
 	}
 
-	
 	/* 
 	   Before changing the hardware, allocate the memory.
 	   This way, we can fail gracefully if not enough memory
 	   is available. 
 	 */
-	private = kmalloc(sizeof(*private),GFP_KERNEL);
-	memset(private, 0, sizeof(struct xircom_private));
+	dev = alloc_etherdev(sizeof(struct xircom_private));
+	if (!dev) {
+		printk(KERN_ERR "xircom_probe: failed to allocate etherdev\n");
+		goto device_fail;
+	}
+	private = dev->priv;
 	
 	/* Allocate the send/receive buffers */
 	private->rx_buffer = pci_alloc_consistent(pdev,8192,&private->rx_dma_handle);
-	
 	if (private->rx_buffer == NULL) {
  		printk(KERN_ERR "xircom_probe: no memory for rx buffer \n");
- 		kfree(private);
-		return -ENODEV;
+		goto rx_buf_fail;
 	}	
 	private->tx_buffer = pci_alloc_consistent(pdev,8192,&private->tx_dma_handle);
 	if (private->tx_buffer == NULL) {
 		printk(KERN_ERR "xircom_probe: no memory for tx buffer \n");
-		kfree(private->rx_buffer);
-		kfree(private);
-		return -ENODEV;
-	}
-	dev = init_etherdev(dev, 0);
-	if (dev == NULL) {
-		printk(KERN_ERR "xircom_probe: failed to allocate etherdev\n");
-		kfree(private->rx_buffer);
-		kfree(private->tx_buffer);
-		kfree(private);
-		return -ENODEV;
+		goto tx_buf_fail;
 	}
+
 	SET_MODULE_OWNER(dev);
-	printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq);
+
 
 	private->dev = dev;
 	private->pdev = pdev;
@@ -267,11 +258,11 @@
 	private->lock = SPIN_LOCK_UNLOCKED;
 	dev->irq = pdev->irq;
 	dev->base_addr = private->io_port;
-
+	
 	initialize_card(private);
 	read_mac_address(private);
 	setup_descriptors(private);
-
+	
 	dev->open = &xircom_open;
 	dev->hard_start_xmit = &xircom_start_xmit;
 	dev->stop = &xircom_close;
@@ -280,19 +271,34 @@
 	SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
 	pci_set_drvdata(pdev, dev);
 
+	if (register_netdev(dev)) {
+		printk(KERN_ERR "xircom_probe: netdevice registration failed.\n");
+		goto reg_fail;
+	}
+		
+	printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq);
 	/* start the transmitter to get a heartbeat */
 	/* TODO: send 2 dummy packets here */
-	tranceiver_voodoo(private);
-
+	transceiver_voodoo(private);
+	
 	spin_lock_irqsave(&private->lock,flags);
-	  activate_transmitter(private);
-	  activate_receiver(private);
+	activate_transmitter(private);
+	activate_receiver(private);
 	spin_unlock_irqrestore(&private->lock,flags);
-
+	
 	trigger_receive(private);
-
+	
 	leave("xircom_probe");
 	return 0;
+
+reg_fail:
+	kfree(private->tx_buffer);
+tx_buf_fail:
+	kfree(private->rx_buffer);
+rx_buf_fail:
+	free_netdev(dev);
+device_fail:
+	return -ENODEV;
 }
 
 
@@ -305,27 +311,20 @@
 static void __devexit xircom_remove(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct xircom_private *card;
+	struct xircom_private *card = dev->priv;
+
 	enter("xircom_remove");
-	if (dev!=NULL) {
-		card=dev->priv;
-		if (card!=NULL) {	
-			if (card->rx_buffer!=NULL)
-				pci_free_consistent(pdev,8192,card->rx_buffer,card->rx_dma_handle);
-			card->rx_buffer = NULL;
-			if (card->tx_buffer!=NULL)
-				pci_free_consistent(pdev,8192,card->tx_buffer,card->tx_dma_handle);
-			card->tx_buffer = NULL;			
-		}
-		kfree(card);
-	}
+	pci_free_consistent(pdev,8192,card->rx_buffer,card->rx_dma_handle);
+	pci_free_consistent(pdev,8192,card->tx_buffer,card->tx_dma_handle);
+
 	release_region(dev->base_addr, 128);
 	unregister_netdev(dev);
-	kfree(dev);
+	free_netdev(dev);
+	pci_set_drvdata(pdev, NULL);
 	leave("xircom_remove");
 } 
 
-static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_instance;
 	struct xircom_private *card = (struct xircom_private *) dev->priv;
@@ -369,6 +368,7 @@
 	
 	spin_unlock(&card->lock);
 	leave("xircom_interrupt");
+	return IRQ_HANDLED;
 }
 
 static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -1022,7 +1022,7 @@
 
 
 /* 
-link_status() checks the link's status and will return 0 for no link, 10 for 10mbit link and 100 for.. guess what.
+link_status() checks the the links status and will return 0 for no link, 10 for 10mbit link and 100 for.. guess what.
 
 Must be called in locked state with interrupts disabled
 */
@@ -1097,15 +1097,15 @@
 
 
 /*
- tranceiver_voodoo() enables the external UTP plug thingy.
+ transceiver_voodoo() enables the external UTP plug thingy.
  it's called voodoo as I stole this code and cannot cross-reference
  it with the specification.
  */
-static void tranceiver_voodoo(struct xircom_private *card)
+static void transceiver_voodoo(struct xircom_private *card)
 {
 	unsigned long flags;
 
-	enter("tranceiver_voodoo");
+	enter("transceiver_voodoo");
 
 	/* disable all powermanagement */
 	pci_write_config_dword(card->pdev, PCI_POWERMGMT, 0x0000);
@@ -1124,7 +1124,7 @@
         spin_unlock_irqrestore(&card->lock, flags);
 
 	netif_start_queue(card->dev);
-	leave("tranceiver_voodoo");
+	leave("transceiver_voodoo");
 }
 
 
diff -urN linux-2.4.23-pre7/drivers/net/sk98lin/h/skversion.h linux-2.4.23-pre8/drivers/net/sk98lin/h/skversion.h
--- linux-2.4.23-pre7/drivers/net/sk98lin/h/skversion.h	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/net/sk98lin/h/skversion.h	2003-10-23 03:33:17.000000000 -0700
@@ -2,8 +2,8 @@
  *
  * Name:	version.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.2 $
- * Date:	$Date: 2003/08/13 12:01:01 $
+ * Version:	$Revision: 1.3 $
+ * Date:	$Date: 2003/08/25 13:34:48 $
  * Purpose:	SK specific Error log support
  *
  ******************************************************************************/
@@ -25,6 +25,9 @@
  *
  * History:
  *	$Log: skversion.h,v $
+ *	Revision 1.3  2003/08/25 13:34:48  mlindner
+ *	Fix: Lint changes
+ *	
  *	Revision 1.2  2003/08/13 12:01:01  mlindner
  *	Add: Changes for Lint
  *	
@@ -51,12 +54,12 @@
 #ifdef	lint
 static const char SysKonnectFileId[] = "@(#) (C) SysKonnect GmbH.";
 static const char SysKonnectBuildNumber[] =
-	"@(#)SK-BUILD: 6.17 PL: 01"; 
+	"@(#)SK-BUILD: 6.18 PL: 01"; 
 #endif	/* !defined(lint) */
 
-#define BOOT_STRING	"sk98lin: Network Device Driver v6.17\n" \
+#define BOOT_STRING	"sk98lin: Network Device Driver v6.18\n" \
 			"(C)Copyright 1999-2003 Marvell(R)."
 
-#define VER_STRING	"6.17"
+#define VER_STRING	"6.18"
 
 
diff -urN linux-2.4.23-pre7/drivers/net/sk98lin/skge.c linux-2.4.23-pre8/drivers/net/sk98lin/skge.c
--- linux-2.4.23-pre7/drivers/net/sk98lin/skge.c	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/net/sk98lin/skge.c	2003-10-23 03:33:17.000000000 -0700
@@ -56,6 +56,18 @@
  * History:
  *
  *	$Log: skge.c,v $
+ *	Revision 1.16  2003/09/23 11:07:35  mlindner
+ *	Fix: IO-control return race condition
+ *	Fix: Interrupt moderation value check
+ *	
+ *	Revision 1.15  2003/09/22 08:40:05  mlindner
+ *	Add: Added DRIVER_FILE_NAME and DRIVER_REL_DATE
+ *	
+ *	Revision 1.14  2003/09/22 08:11:10  mlindner
+ *	Add: New function for PCI initialization (SkGeInitPCI)
+ *	Add: Yukon Plus changes (ChipID, PCI...)
+ *	Fix: TCP and UDP Checksum calculation
+ *	
  *	Revision 1.11  2003/08/26 16:05:19  mlindner
  *	Fix: Compiler warnings (void *)
  *	
@@ -551,6 +563,7 @@
 static int	SkGeChangeMtu(struct SK_NET_DEVICE *dev, int new_mtu);
 static void	PortReInitBmu(SK_AC*, int);
 static int	SkGeIocMib(DEV_NET*, unsigned int, int);
+static int	SkGeInitPCI(SK_AC *pAC);
 static void	StartDrvCleanupTimer(SK_AC *pAC);
 static void	StopDrvCleanupTimer(SK_AC *pAC);
 static int	XmitFrameSG(SK_AC*, TX_PORT*, struct sk_buff*);
@@ -620,10 +633,10 @@
 	SK_AC			*pAC;
 	DEV_NET			*pNet = NULL;
 	struct pci_dev	*pdev = NULL;
-	unsigned long		base_address;
 	struct SK_NET_DEVICE *dev = NULL;
 	SK_BOOL DeviceFound = SK_FALSE;
 	SK_BOOL BootStringCount = SK_FALSE;
+	int			retval;
 #ifdef CONFIG_PROC_FS
 	int			proc_root_initialized = 0;
 	struct proc_dir_entry	*pProcFile;
@@ -668,6 +681,8 @@
 		pNet = dev->priv;
 		pNet->pAC = kmalloc(sizeof(SK_AC), GFP_KERNEL);
 		if (pNet->pAC == NULL){
+			dev->get_stats = NULL;
+			unregister_netdev(dev);
 			kfree(dev->priv);
 			printk(KERN_ERR "Unable to allocate adapter "
 			       "structure!\n");
@@ -694,6 +709,14 @@
 		pNet->Mtu = 1500;
 		pNet->Up = 0;
 		dev->irq = pdev->irq;
+		retval = SkGeInitPCI(pAC);
+		if (retval) {
+			printk("SKGE: PCI setup failed: %i\n", retval);
+			dev->get_stats = NULL;
+			unregister_netdev(dev);
+			kfree(dev);
+			continue;
+		}
 
 		dev->open =		&SkGeOpen;
 		dev->stop =		&SkGeClose;
@@ -716,41 +739,6 @@
 #endif
 #endif
 
-		/*
-		 * Dummy value.
-		 */
-		dev->base_addr = 42;
-		pci_set_master(pdev);
-
-		pci_set_master(pdev);
-		base_address = pci_resource_start (pdev, 0);
-
-#ifdef SK_BIG_ENDIAN
-		/*
-		 * On big endian machines, we use the adapter's aibility of
-		 * reading the descriptors as big endian.
-		 */
-		{
-		SK_U32		our2;
-			SkPciReadCfgDWord(pAC, PCI_OUR_REG_2, &our2);
-			our2 |= PCI_REV_DESC;
-			SkPciWriteCfgDWord(pAC, PCI_OUR_REG_2, our2);
-		}
-#endif
-
-		/*
-		 * Remap the regs into kernel space.
-		 */
-		pAC->IoBase = (char*)ioremap(base_address, 0x4000);
-
-		if (!pAC->IoBase){
-			printk(KERN_ERR "%s:  Unable to map I/O register, "
-			       "SK 98xx No. %i will be disabled.\n",
-			       dev->name, boards_found);
-			kfree(dev);
-			break;
-		}
-
 		pAC->Index = boards_found;
 		if (SkGeBoardInit(dev, pAC)) {
 			FreeResources(dev);
@@ -887,6 +875,68 @@
 } /* skge_probe */
 
 
+
+/*****************************************************************************
+ *
+ * 	SkGeInitPCI - Init the PCI resources
+ *
+ * Description:
+ *	This function initialize the PCI resources and IO
+ *
+ * Returns: N/A
+ *	
+ */
+int SkGeInitPCI(SK_AC *pAC)
+{
+	struct SK_NET_DEVICE *dev = pAC->dev[0];
+	struct pci_dev *pdev = pAC->PciDev;
+	int retval;
+
+	if (pci_enable_device(pdev) != 0) {
+		return 1;
+	}
+
+	dev->mem_start = pci_resource_start (pdev, 0);
+	pci_set_master(pdev);
+
+	if (pci_request_regions(pdev, pAC->Name) != 0) {
+		retval = 2;
+		goto out_disable;
+	}
+
+#ifdef SK_BIG_ENDIAN
+	/*
+	 * On big endian machines, we use the adapter's aibility of
+	 * reading the descriptors as big endian.
+	 */
+	{
+		SK_U32		our2;
+		SkPciReadCfgDWord(pAC, PCI_OUR_REG_2, &our2);
+		our2 |= PCI_REV_DESC;
+		SkPciWriteCfgDWord(pAC, PCI_OUR_REG_2, our2);
+	}
+#endif
+
+	/*
+	 * Remap the regs into kernel space.
+	 */
+	pAC->IoBase = (char*)ioremap_nocache(dev->mem_start, 0x4000);
+
+	if (!pAC->IoBase){
+		retval = 3;
+		goto out_release;
+	}
+
+	return 0;
+
+ out_release:
+	pci_release_regions(pdev);
+ out_disable:
+	pci_disable_device(pdev);
+	return retval;
+}
+
+
 /*****************************************************************************
  *
  * 	FreeResources - release resources allocated for adapter
@@ -908,6 +958,9 @@
 		pNet = (DEV_NET*) dev->priv;
 		pAC = pNet->pAC;
 		AllocFlag = pAC->AllocFlag;
+		if (pAC->PciDev) {
+			pci_release_regions(pAC->PciDev);
+		}
 		if (AllocFlag & SK_ALLOC_IRQ) {
 			free_irq(dev->irq, dev);
 		}
@@ -2172,7 +2225,7 @@
 	*/
 	if (BytesSend < C_LEN_ETHERNET_MINSIZE) {
 	    skb_put(pMessage, (C_LEN_ETHERNET_MINSIZE-BytesSend));
-	    memset( ((int *)(pMessage->data))+BytesSend,
+	    SK_MEMSET( ((char *)(pMessage->data))+BytesSend,
 	            0, C_LEN_ETHERNET_MINSIZE-BytesSend);
 	}
 
@@ -2205,10 +2258,12 @@
 
 	if (pMessage->ip_summed == CHECKSUM_HW) {
 		Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff);
-		if ((Protocol == C_PROTO_ID_UDP) && (pAC->GIni.GIChipRev != 0)) {
-			pTxd->TBControl = BMU_UDP_CHECK;
+		if ((Protocol == C_PROTO_ID_UDP) && 
+			(pAC->GIni.GIChipRev == 0) &&
+			(pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
+			pTxd->TBControl = BMU_TCP_CHECK;
 		} else {
-			pTxd->TBControl = BMU_TCP_CHECK ;
+			pTxd->TBControl = BMU_UDP_CHECK;
 		}
 
 		IpHeaderLength  = (SK_U8)pMessage->data[C_OFFSET_IPHEADER];
@@ -2232,7 +2287,7 @@
 #ifdef USE_TX_COMPLETE
 				   BMU_IRQ_EOF |
 #endif
-				   pMessage->len;
+			pMessage->len;
 	}
 
 	/* 
@@ -2333,10 +2388,12 @@
 		** (Revision 2.0)
 		*/
 		Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff);
-		if ((Protocol == C_PROTO_ID_UDP) && (pAC->GIni.GIChipRev != 0)) {
-			pTxd->TBControl |= BMU_UDP_CHECK;
+		if ((Protocol == C_PROTO_ID_UDP) && 
+			(pAC->GIni.GIChipRev == 0) &&
+			(pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
+			pTxd->TBControl |= BMU_TCP_CHECK;
 		} else {
-			pTxd->TBControl |= BMU_TCP_CHECK ;
+			pTxd->TBControl |= BMU_UDP_CHECK;
 		}
 
 		IpHeaderLength  = ((SK_U8)pMessage->data[C_OFFSET_IPHEADER] & 0xf)*4;
@@ -2383,11 +2440,12 @@
 			** opcode for udp is not working in the hardware yet 
 			** (revision 2.0)
 			*/
-			if ( (Protocol == C_PROTO_ID_UDP) && 
-			     (pAC->GIni.GIChipRev != 0) ) {
-				pTxd->TBControl |= BMU_UDP_CHECK ;
+			if ((Protocol == C_PROTO_ID_UDP) && 
+				(pAC->GIni.GIChipRev == 0) &&
+				(pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
+				pTxd->TBControl |= BMU_TCP_CHECK;
 			} else {
-				pTxd->TBControl |= BMU_TCP_CHECK ;
+				pTxd->TBControl |= BMU_UDP_CHECK;
 			}
 		} else {
 			pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_OWN;
@@ -3616,21 +3674,26 @@
 			Length = sizeof(pAC->PnmiStruct) + HeaderLength;
 		}
 		if (NULL == (pMemBuf = kmalloc(Length, GFP_KERNEL))) {
-			return -EFAULT;
+			return -ENOMEM;
 		}
 		if(copy_from_user(pMemBuf, Ioctl.pData, Length)) {
-			return -EFAULT;
+			Err = -EFAULT;
+			goto fault_gen;
 		}
 		if ((Ret = SkPnmiGenIoctl(pAC, pAC->IoBase, pMemBuf, &Length, 0)) < 0) {
-			return -EFAULT;
+			Err = -EFAULT;
+			goto fault_gen;
 		}
 		if(copy_to_user(Ioctl.pData, pMemBuf, Length) ) {
-			return -EFAULT;
+			Err = -EFAULT;
+			goto fault_gen;
 		}
 		Ioctl.Len = Length;
 		if(copy_to_user(rq->ifr_data, &Ioctl, sizeof(SK_GE_IOCTL))) {
-			return -EFAULT;
+			Err = -EFAULT;
+			goto fault_gen;
 		}
+fault_gen:
 		kfree(pMemBuf); /* cleanup everything */
 		break;
 	default:
@@ -4370,7 +4433,7 @@
         }
 
         if (IntsPerSec[pAC->Index] != 0) {
-           if ((IntsPerSec[pAC->Index]< 30)&&(IntsPerSec[pAC->Index]> 40000)) {
+           if ((IntsPerSec[pAC->Index]< 30) || (IntsPerSec[pAC->Index]> 40000)) {
               pAC->DynIrqModInfo.MaxModIntsPerSec = C_INTS_PER_SEC_DEFAULT;
            } else {
               pAC->DynIrqModInfo.MaxModIntsPerSec = IntsPerSec[pAC->Index];
diff -urN linux-2.4.23-pre7/drivers/net/sunhme.c linux-2.4.23-pre8/drivers/net/sunhme.c
--- linux-2.4.23-pre7/drivers/net/sunhme.c	2003-08-25 04:44:42.000000000 -0700
+++ linux-2.4.23-pre8/drivers/net/sunhme.c	2003-10-23 03:33:17.000000000 -0700
@@ -2968,7 +2968,7 @@
 	dev_addr[0] = 0x08;
 	dev_addr[1] = 0x00;
 	dev_addr[2] = 0x20;
-	get_random_bytes(dev_addr, 3);
+	get_random_bytes(&dev_addr[3], 3);
 	return;
 }
 #endif /* !(__sparc__) */
diff -urN linux-2.4.23-pre7/drivers/net/tulip/tulip_core.c linux-2.4.23-pre8/drivers/net/tulip/tulip_core.c
--- linux-2.4.23-pre7/drivers/net/tulip/tulip_core.c	2003-10-23 03:33:14.000000000 -0700
+++ linux-2.4.23-pre8/drivers/net/tulip/tulip_core.c	2003-10-23 03:33:17.000000000 -0700
@@ -229,6 +229,7 @@
 	{ 0x1186, 0x1561, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x1626, 0x8410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x1737, 0xAB09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
+	{ 0x1737, 0xAB08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x17B3, 0xAB08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x14f1, 0x1803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CONEXANT },
 	{ 0x10b9, 0x5261, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X },	/* ALi 1563 integrated ethernet */
diff -urN linux-2.4.23-pre7/drivers/sbus/char/bbc_envctrl.c linux-2.4.23-pre8/drivers/sbus/char/bbc_envctrl.c
--- linux-2.4.23-pre7/drivers/sbus/char/bbc_envctrl.c	2003-06-13 07:51:36.000000000 -0700
+++ linux-2.4.23-pre8/drivers/sbus/char/bbc_envctrl.c	2003-10-23 03:33:17.000000000 -0700
@@ -59,7 +59,7 @@
  * before the hardware based power-off event is triggered.
  */
 
-/* These settings are in celcius.  We use these defaults only
+/* These settings are in Celsius.  We use these defaults only
  * if we cannot interrogate the cpu-fru SEEPROM.
  */
 struct temp_limits {
diff -urN linux-2.4.23-pre7/drivers/sbus/char/cpwatchdog.c linux-2.4.23-pre8/drivers/sbus/char/cpwatchdog.c
--- linux-2.4.23-pre7/drivers/sbus/char/cpwatchdog.c	2001-10-10 23:42:47.000000000 -0700
+++ linux-2.4.23-pre8/drivers/sbus/char/cpwatchdog.c	2003-10-23 03:33:17.000000000 -0700
@@ -544,7 +544,7 @@
 static void wd_pingtimer(struct wd_timer* pTimer)
 {
 	if(wd_readb(&pTimer->regs->status) & WD_S_RUNNING) {
-		wd_readb(&pTimer->regs->dcntr);
+		wd_readw(&pTimer->regs->dcntr);
 	}
 }
 
diff -urN linux-2.4.23-pre7/drivers/sbus/char/envctrl.c linux-2.4.23-pre8/drivers/sbus/char/envctrl.c
--- linux-2.4.23-pre7/drivers/sbus/char/envctrl.c	2003-06-13 07:51:36.000000000 -0700
+++ linux-2.4.23-pre8/drivers/sbus/char/envctrl.c	2003-10-23 03:33:17.000000000 -0700
@@ -1125,7 +1125,7 @@
 	}
 
 	err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES);
-	if (err)
+	if (err < 0)
 		goto out_deregister;
 
 	return 0;
diff -urN linux-2.4.23-pre7/drivers/scsi/megaraid2.c linux-2.4.23-pre8/drivers/scsi/megaraid2.c
--- linux-2.4.23-pre7/drivers/scsi/megaraid2.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/drivers/scsi/megaraid2.c	2003-10-23 03:33:17.000000000 -0700
@@ -398,9 +398,7 @@
 		// replace adapter->lock with io_request_lock for kernels w/o
 		// per host lock and delete the line which tries to initialize
 		// the lock in host structure.
-		adapter->host_lock = &adapter->lock;
-
-		host->lock = adapter->host_lock;
+		adapter->host_lock = &io_request_lock;
 
 		host->cmd_per_lun = max_cmd_per_lun;
 		host->max_sectors = max_sectors_per_io;
diff -urN linux-2.4.23-pre7/drivers/scsi/nsp32.h linux-2.4.23-pre8/drivers/scsi/nsp32.h
--- linux-2.4.23-pre7/drivers/scsi/nsp32.h	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/drivers/scsi/nsp32.h	2003-10-23 03:33:17.000000000 -0700
@@ -642,10 +642,12 @@
 # define scsi_host_put(host)            scsi_unregister(host)
 # define pci_name(pci_dev)              ((pci_dev)->slot_name)
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23))
 typedef void irqreturn_t;
 # define IRQ_NONE      /* */
 # define IRQ_HANDLED   /* */
 # define IRQ_RETVAL(x) /* */
+#endif
 
 /* This is ad-hoc version of scsi_host_get_next() */
 static inline struct Scsi_Host *scsi_host_get_next(struct Scsi_Host *host)
diff -urN linux-2.4.23-pre7/drivers/video/aty/atyfb_base.c linux-2.4.23-pre8/drivers/video/aty/atyfb_base.c
--- linux-2.4.23-pre7/drivers/video/aty/atyfb_base.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/drivers/video/aty/atyfb_base.c	2003-10-23 03:33:18.000000000 -0700
@@ -323,7 +323,8 @@
        It's also often a good idea to contact ATi.
        
        Lastly, third party board vendors might use different memory clocks
-       than ATi. No examples of this have been found yet, but it is possible.
+       than ATi. An example of this is the Apple iBook1 which is handled specially
+       in aty_init.
        
        (Daniel Mantione, 26 June 2003)
      */
@@ -356,7 +357,7 @@
 
     /* Mach64 LT */
     { 0x4c54, 0x4c54, 0x00, 0x00, m64n_lt,      135,  63,  63, M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP },
-    { 0x4c47, 0x4c47, 0x00, 0x00, m64n_ltg,     230,  63,  63, M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT | M64F_LT_SLEEP | M64F_G3_PB_1024x768 },
+    { 0x4c47, 0x4c47, 0x00, 0x00, m64n_ltg,     230,  63,  63, M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT | M64F_LT_SLEEP | M64F_G3_PB_1024x768 | M64F_FIFO_24 },
 
     /* Mach64 GTC (3D RAGE PRO) */
     { 0x4742, 0x4742, 0x00, 0x00, m64n_gtc_ba,  230, 100, 100, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT },
@@ -2075,6 +2076,14 @@
         ramname = aty_ct_ram[info->ram_type];
         info->dac_ops = &aty_dac_ct;
         info->pll_ops = &aty_pll_ct;
+#ifdef CONFIG_ALL_PPC
+	/* The Apple iBook1 uses non-standard memory frequencies. We detect it
+	   and set the frequency manually. */
+	if ((type==0x4c4e) && machine_is_compatible("PowerBook2,1")) {
+	    mclk=70;
+	    xclk=53;
+	};
+#endif
 	/*
 	 * I disable the hack below because it is completely unreliable. 
 	 * DRAM at 67 is very well imaginable. If a chip is indeed clocked
diff -urN linux-2.4.23-pre7/fs/lockd/svc4proc.c linux-2.4.23-pre8/fs/lockd/svc4proc.c
--- linux-2.4.23-pre7/fs/lockd/svc4proc.c	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.23-pre8/fs/lockd/svc4proc.c	2003-10-23 03:33:18.000000000 -0700
@@ -449,13 +449,11 @@
 	if (nlmsvc_ops != NULL) {
 		struct svc_client	*clnt;
 		saddr.sin_addr.s_addr = argp->addr;
-		nlmsvc_ops->exp_readlock();
 		if ((clnt = nlmsvc_ops->exp_getclient(&saddr)) != NULL 
 		 && (host = nlm_lookup_host(clnt, &saddr, 0, 0)) != NULL) {
 			nlmsvc_free_host_resources(host);
 		}
 		nlm_release_host(host);
-		nlmsvc_ops->exp_unlock();
 	}
 
 	return rpc_success;
diff -urN linux-2.4.23-pre7/fs/lockd/svcproc.c linux-2.4.23-pre8/fs/lockd/svcproc.c
--- linux-2.4.23-pre7/fs/lockd/svcproc.c	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.23-pre8/fs/lockd/svcproc.c	2003-10-23 03:33:18.000000000 -0700
@@ -477,13 +477,11 @@
 	if (nlmsvc_ops != NULL) {
 		struct svc_client	*clnt;
 		saddr.sin_addr.s_addr = argp->addr;
-		nlmsvc_ops->exp_readlock();
 		if ((clnt = nlmsvc_ops->exp_getclient(&saddr)) != NULL 
 		 && (host = nlm_lookup_host(clnt, &saddr, 0, 0)) != NULL) {
 			nlmsvc_free_host_resources(host);
 		}
 		nlm_release_host(host);
-		nlmsvc_ops->exp_unlock();
 	}
 
 	return rpc_success;
diff -urN linux-2.4.23-pre7/fs/nfs/nfs3proc.c linux-2.4.23-pre8/fs/nfs/nfs3proc.c
--- linux-2.4.23-pre7/fs/nfs/nfs3proc.c	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.23-pre8/fs/nfs/nfs3proc.c	2003-10-23 03:33:18.000000000 -0700
@@ -433,8 +433,6 @@
  * The decode function itself doesn't perform any decoding, it just makes
  * sure the reply is syntactically correct.
  *
- * Also note that this implementation handles both plain readdir and
- * readdirplus.
  */
 static int
 nfs3_proc_readdir(struct inode *dir, struct rpc_cred *cred,
@@ -448,11 +446,7 @@
 	struct rpc_message	msg = { NFS3PROC_READDIR, &arg, &res, cred };
 	int			status;
 
-	if (plus)
-		msg.rpc_proc = NFS3PROC_READDIRPLUS;
-
-	dprintk("NFS call  readdir%s %d\n",
-			plus? "plus" : "", (unsigned int) cookie);
+	dprintk("NFS call  readdir %d\n", (unsigned int) cookie);
 
 	dir_attr.valid = 0;
 	status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
diff -urN linux-2.4.23-pre7/fs/nfs/nfs3xdr.c linux-2.4.23-pre8/fs/nfs/nfs3xdr.c
--- linux-2.4.23-pre7/fs/nfs/nfs3xdr.c	2002-11-28 15:53:15.000000000 -0800
+++ linux-2.4.23-pre8/fs/nfs/nfs3xdr.c	2003-10-23 03:33:18.000000000 -0700
@@ -599,8 +599,6 @@
 u32 *
 nfs3_decode_dirent(u32 *p, struct nfs_entry *entry, int plus)
 {
-	struct nfs_entry old = *entry;
-
 	if (!*p++) {
 		if (!*p)
 			return ERR_PTR(-EAGAIN);
@@ -616,20 +614,12 @@
 	p = xdr_decode_hyper(p, &entry->cookie);
 
 	if (plus) {
-		p = xdr_decode_post_op_attr(p, &entry->fattr);
+		struct nfs_fattr fattr;
+		p = xdr_decode_post_op_attr(p, &fattr);
 		/* In fact, a post_op_fh3: */
 		if (*p++) {
-			p = xdr_decode_fhandle(p, &entry->fh);
-			/* Ugh -- server reply was truncated */
-			if (p == NULL) {
-				dprintk("NFS: FH truncated\n");
-				*entry = old;
-				return ERR_PTR(-EAGAIN);
-			}
-		} else {
-			/* If we don't get a file handle, the attrs
-			 * aren't worth a lot. */
-			entry->fattr.valid = 0;
+			struct nfs_fh fh;
+			p = xdr_decode_fhandle(p, &fh);
 		}
 	}
 
diff -urN linux-2.4.23-pre7/fs/nfs/write.c linux-2.4.23-pre8/fs/nfs/write.c
--- linux-2.4.23-pre7/fs/nfs/write.c	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.23-pre8/fs/nfs/write.c	2003-10-23 03:33:18.000000000 -0700
@@ -225,8 +225,19 @@
 	struct inode *inode = page->mapping->host;
 	unsigned long end_index;
 	unsigned offset = PAGE_CACHE_SIZE;
+	int inode_referenced = 0;
 	int err;
 
+	/*
+	 * Note: We need to ensure that we have a reference to the inode
+	 *       if we are to do asynchronous writes. If not, waiting
+	 *       in nfs_wait_on_request() may deadlock with clear_inode().
+	 *
+	 *       If igrab() fails here, then it is in any case safe to
+	 *       call nfs_wb_page(), since there will be no pending writes.
+	 */
+	if (igrab(inode) != 0)
+		inode_referenced = 1;
 	end_index = inode->i_size >> PAGE_CACHE_SHIFT;
 
 	/* Ensure we've flushed out any previous writes */
@@ -244,7 +255,8 @@
 		goto out;
 do_it:
 	lock_kernel();
-	if (NFS_SERVER(inode)->wsize >= PAGE_CACHE_SIZE && !IS_SYNC(inode)) {
+	if (NFS_SERVER(inode)->wsize >= PAGE_CACHE_SIZE && !IS_SYNC(inode) &&
+			inode_referenced) {
 		err = nfs_writepage_async(NULL, inode, page, 0, offset);
 		if (err >= 0)
 			err = 0;
@@ -256,7 +268,9 @@
 	unlock_kernel();
 out:
 	UnlockPage(page);
-	return err; 
+	if (inode_referenced)
+		iput(inode);
+	return err;
 }
 
 /*
diff -urN linux-2.4.23-pre7/fs/ramfs/inode.c linux-2.4.23-pre8/fs/ramfs/inode.c
--- linux-2.4.23-pre7/fs/ramfs/inode.c	2002-08-02 17:39:45.000000000 -0700
+++ linux-2.4.23-pre8/fs/ramfs/inode.c	2003-10-23 03:33:18.000000000 -0700
@@ -44,7 +44,7 @@
 {
 	buf->f_type = RAMFS_MAGIC;
 	buf->f_bsize = PAGE_CACHE_SIZE;
-	buf->f_namelen = 255;
+	buf->f_namelen = NAME_MAX;
 	return 0;
 }
 
@@ -54,6 +54,8 @@
  */
 static struct dentry * ramfs_lookup(struct inode *dir, struct dentry *dentry)
 {
+	if (dentry->d_name.len > NAME_MAX)
+		return ERR_PTR(-ENAMETOOLONG);
 	d_add(dentry, NULL);
 	return NULL;
 }
@@ -138,6 +140,11 @@
 	int error = -ENOSPC;
 
 	if (inode) {
+		if (dir->i_mode & S_ISGID) {
+			inode->i_gid = dir->i_gid;
+			if (S_ISDIR(mode))
+				inode->i_mode |= S_ISGID;
+		}
 		d_instantiate(dentry, inode);
 		dget(dentry);		/* Extra count - pin the dentry in core */
 		error = 0;
diff -urN linux-2.4.23-pre7/include/acpi/acconfig.h linux-2.4.23-pre8/include/acpi/acconfig.h
--- linux-2.4.23-pre7/include/acpi/acconfig.h	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/include/acpi/acconfig.h	2003-10-23 03:33:18.000000000 -0700
@@ -64,7 +64,7 @@
 
 /* Version string */
 
-#define ACPI_CA_VERSION                 0x20030918
+#define ACPI_CA_VERSION                 0x20031002
 
 /* Maximum objects in the various object caches */
 
diff -urN linux-2.4.23-pre7/include/acpi/acexcep.h linux-2.4.23-pre8/include/acpi/acexcep.h
--- linux-2.4.23-pre7/include/acpi/acexcep.h	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.23-pre8/include/acpi/acexcep.h	2003-10-23 03:33:18.000000000 -0700
@@ -163,6 +163,7 @@
 #define AE_AML_NO_RESOURCE_END_TAG      (acpi_status) (0x001E | AE_CODE_AML)
 #define AE_AML_BAD_RESOURCE_VALUE       (acpi_status) (0x001F | AE_CODE_AML)
 #define AE_AML_CIRCULAR_REFERENCE       (acpi_status) (0x0020 | AE_CODE_AML)
+#define AE_AML_BAD_RESOURCE_LENGTH      (acpi_status) (0x0021 | AE_CODE_AML)
 
 #define AE_CODE_AML_MAX                 0x0020
 
@@ -280,7 +281,8 @@
 	"AE_AML_ALIGNMENT",
 	"AE_AML_NO_RESOURCE_END_TAG",
 	"AE_AML_BAD_RESOURCE_VALUE",
-	"AE_AML_CIRCULAR_REFERENCE"
+	"AE_AML_CIRCULAR_REFERENCE",
+	"AE_AML_BAD_RESOURCE_LENGTH"
 };
 
 char const   *acpi_gbl_exception_names_ctrl[] =
diff -urN linux-2.4.23-pre7/include/acpi/actbl.h linux-2.4.23-pre8/include/acpi/actbl.h
--- linux-2.4.23-pre7/include/acpi/actbl.h	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.23-pre8/include/acpi/actbl.h	2003-10-23 03:33:18.000000000 -0700
@@ -65,16 +65,6 @@
 
 #define GL_OWNED                0x02        /* Ownership of global lock is bit 1 */
 
-/* values of Mapic.Model */
-
-#define DUAL_PIC                0
-#define MULTIPLE_APIC           1
-
-/* values of Type in struct apic_header */
-
-#define APIC_PROC               0
-#define APIC_IO                 1
-
 
 /*
  * Common table types.  The base code can remain
@@ -89,8 +79,10 @@
 #pragma pack(1)
 
 /*
- * Architecture-independent tables
- * The architecture dependent tables are in separate files
+ * ACPI Version-independent tables
+ *
+ * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.)
+ * are in separate files.
  */
 struct rsdp_descriptor         /* Root System Descriptor Pointer */
 {
@@ -106,20 +98,6 @@
 };
 
 
-struct acpi_table_header         /* ACPI common table header */
-{
-	char                            signature [4];          /* ACPI signature (4 ASCII characters) */
-	u32                             length;                 /* Length of table, in bytes, including header */
-	u8                              revision;               /* ACPI Specification minor version # */
-	u8                              checksum;               /* To make sum of entire table == 0 */
-	char                            oem_id [6];             /* OEM identification */
-	char                            oem_table_id [8];       /* OEM table identification */
-	u32                             oem_revision;           /* OEM revision number */
-	char                            asl_compiler_id [4];    /* ASL compiler vendor ID */
-	u32                             asl_compiler_revision;  /* ASL compiler revision number */
-};
-
-
 struct acpi_common_facs          /* Common FACS for internal use */
 {
 	u32                             *global_lock;
@@ -128,68 +106,196 @@
 };
 
 
-struct apic_table
+#define ACPI_TABLE_HEADER_DEF   /* ACPI common table header */ \
+	char                            signature [4];          /* ACPI signature (4 ASCII characters) */\
+	u32                             length;                 /* Length of table, in bytes, including header */\
+	u8                              revision;               /* ACPI Specification minor version # */\
+	u8                              checksum;               /* To make sum of entire table == 0 */\
+	char                            oem_id [6];             /* OEM identification */\
+	char                            oem_table_id [8];       /* OEM table identification */\
+	u32                             oem_revision;           /* OEM revision number */\
+	char                            asl_compiler_id [4];    /* ASL compiler vendor ID */\
+	u32                             asl_compiler_revision;  /* ASL compiler revision number */
+
+
+struct acpi_table_header         /* ACPI common table header */
 {
-	struct acpi_table_header        header;                 /* ACPI table header */
-	u32                             local_apic_address;     /* Physical address for accessing local APICs */
-	u32                             PCATcompat      : 1;    /* a one indicates system also has dual 8259s */
-	u32                             reserved1       : 31;
+	ACPI_TABLE_HEADER_DEF
 };
 
 
-struct apic_header
+/*
+ * MADT values and structures
+ */
+
+/* Values for MADT PCATCompat */
+
+#define DUAL_PIC                0
+#define MULTIPLE_APIC           1
+
+
+/* Master MADT */
+
+struct multiple_apic_table
 {
-	u8                              type;                   /* APIC type.  Either APIC_PROC or APIC_IO */
-	u8                              length;                 /* Length of APIC structure */
+	ACPI_TABLE_HEADER_DEF                           /* ACPI common table header */
+	u32                             local_apic_address;     /* Physical address of local APIC */
+	u32                             PCATcompat      : 1;    /* A one indicates system also has dual 8259s */
+	u32                             reserved1       : 31;
 };
 
 
-struct processor_apic
+/* Values for Type in APIC_HEADER_DEF */
+
+#define APIC_PROCESSOR          0
+#define APIC_IO                 1
+#define APIC_XRUPT_OVERRIDE     2
+#define APIC_NMI                3
+#define APIC_LOCAL_NMI          4
+#define APIC_ADDRESS_OVERRIDE   5
+#define APIC_IO_SAPIC           6
+#define APIC_LOCAL_SAPIC        7
+#define APIC_XRUPT_SOURCE       8
+#define APIC_RESERVED           9           /* 9 and greater are reserved */
+
+/*
+ * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE)
+ */
+#define APIC_HEADER_DEF                     /* Common APIC sub-structure header */\
+	u8                              type; \
+	u8                              length;
+
+/* Values for MPS INTI flags */
+
+#define POLARITY_CONFORMS       0
+#define POLARITY_ACTIVE_HIGH    1
+#define POLARITY_RESERVED       2
+#define POLARITY_ACTIVE_LOW     3
+
+#define TRIGGER_CONFORMS        0
+#define TRIGGER_EDGE            1
+#define TRIGGER_RESERVED        2
+#define TRIGGER_LEVEL           3
+
+/* Common flag definitions */
+
+#define MPS_INTI_FLAGS \
+	u16                             polarity        : 2;    /* Polarity of APIC I/O input signals */\
+	u16                             trigger_mode    : 2;    /* Trigger mode of APIC input signals */\
+	u16                             reserved1       : 12;   /* Reserved, must be zero */
+
+#define LOCAL_APIC_FLAGS \
+	u32                             processor_enabled: 1;   /* Processor is usable if set */\
+	u32                             reserved2       : 31;   /* Reserved, must be zero */
+
+/* Sub-structures for MADT */
+
+struct madt_processor_apic
 {
-	struct apic_header              header;
-	u8                              processor_apic_id;      /* ACPI processor id */
+	APIC_HEADER_DEF
+	u8                              processor_id;           /* ACPI processor id */
 	u8                              local_apic_id;          /* Processor's local APIC id */
-	u32                             processor_enabled: 1;   /* Processor is usable if set */
-	u32                             reserved1       : 31;
+	LOCAL_APIC_FLAGS
 };
 
-
-struct io_apic
+struct madt_io_apic
 {
-	struct apic_header              header;
+	APIC_HEADER_DEF
 	u8                              io_apic_id;             /* I/O APIC ID */
 	u8                              reserved;               /* Reserved - must be zero */
-	u32                             io_apic_address;        /* APIC's physical address */
-	u32                             vector;                 /* Interrupt vector index where INTI
+	u32                             address;                /* APIC physical address */
+	u32                             interrupt;              /* Global system interrupt where INTI
 			  * lines start */
 };
 
+struct madt_interrupt_override
+{
+	APIC_HEADER_DEF
+	u8                              bus;                    /* 0 - ISA */
+	u8                              source;                 /* Interrupt source (IRQ) */
+	u32                             interrupt;              /* Global system interrupt */
+	MPS_INTI_FLAGS
+};
+
+struct madt_nmi_source
+{
+	APIC_HEADER_DEF
+	MPS_INTI_FLAGS
+	u32                             interrupt;              /* Global system interrupt */
+};
+
+struct madt_local_apic_nmi
+{
+	APIC_HEADER_DEF
+	u8                              processor_id;           /* ACPI processor id */
+	MPS_INTI_FLAGS
+	u8                              lint;                   /* LINTn to which NMI is connected */
+};
+
+struct madt_address_override
+{
+	APIC_HEADER_DEF
+	u16                             reserved;               /* Reserved - must be zero */
+	u32                             address;                /* APIC physical address */
+};
+
+struct madt_io_sapic
+{
+	APIC_HEADER_DEF
+	u8                              io_sapic_id;            /* I/O SAPIC ID */
+	u8                              reserved;               /* Reserved - must be zero */
+	u32                             interrupt_base;         /* Glocal interrupt for SAPIC start */
+	u64                             address;                /* SAPIC physical address */
+};
+
+struct madt_local_sapic
+{
+	APIC_HEADER_DEF
+	u8                              processor_id;           /* ACPI processor id */
+	u8                              local_sapic_id;         /* SAPIC ID */
+	u8                              local_sapic_eid;        /* SAPIC EID */
+	u8                              reserved [3];           /* Reserved - must be zero */
+	LOCAL_APIC_FLAGS
+};
+
+struct madt_interrupt_source
+{
+	APIC_HEADER_DEF
+	MPS_INTI_FLAGS
+	u8                              interrupt_type;         /* 1=PMI, 2=INIT, 3=corrected */
+	u8                              processor_id;           /* Processor ID */
+	u8                              processor_eid;          /* Processor EID */
+	u8                              io_sapic_vector;        /* Vector value for PMI interrupts */
+	u32                             interrupt;              /* Global system interrupt */
+	u32                             reserved;               /* Reserved - must be zero */
+};
 
-/*
- *  IA64 TBD:  Add SAPIC Tables
- */
 
 /*
- *  IA64 TBD:   Modify Smart Battery Description to comply with ACPI IA64
- *              extensions.
+ * Smart Battery
  */
-struct smart_battery_description_table
+struct smart_battery_table
 {
-	struct acpi_table_header        header;
+	ACPI_TABLE_HEADER_DEF
 	u32                             warning_level;
 	u32                             low_level;
 	u32                             critical_level;
 };
 
-struct hpet_description_table
+
+/*
+ * High performance timer
+ */
+struct hpet_table
 {
-	struct acpi_table_header        header;
+	ACPI_TABLE_HEADER_DEF
 	u32                             hardware_id;
-	u32                             base_address[3];
+	u32                             base_address [3];
 	u8                              hpet_number;
 	u16                             clock_tick;
 	u8                              attributes;
 };
+
 #pragma pack()
 
 
@@ -227,9 +333,10 @@
 
 
 /*
- * Get the architecture-specific tables
+ * Get the ACPI version-specific tables
  */
 #include "actbl1.h"   /* Acpi 1.0 table definitions */
 #include "actbl2.h"   /* Acpi 2.0 table definitions */
 
+
 #endif /* __ACTBL_H__ */
diff -urN linux-2.4.23-pre7/include/acpi/actbl1.h linux-2.4.23-pre8/include/acpi/actbl1.h
--- linux-2.4.23-pre7/include/acpi/actbl1.h	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.23-pre8/include/acpi/actbl1.h	2003-10-23 03:33:18.000000000 -0700
@@ -51,7 +51,7 @@
  */
 struct rsdt_descriptor_rev1
 {
-	struct acpi_table_header        header;                 /* ACPI Table header */
+	ACPI_TABLE_HEADER_DEF                           /* ACPI common table header */
 	u32                             table_offset_entry [1]; /* Array of pointers to other */
 			 /* ACPI tables */
 };
@@ -78,7 +78,7 @@
  */
 struct fadt_descriptor_rev1
 {
-	struct acpi_table_header        header;                 /* ACPI Table header */
+	ACPI_TABLE_HEADER_DEF                           /* ACPI common table header */
 	u32                             firmware_ctrl;          /* Physical address of FACS */
 	u32                             dsdt;                   /* Physical address of DSDT */
 	u8                              model;                  /* System Interrupt Model */
diff -urN linux-2.4.23-pre7/include/acpi/actbl2.h linux-2.4.23-pre8/include/acpi/actbl2.h
--- linux-2.4.23-pre7/include/acpi/actbl2.h	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.23-pre8/include/acpi/actbl2.h	2003-10-23 03:33:18.000000000 -0700
@@ -71,7 +71,7 @@
  */
 struct rsdt_descriptor_rev2
 {
-	struct acpi_table_header        header;                 /* ACPI table header */
+	ACPI_TABLE_HEADER_DEF                           /* ACPI common table header */
 	u32                             table_offset_entry [1]; /* Array of pointers to  */
 			 /* ACPI table headers */
 };
@@ -82,7 +82,7 @@
  */
 struct xsdt_descriptor_rev2
 {
-	struct acpi_table_header        header;                 /* ACPI table header */
+	ACPI_TABLE_HEADER_DEF                           /* ACPI common table header */
 	u64                             table_offset_entry [1]; /* Array of pointers to  */
 			 /* ACPI table headers */
 };
@@ -124,7 +124,7 @@
  */
 struct fadt_descriptor_rev2
 {
-	struct acpi_table_header        header;             /* ACPI table header */
+	ACPI_TABLE_HEADER_DEF                       /* ACPI common table header */
 	u32                             V1_firmware_ctrl;   /* 32-bit physical address of FACS */
 	u32                             V1_dsdt;            /* 32-bit physical address of DSDT */
 	u8                              reserved1;          /* System Interrupt Model isn't used in ACPI 2.0*/
@@ -195,6 +195,19 @@
 };
 
 
+/* Embedded Controller */
+
+struct ec_boot_resources
+{
+	ACPI_TABLE_HEADER_DEF
+	struct acpi_generic_address     ec_control;         /* Address of EC command/status register */
+	struct acpi_generic_address     ec_data;            /* Address of EC data register */
+	u32                             uid;                /* Unique ID - must be same as the EC _UID method */
+	u8                              gpe_bit;            /* The GPE for the EC */
+	u8                              ec_id[1];           /* Full namepath of the EC in the ACPI namespace */
+};
+
+
 #pragma pack()
 
 #endif /* __ACTBL2_H__ */
diff -urN linux-2.4.23-pre7/include/acpi/actypes.h linux-2.4.23-pre8/include/acpi/actypes.h
--- linux-2.4.23-pre7/include/acpi/actypes.h	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.23-pre8/include/acpi/actypes.h	2003-10-23 03:33:18.000000000 -0700
@@ -207,6 +207,7 @@
 /*
  * Miscellaneous common types
  */
+typedef u16                                     UINT16_BIT;
 typedef u32                                     UINT32_BIT;
 typedef acpi_native_uint                        ACPI_PTRDIFF;
 
diff -urN linux-2.4.23-pre7/include/asm-sh/irq.h linux-2.4.23-pre8/include/asm-sh/irq.h
--- linux-2.4.23-pre7/include/asm-sh/irq.h	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sh/irq.h	2003-10-23 03:33:18.000000000 -0700
@@ -86,7 +86,7 @@
 #define IRDA_IPR_POS	2
 #define IRDA_PRIORITY	3
 #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751) || \
-      defined(CONFIG_CPU_SUBTYPE_ST40) || defined(CONFIG_CPU_SUBTYPE_SH4_202)
+      defined(CONFIG_CPU_SUBTYPE_ST40)
 #define SCIF_ERI_IRQ	40
 #define SCIF_RXI_IRQ	41
 #define SCIF_BRI_IRQ	42
@@ -295,18 +295,21 @@
 #else
 #error Unknown CPU
 #endif
- 
-#define INTC2_BASE0 0xfe080000
-#define INTC2_INTC2MODE  (INTC2_BASE0+0x80)
- 
+
+#define INTC2_BASE	0xfe080000
+#define INTC2_INTC2MODE	(INTC2_BASE+0x80)
+
 #define INTC2_INTPRI_OFFSET	0x00
 #define INTC2_INTREQ_OFFSET	0x20
 #define INTC2_INTMSK_OFFSET	0x40
 #define INTC2_INTMSKCLR_OFFSET	0x60
- 
-extern void make_intc2_irq(unsigned int irq,unsigned int addr,
-                           unsigned int group,int pos,int priority);
- 
+
+void make_intc2_irq(unsigned int irq,
+		    unsigned int ipr_offset, unsigned int ipr_shift,
+		    unsigned int msk_offset, unsigned int msk_shift,
+		    unsigned int priority);
+void init_IRQ_intc2(void);
+void intc2_add_clear_irq(int irq, int (*fn)(int));
 #endif                                                                        
        
 #ifdef CONFIG_SH_GENERIC
diff -urN linux-2.4.23-pre7/include/asm-sh64/pci.h linux-2.4.23-pre8/include/asm-sh64/pci.h
--- linux-2.4.23-pre7/include/asm-sh64/pci.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sh64/pci.h	2003-10-23 03:33:18.000000000 -0700
@@ -42,6 +42,7 @@
 ** or architectures with incomplete PCI setup by the loader 
 */
 #define pcibios_assign_all_busses()     1
+#define pcibios_scan_all_fns()		0
 
 /* 
 ** These are currently the correct values for the STM overdrive board.
diff -urN linux-2.4.23-pre7/include/asm-sparc/atomic.h linux-2.4.23-pre8/include/asm-sparc/atomic.h
--- linux-2.4.23-pre7/include/asm-sparc/atomic.h	2001-10-30 15:08:11.000000000 -0800
+++ linux-2.4.23-pre8/include/asm-sparc/atomic.h	2003-10-23 03:33:18.000000000 -0700
@@ -48,10 +48,13 @@
 #define atomic_set(v, i)	(((v)->counter) = ((i) << 8))
 #endif
 
-static __inline__ int __atomic_add(int i, atomic_t *v)
+static inline int __atomic_add(int i, atomic_t *v)
 {
 	register volatile int *ptr asm("g1");
 	register int increment asm("g2");
+	register int tmp1 asm("g3");
+	register int tmp2 asm("g4");
+	register int tmp3 asm("g7");
 
 	ptr = &v->counter;
 	increment = i;
@@ -60,17 +63,20 @@
 	"mov	%%o7, %%g4\n\t"
 	"call	___atomic_add\n\t"
 	" add	%%o7, 8, %%o7\n"
-	: "=&r" (increment)
+	: "=&r" (increment), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)
 	: "0" (increment), "r" (ptr)
-	: "g3", "g4", "g7", "memory", "cc");
+	: "memory", "cc");
 
 	return increment;
 }
 
-static __inline__ int __atomic_sub(int i, atomic_t *v)
+static inline int __atomic_sub(int i, atomic_t *v)
 {
 	register volatile int *ptr asm("g1");
 	register int increment asm("g2");
+	register int tmp1 asm("g3");
+	register int tmp2 asm("g4");
+	register int tmp3 asm("g7");
 
 	ptr = &v->counter;
 	increment = i;
@@ -79,9 +85,9 @@
 	"mov	%%o7, %%g4\n\t"
 	"call	___atomic_sub\n\t"
 	" add	%%o7, 8, %%o7\n"
-	: "=&r" (increment)
+	: "=&r" (increment), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)
 	: "0" (increment), "r" (ptr)
-	: "g3", "g4", "g7", "memory", "cc");
+	: "memory", "cc");
 
 	return increment;
 }
diff -urN linux-2.4.23-pre7/include/asm-sparc/bitops.h linux-2.4.23-pre8/include/asm-sparc/bitops.h
--- linux-2.4.23-pre7/include/asm-sparc/bitops.h	2001-12-21 09:42:03.000000000 -0800
+++ linux-2.4.23-pre8/include/asm-sparc/bitops.h	2003-10-23 03:33:18.000000000 -0700
@@ -21,10 +21,14 @@
  * within the first byte. Sparc is BIG-Endian. Unless noted otherwise
  * all bit-ops return 0 if bit was previously clear and != 0 otherwise.
  */
-static __inline__ int test_and_set_bit(unsigned long nr, volatile void *addr)
+static inline int test_and_set_bit(unsigned long nr, volatile void *addr)
 {
 	register unsigned long mask asm("g2");
 	register unsigned long *ADDR asm("g1");
+	register int tmp1 asm("g3");
+	register int tmp2 asm("g4");
+	register int tmp3 asm("g5");
+	register int tmp4 asm("g7");
 
 	ADDR = ((unsigned long *) addr) + (nr >> 5);
 	mask = 1 << (nr & 31);
@@ -33,17 +37,21 @@
 	"mov	%%o7, %%g4\n\t"
 	"call	___set_bit\n\t"
 	" add	%%o7, 8, %%o7\n"
-	: "=&r" (mask)
+	: "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
 	: "0" (mask), "r" (ADDR)
-	: "g3", "g4", "g5", "g7", "memory", "cc");
+	: "memory", "cc");
 
 	return mask != 0;
 }
 
-static __inline__ void set_bit(unsigned long nr, volatile void *addr)
+static inline void set_bit(unsigned long nr, volatile void *addr)
 {
 	register unsigned long mask asm("g2");
 	register unsigned long *ADDR asm("g1");
+	register int tmp1 asm("g3");
+	register int tmp2 asm("g4");
+	register int tmp3 asm("g5");
+	register int tmp4 asm("g7");
 
 	ADDR = ((unsigned long *) addr) + (nr >> 5);
 	mask = 1 << (nr & 31);
@@ -52,15 +60,19 @@
 	"mov	%%o7, %%g4\n\t"
 	"call	___set_bit\n\t"
 	" add	%%o7, 8, %%o7\n"
-	: "=&r" (mask)
+	: "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
 	: "0" (mask), "r" (ADDR)
-	: "g3", "g4", "g5", "g7", "cc");
+	: "memory", "cc");
 }
 
-static __inline__ int test_and_clear_bit(unsigned long nr, volatile void *addr)
+static inline int test_and_clear_bit(unsigned long nr, volatile void *addr)
 {
 	register unsigned long mask asm("g2");
 	register unsigned long *ADDR asm("g1");
+	register int tmp1 asm("g3");
+	register int tmp2 asm("g4");
+	register int tmp3 asm("g5");
+	register int tmp4 asm("g7");
 
 	ADDR = ((unsigned long *) addr) + (nr >> 5);
 	mask = 1 << (nr & 31);
@@ -69,17 +81,21 @@
 	"mov	%%o7, %%g4\n\t"
 	"call	___clear_bit\n\t"
 	" add	%%o7, 8, %%o7\n"
-	: "=&r" (mask)
+	: "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
 	: "0" (mask), "r" (ADDR)
-	: "g3", "g4", "g5", "g7", "memory", "cc");
+	: "memory", "cc");
 
 	return mask != 0;
 }
 
-static __inline__ void clear_bit(unsigned long nr, volatile void *addr)
+static inline void clear_bit(unsigned long nr, volatile void *addr)
 {
 	register unsigned long mask asm("g2");
 	register unsigned long *ADDR asm("g1");
+	register int tmp1 asm("g3");
+	register int tmp2 asm("g4");
+	register int tmp3 asm("g5");
+	register int tmp4 asm("g7");
 
 	ADDR = ((unsigned long *) addr) + (nr >> 5);
 	mask = 1 << (nr & 31);
@@ -88,15 +104,19 @@
 	"mov	%%o7, %%g4\n\t"
 	"call	___clear_bit\n\t"
 	" add	%%o7, 8, %%o7\n"
-	: "=&r" (mask)
+	: "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
 	: "0" (mask), "r" (ADDR)
-	: "g3", "g4", "g5", "g7", "cc");
+	: "memory", "cc");
 }
 
-static __inline__ int test_and_change_bit(unsigned long nr, volatile void *addr)
+static inline int test_and_change_bit(unsigned long nr, volatile void *addr)
 {
 	register unsigned long mask asm("g2");
 	register unsigned long *ADDR asm("g1");
+	register int tmp1 asm("g3");
+	register int tmp2 asm("g4");
+	register int tmp3 asm("g5");
+	register int tmp4 asm("g7");
 
 	ADDR = ((unsigned long *) addr) + (nr >> 5);
 	mask = 1 << (nr & 31);
@@ -105,17 +125,21 @@
 	"mov	%%o7, %%g4\n\t"
 	"call	___change_bit\n\t"
 	" add	%%o7, 8, %%o7\n"
-	: "=&r" (mask)
+	: "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
 	: "0" (mask), "r" (ADDR)
-	: "g3", "g4", "g5", "g7", "memory", "cc");
+	: "memory", "cc");
 
 	return mask != 0;
 }
 
-static __inline__ void change_bit(unsigned long nr, volatile void *addr)
+static inline void change_bit(unsigned long nr, volatile void *addr)
 {
 	register unsigned long mask asm("g2");
 	register unsigned long *ADDR asm("g1");
+	register int tmp1 asm("g3");
+	register int tmp2 asm("g4");
+	register int tmp3 asm("g5");
+	register int tmp4 asm("g7");
 
 	ADDR = ((unsigned long *) addr) + (nr >> 5);
 	mask = 1 << (nr & 31);
@@ -124,15 +148,15 @@
 	"mov	%%o7, %%g4\n\t"
 	"call	___change_bit\n\t"
 	" add	%%o7, 8, %%o7\n"
-	: "=&r" (mask)
+	: "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
 	: "0" (mask), "r" (ADDR)
-	: "g3", "g4", "g5", "g7", "cc");
+	: "memory", "cc");
 }
 
 /*
  * non-atomic versions
  */
-static __inline__ void __set_bit(int nr, volatile void *addr)
+static inline void __set_bit(int nr, volatile void *addr)
 {
 	unsigned long mask = 1UL << (nr & 0x1f);
 	unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
@@ -140,7 +164,7 @@
 	*p |= mask;
 }
 
-static __inline__ void __clear_bit(int nr, volatile void *addr)
+static inline void __clear_bit(int nr, volatile void *addr)
 {
 	unsigned long mask = 1UL << (nr & 0x1f);
 	unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
@@ -148,7 +172,7 @@
 	*p &= ~mask;
 }
 
-static __inline__ void __change_bit(int nr, volatile void *addr)
+static inline void __change_bit(int nr, volatile void *addr)
 {
 	unsigned long mask = 1UL << (nr & 0x1f);
 	unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
@@ -156,7 +180,7 @@
 	*p ^= mask;
 }
 
-static __inline__ int __test_and_set_bit(int nr, volatile void *addr)
+static inline int __test_and_set_bit(int nr, volatile void *addr)
 {
 	unsigned long mask = 1UL << (nr & 0x1f);
 	unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
@@ -166,7 +190,7 @@
 	return (old & mask) != 0;
 }
 
-static __inline__ int __test_and_clear_bit(int nr, volatile void *addr)
+static inline int __test_and_clear_bit(int nr, volatile void *addr)
 {
 	unsigned long mask = 1UL << (nr & 0x1f);
 	unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
@@ -176,7 +200,7 @@
 	return (old & mask) != 0;
 }
 
-static __inline__ int __test_and_change_bit(int nr, volatile void *addr)
+static inline int __test_and_change_bit(int nr, volatile void *addr)
 {
 	unsigned long mask = 1UL << (nr & 0x1f);
 	unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
@@ -190,13 +214,13 @@
 #define smp_mb__after_clear_bit()	do { } while(0)
 
 /* The following routine need not be atomic. */
-static __inline__ int test_bit(int nr, __const__ void *addr)
+static inline int test_bit(int nr, __const__ void *addr)
 {
 	return (1 & (((__const__ unsigned int *) addr)[nr >> 5] >> (nr & 31))) != 0;
 }
 
 /* The easy/cheese version for now. */
-static __inline__ unsigned long ffz(unsigned long word)
+static inline unsigned long ffz(unsigned long word)
 {
 	unsigned long result = 0;
 
@@ -227,7 +251,7 @@
  * 'size' bits, starting the search at bit 'offset'. This is largely based
  * on Linus's ALPHA routines, which are pretty portable BTW.
  */
-static __inline__ unsigned long find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
+static inline unsigned long find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
 {
 	unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
 	unsigned long result = offset & ~31UL;
@@ -272,7 +296,7 @@
 #define find_first_zero_bit(addr, size) \
         find_next_zero_bit((addr), (size), 0)
 
-static __inline__ int test_le_bit(int nr, __const__ void * addr)
+static inline int test_le_bit(int nr, __const__ void * addr)
 {
 	__const__ unsigned char *ADDR = (__const__ unsigned char *) addr;
 	return (ADDR[nr >> 3] >> (nr & 7)) & 1;
@@ -281,7 +305,7 @@
 /*
  * non-atomic versions
  */
-static __inline__ void __set_le_bit(int nr, void *addr)
+static inline void __set_le_bit(int nr, void *addr)
 {
 	unsigned char *ADDR = (unsigned char *)addr;
 
@@ -289,7 +313,7 @@
 	*ADDR |= 1 << (nr & 0x07);
 }
 
-static __inline__ void __clear_le_bit(int nr, void *addr)
+static inline void __clear_le_bit(int nr, void *addr)
 {
 	unsigned char *ADDR = (unsigned char *)addr;
 
@@ -297,7 +321,7 @@
 	*ADDR &= ~(1 << (nr & 0x07));
 }
 
-static __inline__ int __test_and_set_le_bit(int nr, void *addr)
+static inline int __test_and_set_le_bit(int nr, void *addr)
 {
 	int mask, retval;
 	unsigned char *ADDR = (unsigned char *)addr;
@@ -309,7 +333,7 @@
 	return retval;
 }
 
-static __inline__ int __test_and_clear_le_bit(int nr, void *addr)
+static inline int __test_and_clear_le_bit(int nr, void *addr)
 {
 	int mask, retval;
 	unsigned char *ADDR = (unsigned char *)addr;
@@ -321,7 +345,7 @@
 	return retval;
 }
 
-static __inline__ unsigned long find_next_zero_le_bit(void *addr, unsigned long size, unsigned long offset)
+static inline unsigned long find_next_zero_le_bit(void *addr, unsigned long size, unsigned long offset)
 {
 	unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
 	unsigned long result = offset & ~31UL;
diff -urN linux-2.4.23-pre7/include/asm-sparc/checksum.h linux-2.4.23-pre8/include/asm-sparc/checksum.h
--- linux-2.4.23-pre7/include/asm-sparc/checksum.h	2002-08-02 17:39:45.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sparc/checksum.h	2003-10-23 03:33:18.000000000 -0700
@@ -48,23 +48,26 @@
   
 extern unsigned int __csum_partial_copy_sparc_generic (const char *, char *);
 
-extern __inline__ unsigned int 
+static inline unsigned int 
 csum_partial_copy_nocheck (const char *src, char *dst, int len, 
 			   unsigned int sum)
 {
 	register unsigned int ret asm("o0") = (unsigned int)src;
 	register char *d asm("o1") = dst;
 	register int l asm("g1") = len;
-	
+
 	__asm__ __volatile__ (
 		"call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
-		" mov %4, %%g7\n"
-	: "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (sum) :
-	"o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7");
+		" mov %6, %%g7\n"
+	: "=&r" (ret), "=&r" (d), "=&r" (l)
+	: "0" (ret), "1" (d), "2" (l), "r" (sum)
+	: "o2", "o3", "o4", "o5", "o7",
+	  "g2", "g3", "g4", "g5", "g7",
+	  "memory", "cc");
 	return ret;
 }
 
-extern __inline__ unsigned int 
+static inline unsigned int 
 csum_partial_copy_from_user(const char *src, char *dst, int len, 
 			    unsigned int sum, int *err)
   {
@@ -85,14 +88,16 @@
 		".previous\n"
 		"1:\n\t"
 		"call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
-		" st %5, [%%sp + 64]\n"
-		: "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) :
-		"o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7");
+		" st %8, [%%sp + 64]\n"
+		: "=&r" (ret), "=&r" (d), "=&r" (l), "=&r" (s)
+		: "0" (ret), "1" (d), "2" (l), "3" (s), "r" (err)
+		: "o2", "o3", "o4", "o5", "o7", "g2", "g3", "g4", "g5",
+		  "cc", "memory");
 		return ret;
 	}
   }
   
-extern __inline__ unsigned int 
+static inline unsigned int 
 csum_partial_copy_to_user(const char *src, char *dst, int len, 
 			  unsigned int sum, int *err)
 {
@@ -112,9 +117,12 @@
 		".previous\n"
 		"1:\n\t"
 		"call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
-		" st %5, [%%sp + 64]\n"
-		: "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) :
-		"o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7");
+		" st %8, [%%sp + 64]\n"
+		: "=&r" (ret), "=&r" (d), "=&r" (l), "=&r" (s)
+		: "0" (ret), "1" (d), "2" (l), "3" (s), "r" (err)
+		: "o2", "o3", "o4", "o5", "o7",
+		  "g2", "g3", "g4", "g5",
+		  "cc", "memory");
 		return ret;
 	}
 }
@@ -125,8 +133,8 @@
 /* ihl is always 5 or greater, almost always is 5, and iph is word aligned
  * the majority of the time.
  */
-extern __inline__ unsigned short ip_fast_csum(__const__ unsigned char *iph,
-					      unsigned int ihl)
+static inline unsigned short ip_fast_csum(const unsigned char *iph,
+					  unsigned int ihl)
 {
 	unsigned short sum;
 
@@ -163,7 +171,7 @@
 }
 
 /* Fold a partial checksum without adding pseudo headers. */
-extern __inline__ unsigned int csum_fold(unsigned int sum)
+static inline unsigned int csum_fold(unsigned int sum)
 {
 	unsigned int tmp;
 
@@ -177,11 +185,11 @@
 	return sum;
 }
 
-extern __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr,
-						   unsigned long daddr,
-						   unsigned int len,
-						   unsigned short proto,
-						   unsigned int sum)
+static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
+					       unsigned long daddr,
+					       unsigned int len,
+					       unsigned short proto,
+					       unsigned int sum)
 {
 	__asm__ __volatile__("addcc\t%1, %0, %0\n\t"
 			     "addxcc\t%2, %0, %0\n\t"
@@ -209,11 +217,11 @@
 
 #define _HAVE_ARCH_IPV6_CSUM
 
-static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
-						     struct in6_addr *daddr,
-						     __u32 len,
-						     unsigned short proto,
-						     unsigned int sum) 
+static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
+						 struct in6_addr *daddr,
+						 __u32 len,
+						 unsigned short proto,
+						 unsigned int sum) 
 {
 	__asm__ __volatile__ (
 		"addcc	%3, %4, %%g4\n\t"
@@ -244,7 +252,7 @@
 }
 
 /* this routine is used for miscellaneous IP-like checksums, mainly in icmp.c */
-extern __inline__ unsigned short ip_compute_csum(unsigned char * buff, int len)
+static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
 {
 	return csum_fold(csum_partial(buff, len, 0));
 }
diff -urN linux-2.4.23-pre7/include/asm-sparc/pgtsun4.h linux-2.4.23-pre8/include/asm-sparc/pgtsun4.h
--- linux-2.4.23-pre7/include/asm-sparc/pgtsun4.h	2000-06-19 17:59:39.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sparc/pgtsun4.h	2003-10-23 03:33:18.000000000 -0700
@@ -76,7 +76,7 @@
 
 #ifndef __ASSEMBLY__
 
-extern __inline__ unsigned long sun4c_get_synchronous_error(void)
+static inline unsigned long sun4c_get_synchronous_error(void)
 {
 	unsigned long sync_err;
 
@@ -86,7 +86,7 @@
 	return sync_err;
 }
 
-extern __inline__ unsigned long sun4c_get_synchronous_address(void)
+static inline unsigned long sun4c_get_synchronous_address(void)
 {
 	unsigned long sync_addr;
 
@@ -97,7 +97,7 @@
 }
 
 /* SUN4 pte, segmap, and context manipulation */
-extern __inline__ unsigned long sun4c_get_segmap(unsigned long addr)
+static inline unsigned long sun4c_get_segmap(unsigned long addr)
 {
   register unsigned long entry;
 
@@ -107,14 +107,15 @@
   return entry;
 }
 
-extern __inline__ void sun4c_put_segmap(unsigned long addr, unsigned long entry)
+static inline void sun4c_put_segmap(unsigned long addr, unsigned long entry)
 {
   __asm__ __volatile__("\n\tstha %1, [%0] %2; nop; nop; nop;\n\t" : :
 		       "r" (addr), "r" (entry),
-		       "i" (ASI_SEGMAP));
+		       "i" (ASI_SEGMAP)
+		       : "memory");
 }
 
-extern __inline__ unsigned long sun4c_get_pte(unsigned long addr)
+static inline unsigned long sun4c_get_pte(unsigned long addr)
 {
   register unsigned long entry;
 
@@ -124,14 +125,15 @@
   return entry;
 }
 
-extern __inline__ void sun4c_put_pte(unsigned long addr, unsigned long entry)
+static inline void sun4c_put_pte(unsigned long addr, unsigned long entry)
 {
   __asm__ __volatile__("\n\tsta %1, [%0] %2; nop; nop; nop;\n\t" : :
 		       "r" (addr), 
-		       "r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE));
+		       "r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE)
+		       : "memory");
 }
 
-extern __inline__ int sun4c_get_context(void)
+static inline int sun4c_get_context(void)
 {
   register int ctx;
 
@@ -142,10 +144,11 @@
   return ctx;
 }
 
-extern __inline__ int sun4c_set_context(int ctx)
+static inline int sun4c_set_context(int ctx)
 {
   __asm__ __volatile__("\n\tstba %0, [%1] %2; nop; nop; nop;\n\t" : :
-		       "r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL));
+		       "r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL)
+		       : "memory");
 
   return ctx;
 }
diff -urN linux-2.4.23-pre7/include/asm-sparc/pgtsun4c.h linux-2.4.23-pre8/include/asm-sparc/pgtsun4c.h
--- linux-2.4.23-pre7/include/asm-sparc/pgtsun4c.h	2000-06-19 17:59:39.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sparc/pgtsun4c.h	2003-10-23 03:33:18.000000000 -0700
@@ -75,7 +75,7 @@
 
 #ifndef __ASSEMBLY__
 
-extern __inline__ unsigned long sun4c_get_synchronous_error(void)
+static inline unsigned long sun4c_get_synchronous_error(void)
 {
 	unsigned long sync_err;
 
@@ -85,7 +85,7 @@
 	return sync_err;
 }
 
-extern __inline__ unsigned long sun4c_get_synchronous_address(void)
+static inline unsigned long sun4c_get_synchronous_address(void)
 {
 	unsigned long sync_addr;
 
@@ -96,7 +96,7 @@
 }
 
 /* SUN4C pte, segmap, and context manipulation */
-extern __inline__ unsigned long sun4c_get_segmap(unsigned long addr)
+static inline unsigned long sun4c_get_segmap(unsigned long addr)
 {
   register unsigned long entry;
 
@@ -107,15 +107,16 @@
   return entry;
 }
 
-extern __inline__ void sun4c_put_segmap(unsigned long addr, unsigned long entry)
+static inline void sun4c_put_segmap(unsigned long addr, unsigned long entry)
 {
 
   __asm__ __volatile__("\n\tstba %1, [%0] %2; nop; nop; nop;\n\t" : :
 		       "r" (addr), "r" (entry),
-		       "i" (ASI_SEGMAP));
+		       "i" (ASI_SEGMAP)
+		       : "memory");
 }
 
-extern __inline__ unsigned long sun4c_get_pte(unsigned long addr)
+static inline unsigned long sun4c_get_pte(unsigned long addr)
 {
   register unsigned long entry;
 
@@ -125,14 +126,15 @@
   return entry;
 }
 
-extern __inline__ void sun4c_put_pte(unsigned long addr, unsigned long entry)
+static inline void sun4c_put_pte(unsigned long addr, unsigned long entry)
 {
   __asm__ __volatile__("\n\tsta %1, [%0] %2; nop; nop; nop;\n\t" : :
 		       "r" (addr), 
-		       "r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE));
+		       "r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE)
+		       : "memory");
 }
 
-extern __inline__ int sun4c_get_context(void)
+static inline int sun4c_get_context(void)
 {
   register int ctx;
 
@@ -143,10 +145,11 @@
   return ctx;
 }
 
-extern __inline__ int sun4c_set_context(int ctx)
+static inline int sun4c_set_context(int ctx)
 {
   __asm__ __volatile__("\n\tstba %0, [%1] %2; nop; nop; nop;\n\t" : :
-		       "r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL));
+		       "r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL)
+		       : "memory");
 
   return ctx;
 }
diff -urN linux-2.4.23-pre7/include/asm-sparc/processor.h linux-2.4.23-pre8/include/asm-sparc/processor.h
--- linux-2.4.23-pre7/include/asm-sparc/processor.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sparc/processor.h	2003-10-23 03:33:18.000000000 -0700
@@ -140,8 +140,12 @@
 			     "std\t%%g0, [%0 + %3 + 0x30]\n\t"
 			     "st\t%1, [%0 + %3 + 0x38]\n\t"
 			     "st\t%%g0, [%0 + %3 + 0x3c]"
-			     : : "r" (regs), "r" (sp - sizeof(struct reg_window)), "r" (zero),
-			     "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0])));
+			     : /* no outputs */
+			     : "r" (regs),
+			       "r" (sp - sizeof(struct reg_window)),
+			       "r" (zero),
+			       "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))
+			     : "memory");
 }
 
 /* Free all resources held by a thread. */
diff -urN linux-2.4.23-pre7/include/asm-sparc/ross.h linux-2.4.23-pre8/include/asm-sparc/ross.h
--- linux-2.4.23-pre7/include/asm-sparc/ross.h	1998-01-12 15:15:54.000000000 -0800
+++ linux-2.4.23-pre8/include/asm-sparc/ross.h	2003-10-23 03:33:18.000000000 -0700
@@ -96,27 +96,29 @@
 
 #ifndef __ASSEMBLY__
 
-extern __inline__ unsigned int get_ross_icr(void)
+static inline unsigned int get_ross_icr(void)
 {
 	unsigned int icreg;
 
 	__asm__ __volatile__(".word 0x8347c000\n\t" /* rd %iccr, %g1 */
-			     "mov %%g1, %0\n\t" :
-			     "=r" (icreg) : :
-			     "g1", "memory");
+			     "mov %%g1, %0\n\t"
+			     : "=r" (icreg)
+			     : /* no inputs */
+			     : "g1", "memory");
 
 	return icreg;
 }
 
-extern __inline__ void put_ross_icr(unsigned int icreg)
+static inline void put_ross_icr(unsigned int icreg)
 {
 	__asm__ __volatile__("or %%g0, %0, %%g1\n\t"
 			     ".word 0xbf806000\n\t" /* wr %g1, 0x0, %iccr */
 			     "nop\n\t"
 			     "nop\n\t"
-			     "nop\n\t" : : 
-			     "r" (icreg) :
-			     "g1", "memory");
+			     "nop\n\t"
+			     : /* no outputs */
+			     : "r" (icreg)
+			     : "g1", "memory");
 
 	return;
 }
@@ -124,52 +126,62 @@
 /* HyperSparc specific cache flushing. */
 
 /* This is for the on-chip instruction cache. */
-extern __inline__ void hyper_flush_whole_icache(void)
+static inline void hyper_flush_whole_icache(void)
 {
-	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :
-			     "i" (ASI_M_FLUSH_IWHOLE));
+	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
+			     : /* no outputs */
+			     : "i" (ASI_M_FLUSH_IWHOLE)
+			     : "memory");
 	return;
 }
 
 extern int vac_cache_size;
 extern int vac_line_size;
 
-extern __inline__ void hyper_clear_all_tags(void)
+static inline void hyper_clear_all_tags(void)
 {
 	unsigned long addr;
 
 	for(addr = 0; addr < vac_cache_size; addr += vac_line_size)
-		__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-				     "r" (addr), "i" (ASI_M_DATAC_TAG));
+		__asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+				     : /* no outputs */
+				     : "r" (addr), "i" (ASI_M_DATAC_TAG)
+				     : "memory");
 }
 
-extern __inline__ void hyper_flush_unconditional_combined(void)
+static inline void hyper_flush_unconditional_combined(void)
 {
 	unsigned long addr;
 
-	for(addr = 0; addr < vac_cache_size; addr += vac_line_size)
-		__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-				     "r" (addr), "i" (ASI_M_FLUSH_CTX));
+	for (addr = 0; addr < vac_cache_size; addr += vac_line_size)
+		__asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+				     : /* no outputs */
+				     : "r" (addr), "i" (ASI_M_FLUSH_CTX)
+				     : "memory");
 }
 
-extern __inline__ void hyper_flush_cache_user(void)
+static inline void hyper_flush_cache_user(void)
 {
 	unsigned long addr;
 
-	for(addr = 0; addr < vac_cache_size; addr += vac_line_size)
-		__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-				     "r" (addr), "i" (ASI_M_FLUSH_USER));
+	for (addr = 0; addr < vac_cache_size; addr += vac_line_size)
+		__asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+				     : /* no outputs */
+				     : "r" (addr), "i" (ASI_M_FLUSH_USER)
+				     : "memory");
 }
 
-extern __inline__ void hyper_flush_cache_page(unsigned long page)
+static inline void hyper_flush_cache_page(unsigned long page)
 {
 	unsigned long end;
 
 	page &= PAGE_MASK;
 	end = page + PAGE_SIZE;
-	while(page < end) {
-		__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-				     "r" (page), "i" (ASI_M_FLUSH_PAGE));
+	while (page < end) {
+		__asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+				     : /* no outputs */
+				     : "r" (page), "i" (ASI_M_FLUSH_PAGE)
+				     : "memory");
 		page += vac_line_size;
 	}
 }
diff -urN linux-2.4.23-pre7/include/asm-sparc/swift.h linux-2.4.23-pre8/include/asm-sparc/swift.h
--- linux-2.4.23-pre7/include/asm-sparc/swift.h	1996-11-09 00:30:13.000000000 -0800
+++ linux-2.4.23-pre8/include/asm-sparc/swift.h	2003-10-23 03:33:18.000000000 -0700
@@ -27,68 +27,80 @@
 #define SWIFT_EN       0x00000001   /* MMU enable */
 
 /* Bits [13:5] select one of 512 instruction cache tags */
-extern __inline__ void swift_inv_insn_tag(unsigned long addr)
+static inline void swift_inv_insn_tag(unsigned long addr)
 {
-	__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-			     "r" (addr), "i" (ASI_M_TXTC_TAG));
+	__asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+			     : /* no outputs */
+			     : "r" (addr), "i" (ASI_M_TXTC_TAG)
+			     : "memory");
 }
 
 /* Bits [12:4] select one of 512 data cache tags */
-extern __inline__ void swift_inv_data_tag(unsigned long addr)
+static inline void swift_inv_data_tag(unsigned long addr)
 {
-	__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-			     "r" (addr), "i" (ASI_M_DATAC_TAG));
+	__asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+			     : /* no outputs */
+			     : "r" (addr), "i" (ASI_M_DATAC_TAG)
+			     : "memory");
 }
 
-extern __inline__ void swift_flush_dcache(void)
+static inline void swift_flush_dcache(void)
 {
 	unsigned long addr;
 
-	for(addr = 0; addr < 0x2000; addr += 0x10)
+	for (addr = 0; addr < 0x2000; addr += 0x10)
 		swift_inv_data_tag(addr);
 }
 
-extern __inline__ void swift_flush_icache(void)
+static inline void swift_flush_icache(void)
 {
 	unsigned long addr;
 
-	for(addr = 0; addr < 0x4000; addr += 0x20)
+	for (addr = 0; addr < 0x4000; addr += 0x20)
 		swift_inv_insn_tag(addr);
 }
 
-extern __inline__ void swift_idflash_clear(void)
+static inline void swift_idflash_clear(void)
 {
 	unsigned long addr;
 
-	for(addr = 0; addr < 0x2000; addr += 0x10) {
+	for (addr = 0; addr < 0x2000; addr += 0x10) {
 		swift_inv_insn_tag(addr<<1);
 		swift_inv_data_tag(addr);
 	}
 }
 
 /* Swift is so broken, it isn't even safe to use the following. */
-extern __inline__ void swift_flush_page(unsigned long page)
+static inline void swift_flush_page(unsigned long page)
 {
-	__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-			     "r" (page), "i" (ASI_M_FLUSH_PAGE));
+	__asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+			     : /* no outputs */
+			     : "r" (page), "i" (ASI_M_FLUSH_PAGE)
+			     : "memory");
 }
 
-extern __inline__ void swift_flush_segment(unsigned long addr)
+static inline void swift_flush_segment(unsigned long addr)
 {
-	__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-			     "r" (addr), "i" (ASI_M_FLUSH_SEG));
+	__asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+			     : /* no outputs */
+			     : "r" (addr), "i" (ASI_M_FLUSH_SEG)
+			     : "memory");
 }
 
-extern __inline__ void swift_flush_region(unsigned long addr)
+static inline void swift_flush_region(unsigned long addr)
 {
-	__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-			     "r" (addr), "i" (ASI_M_FLUSH_REGION));
+	__asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+			     : /* no outputs */
+			     : "r" (addr), "i" (ASI_M_FLUSH_REGION)
+			     : "memory");
 }
 
-extern __inline__ void swift_flush_context(void)
+static inline void swift_flush_context(void)
 {
-	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :
-			     "i" (ASI_M_FLUSH_CTX));
+	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
+			     : /* no outputs */
+			     : "i" (ASI_M_FLUSH_CTX)
+			     : "memory");
 }
 
 #endif /* !(_SPARC_SWIFT_H) */
diff -urN linux-2.4.23-pre7/include/asm-sparc/system.h linux-2.4.23-pre8/include/asm-sparc/system.h
--- linux-2.4.23-pre7/include/asm-sparc/system.h	2003-06-13 07:51:38.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sparc/system.h	2003-10-23 03:33:18.000000000 -0700
@@ -217,7 +217,7 @@
 		"wr	%0, %2, %%psr\n\t"
 		"nop; nop; nop;\n"
 		"1:\n"
-		: "=r" (retval)
+		: "=&r" (retval)
 		: "r" (__new_psr), "i" (PSR_PIL)
 		: "g1", "g2", "memory", "cc");
 
@@ -315,7 +315,8 @@
 #ifdef CONFIG_SMP
 	__asm__ __volatile__("swap [%2], %0"
 			     : "=&r" (val)
-			     : "0" (val), "r" (m));
+			     : "0" (val), "r" (m)
+			     : "memory");
 	return val;
 #else
 	register unsigned long *ptr asm("g1");
diff -urN linux-2.4.23-pre7/include/asm-sparc/tsunami.h linux-2.4.23-pre8/include/asm-sparc/tsunami.h
--- linux-2.4.23-pre7/include/asm-sparc/tsunami.h	1996-11-09 00:30:19.000000000 -0800
+++ linux-2.4.23-pre8/include/asm-sparc/tsunami.h	2003-10-23 03:33:18.000000000 -0700
@@ -45,16 +45,20 @@
 #define TSUNAMI_NF        0x00000002
 #define TSUNAMI_ME        0x00000001
 
-extern __inline__ void tsunami_flush_icache(void)
+static inline void tsunami_flush_icache(void)
 {
-	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :
-			     "i" (ASI_M_IC_FLCLEAR) : "memory");
+	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
+			     : /* no outputs */
+			     : "i" (ASI_M_IC_FLCLEAR)
+			     : "memory");
 }
 
-extern __inline__ void tsunami_flush_dcache(void)
+static inline void tsunami_flush_dcache(void)
 {
-	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :
-			     "i" (ASI_M_DC_FLCLEAR) : "memory");
+	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
+			     : /* no outputs */
+			     : "i" (ASI_M_DC_FLCLEAR)
+			     : "memory");
 }
 
 #endif /* !(_SPARC_TSUNAMI_H) */
diff -urN linux-2.4.23-pre7/include/asm-sparc/turbosparc.h linux-2.4.23-pre8/include/asm-sparc/turbosparc.h
--- linux-2.4.23-pre7/include/asm-sparc/turbosparc.h	1998-10-04 10:22:44.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sparc/turbosparc.h	2003-10-23 03:33:18.000000000 -0700
@@ -59,60 +59,64 @@
 #ifndef __ASSEMBLY__
 
 /* Bits [13:5] select one of 512 instruction cache tags */
-extern __inline__ void turbosparc_inv_insn_tag(unsigned long addr)
+static inline void turbosparc_inv_insn_tag(unsigned long addr)
 {
-        __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-                             "r" (addr), "i" (ASI_M_TXTC_TAG));
+        __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+			     : /* no outputs */
+			     : "r" (addr), "i" (ASI_M_TXTC_TAG)
+			     : "memory");
 }
 
 /* Bits [13:5] select one of 512 data cache tags */
-extern __inline__ void turbosparc_inv_data_tag(unsigned long addr)
+static inline void turbosparc_inv_data_tag(unsigned long addr)
 {
-        __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-                             "r" (addr), "i" (ASI_M_DATAC_TAG));
+        __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+			     : /* no outputs */
+			     : "r" (addr), "i" (ASI_M_DATAC_TAG)
+			     : "memory");
 }
 
-extern __inline__ void turbosparc_flush_icache(void)
+static inline void turbosparc_flush_icache(void)
 {
 	unsigned long addr;
 
-        for(addr = 0; addr < 0x4000; addr += 0x20)
+        for (addr = 0; addr < 0x4000; addr += 0x20)
                 turbosparc_inv_insn_tag(addr);
 }
 
-extern __inline__ void turbosparc_flush_dcache(void)
+static inline void turbosparc_flush_dcache(void)
 {
 	unsigned long addr;
 
-        for(addr = 0; addr < 0x4000; addr += 0x20)
+        for (addr = 0; addr < 0x4000; addr += 0x20)
                 turbosparc_inv_data_tag(addr);
 }
 
-extern __inline__ void turbosparc_idflash_clear(void)
+static inline void turbosparc_idflash_clear(void)
 {
 	unsigned long addr;
 
-        for(addr = 0; addr < 0x4000; addr += 0x20) {
+        for (addr = 0; addr < 0x4000; addr += 0x20) {
                 turbosparc_inv_insn_tag(addr);
                 turbosparc_inv_data_tag(addr);
 	}
 }
 
-extern __inline__ void turbosparc_set_ccreg(unsigned long regval)
+static inline void turbosparc_set_ccreg(unsigned long regval)
 {
-	__asm__ __volatile__("sta %0, [%1] %2\n\t" : :
-			     "r" (regval), "r" (0x600),
-			     "i" (ASI_M_MMUREGS));
+	__asm__ __volatile__("sta %0, [%1] %2\n\t"
+			     : /* no outputs */
+			     : "r" (regval), "r" (0x600), "i" (ASI_M_MMUREGS)
+			     : "memory");
 }
 
-extern __inline__ unsigned long turbosparc_get_ccreg(void)
+static inline unsigned long turbosparc_get_ccreg(void)
 {
 	unsigned long regval;
 
-	__asm__ __volatile__("lda [%1] %2, %0\n\t" :
-			     "=r" (regval) :
-			     "r" (0x600),
-			     "i" (ASI_M_MMUREGS));
+	__asm__ __volatile__("lda [%1] %2, %0\n\t"
+			     : "=r" (regval)
+			     : "r" (0x600), "i" (ASI_M_MMUREGS));
 	return regval;
 }
 
diff -urN linux-2.4.23-pre7/include/asm-sparc/vac-ops.h linux-2.4.23-pre8/include/asm-sparc/vac-ops.h
--- linux-2.4.23-pre7/include/asm-sparc/vac-ops.h	2003-06-13 07:51:38.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sparc/vac-ops.h	2003-10-23 03:33:18.000000000 -0700
@@ -108,27 +108,29 @@
 extern struct sun4c_vac_props sun4c_vacinfo;
 
 /* sun4c_enable_vac() enables the sun4c virtual address cache. */
-extern __inline__ void sun4c_enable_vac(void)
+static inline void sun4c_enable_vac(void)
 {
-  __asm__ __volatile__("lduba [%0] %1, %%g1\n\t"
-		       "or    %%g1, %2, %%g1\n\t"
-		       "stba  %%g1, [%0] %1\n\t" : :
-		       "r" ((unsigned int) AC_SENABLE),
-		       "i" (ASI_CONTROL), "i" (SENABLE_CACHE) :
-		       "g1");
-  sun4c_vacinfo.on = 1;
+	__asm__ __volatile__("lduba [%0] %1, %%g1\n\t"
+			     "or    %%g1, %2, %%g1\n\t"
+			     "stba  %%g1, [%0] %1\n\t"
+			     : /* no outputs */
+			     : "r" ((unsigned int) AC_SENABLE),
+			     "i" (ASI_CONTROL), "i" (SENABLE_CACHE)
+			     : "g1", "memory");
+	sun4c_vacinfo.on = 1;
 }
 
 /* sun4c_disable_vac() disables the virtual address cache. */
-extern __inline__ void sun4c_disable_vac(void)
+static inline void sun4c_disable_vac(void)
 {
-  __asm__ __volatile__("lduba [%0] %1, %%g1\n\t"
-		       "andn  %%g1, %2, %%g1\n\t"
-		       "stba  %%g1, [%0] %1\n\t" : :
-		       "r" ((unsigned int) AC_SENABLE),
-		       "i" (ASI_CONTROL), "i" (SENABLE_CACHE) :
-		       "g1");
-  sun4c_vacinfo.on = 0;
+	__asm__ __volatile__("lduba [%0] %1, %%g1\n\t"
+			     "andn  %%g1, %2, %%g1\n\t"
+			     "stba  %%g1, [%0] %1\n\t"
+			     : /* no outputs */
+			     : "r" ((unsigned int) AC_SENABLE),
+			     "i" (ASI_CONTROL), "i" (SENABLE_CACHE)
+			     : "g1", "memory");
+	sun4c_vacinfo.on = 0;
 }
 
 #endif /* !(_SPARC_VAC_OPS_H) */
diff -urN linux-2.4.23-pre7/include/asm-sparc/viking.h linux-2.4.23-pre8/include/asm-sparc/viking.h
--- linux-2.4.23-pre7/include/asm-sparc/viking.h	1997-04-23 19:01:28.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sparc/viking.h	2003-10-23 03:33:18.000000000 -0700
@@ -110,48 +110,57 @@
 
 #ifndef __ASSEMBLY__
 
-extern __inline__ void viking_flush_icache(void)
+static inline void viking_flush_icache(void)
 {
-	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :
-			     "i" (ASI_M_IC_FLCLEAR));
+	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
+			     : /* no outputs */
+			     : "i" (ASI_M_IC_FLCLEAR)
+			     : "memory");
 }
 
-extern __inline__ void viking_flush_dcache(void)
+static inline void viking_flush_dcache(void)
 {
-	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :
-			     "i" (ASI_M_DC_FLCLEAR));
+	__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
+			     : /* no outputs */
+			     : "i" (ASI_M_DC_FLCLEAR)
+			     : "memory");
 }
 
-extern __inline__ void viking_unlock_icache(void)
+static inline void viking_unlock_icache(void)
 {
-	__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-			     "r" (0x80000000), "i" (ASI_M_IC_FLCLEAR));
+	__asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+			     : /* no outputs */
+			     : "r" (0x80000000), "i" (ASI_M_IC_FLCLEAR)
+			     : "memory");
 }
 
-extern __inline__ void viking_unlock_dcache(void)
+static inline void viking_unlock_dcache(void)
 {
-	__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
-			     "r" (0x80000000), "i" (ASI_M_DC_FLCLEAR));
+	__asm__ __volatile__("sta %%g0, [%0] %1\n\t"
+			     : /* no outputs */
+			     : "r" (0x80000000), "i" (ASI_M_DC_FLCLEAR)
+			     : "memory");
 }
 
-extern __inline__ void viking_set_bpreg(unsigned long regval)
+static inline void viking_set_bpreg(unsigned long regval)
 {
-	__asm__ __volatile__("sta %0, [%%g0] %1\n\t" : :
-			     "r" (regval),
-			     "i" (ASI_M_ACTION));
+	__asm__ __volatile__("sta %0, [%%g0] %1\n\t"
+			     : /* no outputs */
+			     : "r" (regval), "i" (ASI_M_ACTION)
+			     : "memory");
 }
 
-extern __inline__ unsigned long viking_get_bpreg(void)
+static inline unsigned long viking_get_bpreg(void)
 {
 	unsigned long regval;
 
-	__asm__ __volatile__("lda [%%g0] %1, %0\n\t" :
-			     "=r" (regval) :
-			     "i" (ASI_M_ACTION));
+	__asm__ __volatile__("lda [%%g0] %1, %0\n\t"
+			     : "=r" (regval)
+			     : "i" (ASI_M_ACTION));
 	return regval;
 }
 
-extern __inline__ void viking_get_dcache_ptag(int set, int block,
+static inline void viking_get_dcache_ptag(int set, int block,
 					      unsigned long *data)
 {
 	unsigned long ptag = ((set & 0x7f) << 5) | ((block & 0x3) << 26) |
@@ -160,15 +169,15 @@
 
 	__asm__ __volatile__ ("ldda [%2] %3, %%g2\n\t"
 			      "or %%g0, %%g2, %0\n\t"
-			      "or %%g0, %%g3, %1\n\t" :
-			      "=r" (info), "=r" (page) :
-			      "r" (ptag), "i" (ASI_M_DATAC_TAG) :
-			      "g2", "g3");
+			      "or %%g0, %%g3, %1\n\t"
+			      : "=r" (info), "=r" (page)
+			      : "r" (ptag), "i" (ASI_M_DATAC_TAG)
+			      : "g2", "g3");
 	data[0] = info;
 	data[1] = page;
 }
 
-extern __inline__ void viking_mxcc_turn_off_parity(unsigned long *mregp,
+static inline void viking_mxcc_turn_off_parity(unsigned long *mregp,
 						   unsigned long *mxcc_cregp)
 {
 	unsigned long mreg = *mregp;
@@ -190,30 +199,32 @@
 			      "2:\n\t"
 			      "sta %0, [%%g0] %3\n\t"
 			      "sta %1, [%2] %4\n"
-			      "1:\n\t" : :
-			      "r" (mreg), "r" (mxcc_creg),
-			      "r" (MXCC_CREG), "i" (ASI_M_MMUREGS),
-			      "i" (ASI_M_MXCC) : "g2", "cc");
+			      "1:\n\t"
+			      : /* no output */
+			      : "r" (mreg), "r" (mxcc_creg),
+			        "r" (MXCC_CREG), "i" (ASI_M_MMUREGS),
+			        "i" (ASI_M_MXCC)
+			      : "g2", "memory", "cc");
 	*mregp = mreg;
 	*mxcc_cregp = mxcc_creg;
 }
 
-extern __inline__ unsigned long viking_hwprobe(unsigned long vaddr)
+static inline unsigned long viking_hwprobe(unsigned long vaddr)
 {
 	unsigned long val;
 
 	vaddr &= PAGE_MASK;
 	/* Probe all MMU entries. */
-	__asm__ __volatile__("lda [%1] %2, %0\n\t" :
-			     "=r" (val) :
-			     "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE));
+	__asm__ __volatile__("lda [%1] %2, %0\n\t"
+			     : "=r" (val)
+			     : "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE));
 	if (!val)
 		return 0;
 
 	/* Probe region. */
-	__asm__ __volatile__("lda [%1] %2, %0\n\t" :
-			     "=r" (val) :
-			     "r" (vaddr | 0x200), "i" (ASI_M_FLUSH_PROBE));
+	__asm__ __volatile__("lda [%1] %2, %0\n\t"
+			     : "=r" (val)
+			     : "r" (vaddr | 0x200), "i" (ASI_M_FLUSH_PROBE));
 	if ((val & SRMMU_ET_MASK) == SRMMU_ET_PTE) {
 		vaddr &= ~SRMMU_PGDIR_MASK;
 		vaddr >>= PAGE_SHIFT;
@@ -221,9 +232,9 @@
 	}
 
 	/* Probe segment. */
-	__asm__ __volatile__("lda [%1] %2, %0\n\t" :
-			     "=r" (val) :
-			     "r" (vaddr | 0x100), "i" (ASI_M_FLUSH_PROBE));
+	__asm__ __volatile__("lda [%1] %2, %0\n\t"
+			     : "=r" (val)
+			     : "r" (vaddr | 0x100), "i" (ASI_M_FLUSH_PROBE));
 	if ((val & SRMMU_ET_MASK) == SRMMU_ET_PTE) {
 		vaddr &= ~SRMMU_PMD_MASK;
 		vaddr >>= PAGE_SHIFT;
@@ -231,9 +242,9 @@
 	}
 
 	/* Probe page. */
-	__asm__ __volatile__("lda [%1] %2, %0\n\t" :
-			     "=r" (val) :
-			     "r" (vaddr), "i" (ASI_M_FLUSH_PROBE));
+	__asm__ __volatile__("lda [%1] %2, %0\n\t"
+			     : "=r" (val)
+			     : "r" (vaddr), "i" (ASI_M_FLUSH_PROBE));
 	return val;
 }
 
diff -urN linux-2.4.23-pre7/include/asm-sparc64/processor.h linux-2.4.23-pre8/include/asm-sparc64/processor.h
--- linux-2.4.23-pre7/include/asm-sparc64/processor.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sparc64/processor.h	2003-10-23 03:33:18.000000000 -0700
@@ -109,6 +109,7 @@
 #define SPARC_FLAG_NEWCHILD     0x08    /* task is just-spawned child process	*/
 #define SPARC_FLAG_PERFCTR	0x10    /* task has performance counters active	*/
 #define SPARC_FLAG_ABI_PENDING	0x20    /* change of SPARC_FLAG_32BIT pending	*/
+#define SPARC_FLAG_SYS_SUCCESS	0x40    /* Force successful syscall return.	*/
 
 #define FAULT_CODE_WRITE	0x01	/* Write access, implies D-TLB		*/
 #define FAULT_CODE_DTLB		0x02	/* Miss happened in D-TLB		*/
diff -urN linux-2.4.23-pre7/include/asm-sparc64/ptrace.h linux-2.4.23-pre8/include/asm-sparc64/ptrace.h
--- linux-2.4.23-pre7/include/asm-sparc64/ptrace.h	2003-06-13 07:51:38.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sparc64/ptrace.h	2003-10-23 03:33:18.000000000 -0700
@@ -97,6 +97,10 @@
 #define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV))
 #define instruction_pointer(regs) ((regs)->tpc)
 extern void show_regs(struct pt_regs *);
+#define force_successful_syscall_return() \
+do { \
+	current->thread.flags |= SPARC_FLAG_SYS_SUCCESS; \
+} while (0)
 #endif
 
 #else /* __ASSEMBLY__ */
diff -urN linux-2.4.23-pre7/include/asm-sparc64/visasm.h linux-2.4.23-pre8/include/asm-sparc64/visasm.h
--- linux-2.4.23-pre7/include/asm-sparc64/visasm.h	2001-04-26 22:17:26.000000000 -0700
+++ linux-2.4.23-pre8/include/asm-sparc64/visasm.h	2003-10-23 03:33:18.000000000 -0700
@@ -19,7 +19,8 @@
 	andcc		%o5, (FPRS_FEF|FPRS_DU), %g0;	\
 	be,pt		%icc, 297f;			\
 	 sethi		%hi(297f), %g7;			\
-	ba,pt		%xcc, VISenter;			\
+	sethi		%hi(VISenter), %g1;		\
+	jmpl		%g1 + %lo(VISenter), %g0;	\
 	 or		%g7, %lo(297f), %g7;		\
 297:	wr		%g0, FPRS_FEF, %fprs;		\
 
@@ -34,7 +35,8 @@
 	andcc		%o5, FPRS_FEF, %g0;		\
 	be,pt		%icc, 297f;			\
 	 sethi		%hi(298f), %g7;			\
-	ba,pt		%xcc, VISenterhalf;		\
+	sethi		%hi(VISenterhalf), %g1;		\
+	jmpl		%g1 + %lo(VISenterhalf), %g0;	\
 	 or		%g7, %lo(298f), %g7;		\
 	clr		%o5;				\
 297:	wr		%o5, FPRS_FEF, %fprs;		\
@@ -50,7 +52,8 @@
 "		andcc %%o5, %0, %%g0\n"
 "		be,pt %%icc, 299f\n"
 "		 sethi %%hi(298f), %%g7\n"
-"		ba VISenter	! Note. This cannot be bp, as it may be too far from VISenter.\n"
+"		sethi %%hi(VISenter), %%g1\n"
+"		jmpl %%g1 + %%lo(VISenter), %%g0\n"
 "		 or %%g7, %%lo(298f), %%g7\n"
 "	298:	wr %%g0, 0, %%fprs\n"
 "	299:\n"
diff -urN linux-2.4.23-pre7/include/linux/atmdev.h linux-2.4.23-pre8/include/linux/atmdev.h
--- linux-2.4.23-pre7/include/linux/atmdev.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/include/linux/atmdev.h	2003-10-23 03:33:18.000000000 -0700
@@ -296,15 +296,11 @@
 	struct k_atm_aal_stats *stats;	/* pointer to AAL stats group */
 	wait_queue_head_t sleep;	/* if socket is busy */
 	struct sock	*sk;		/* socket backpointer */
-	struct atm_vcc	*prev,*next;
 	/* SVC part --- may move later ------------------------------------- */
 	short		itf;		/* interface number */
 	struct sockaddr_atmsvc local;
 	struct sockaddr_atmsvc remote;
 	void (*callback)(struct atm_vcc *vcc);
-	struct sk_buff_head listenq;
-	int		backlog_quota;	/* number of connection requests we */
-					/* can still accept */
 	int		reply;		/* also used by ATMTCP */
 	/* Multipoint part ------------------------------------------------- */
 	struct atm_vcc	*session;	/* session VCC descriptor */
@@ -330,8 +326,6 @@
 					/* (NULL) */
 	const char	*type;		/* device type name */
 	int		number;		/* device index */
-	struct atm_vcc	*vccs;		/* VCC table (or NULL) */
-	struct atm_vcc	*last;		/* last VCC (or undefined) */
 	void		*dev_data;	/* per-device data */
 	void		*phy_data;	/* private PHY date */
 	atm_dev_flags_t flags;		/* device flags (ATM_DF_*) */
@@ -400,6 +394,9 @@
 	unsigned long	atm_options;	/* ATM layer options */
 };
 
+extern struct sock *vcc_sklist;
+extern rwlock_t vcc_sklist_lock;
+
 #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb))
 
 struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops,
@@ -407,7 +404,8 @@
 struct atm_dev *atm_dev_lookup(int number);
 void atm_dev_deregister(struct atm_dev *dev);
 void shutdown_atm_dev(struct atm_dev *dev);
-void bind_vcc(struct atm_vcc *vcc,struct atm_dev *dev);
+void vcc_insert_socket(struct sock *sk);
+void vcc_remove_socket(struct sock *sk);
 
 
 /*
@@ -445,7 +443,7 @@
 }
 
 
-static inline void atm_dev_release(struct atm_dev *dev)
+static inline void atm_dev_put(struct atm_dev *dev)
 {
 	atomic_dec(&dev->refcnt);
 
@@ -461,7 +459,7 @@
 int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci);
 int atm_pcr_goal(struct atm_trafprm *tp);
 
-void atm_async_release_vcc(struct atm_vcc *vcc,int reply);
+void vcc_release_async(struct atm_vcc *vcc, int reply);
 
 #endif /* __KERNEL__ */
 
diff -urN linux-2.4.23-pre7/include/linux/ethtool.h linux-2.4.23-pre8/include/linux/ethtool.h
--- linux-2.4.23-pre7/include/linux/ethtool.h	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/include/linux/ethtool.h	2003-10-23 03:33:18.000000000 -0700
@@ -303,14 +303,14 @@
  *
  * get_eeprom:
  *	Should fill in the magic field.  Don't need to check len for zero
- *	or wraparound but must check offset + len < size.  Fill in the data
- *	argument with the eeprom values from offset to offset + len.  Update
- *	len to the amount read.  Returns an error or zero.
+ *	or wraparound.  Fill in the data argument with the eeprom values
+ *	from offset to offset + len.  Update len to the amount read.
+ *	Returns an error or zero.
  *
  * set_eeprom:
  *	Should validate the magic field.  Don't need to check len for zero
- *	or wraparound but must check offset + len < size.  Update len to
- *	the amount written.  Returns an error or zero.
+ *	or wraparound.  Update len to the amount written.  Returns an error
+ *	or zero.
  */
 struct ethtool_ops {
 	int	(*get_settings)(struct net_device *, struct ethtool_cmd *);
@@ -324,6 +324,7 @@
 	void	(*set_msglevel)(struct net_device *, u32);
 	int	(*nway_reset)(struct net_device *);
 	u32	(*get_link)(struct net_device *);
+	int	(*get_eeprom_len)(struct net_device *);
 	int	(*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
 	int	(*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
 	int	(*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
diff -urN linux-2.4.23-pre7/include/linux/in.h linux-2.4.23-pre8/include/linux/in.h
--- linux-2.4.23-pre7/include/linux/in.h	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/include/linux/in.h	2003-10-23 03:33:18.000000000 -0700
@@ -19,6 +19,7 @@
 #define _LINUX_IN_H
 
 #include <linux/types.h>
+#include <linux/socket.h>
 
 /* Standard well-defined IP protocols.  */
 enum {
diff -urN linux-2.4.23-pre7/include/linux/nfs_xdr.h linux-2.4.23-pre8/include/linux/nfs_xdr.h
--- linux-2.4.23-pre7/include/linux/nfs_xdr.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/include/linux/nfs_xdr.h	2003-10-23 03:33:18.000000000 -0700
@@ -109,8 +109,6 @@
 	const char *		name;
 	unsigned int		len;
 	int			eof;
-	struct nfs_fh		fh;
-	struct nfs_fattr	fattr;
 };
 
 /*
diff -urN linux-2.4.23-pre7/include/linux/pci_ids.h linux-2.4.23-pre8/include/linux/pci_ids.h
--- linux-2.4.23-pre7/include/linux/pci_ids.h	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/include/linux/pci_ids.h	2003-10-23 03:33:18.000000000 -0700
@@ -1669,6 +1669,7 @@
 #define PCI_DEVICE_ID_TIGON3_5703A3	0x16c7
 #define PCI_DEVICE_ID_TIGON3_5901	0x170d
 #define PCI_DEVICE_ID_TIGON3_5901_2	0x170e
+#define PCI_DEVICE_ID_BCM4401		0x4401
 
 #define PCI_VENDOR_ID_SYBA		0x1592
 #define PCI_DEVICE_ID_SYBA_2P_EPP	0x0782
diff -urN linux-2.4.23-pre7/include/linux/sunrpc/timer.h linux-2.4.23-pre8/include/linux/sunrpc/timer.h
--- linux-2.4.23-pre7/include/linux/sunrpc/timer.h	2002-11-28 15:53:15.000000000 -0800
+++ linux-2.4.23-pre8/include/linux/sunrpc/timer.h	2003-10-23 03:33:18.000000000 -0700
@@ -15,7 +15,7 @@
 	long timeo;		/* default timeout value */
 	long srtt[5];		/* smoothed round trip time << 3 */
 	long sdrtt[5];		/* soothed medium deviation of RTT */
-	atomic_t  ntimeouts;	/* Global count of the number of timeouts */
+	int  ntimeouts[5];	/* Number of timeouts for the last request */
 };
 
 
@@ -23,19 +23,27 @@
 extern void rpc_update_rtt(struct rpc_rtt *rt, int timer, long m);
 extern long rpc_calc_rto(struct rpc_rtt *rt, int timer);
 
-static inline void rpc_inc_timeo(struct rpc_rtt *rt)
+static inline void rpc_set_timeo(struct rpc_rtt *rt, int timer, int ntimeo)
 {
-	atomic_inc(&rt->ntimeouts);
+	int *t;
+	if (!timer)
+		return;
+	t = &rt->ntimeouts[timer-1];
+	if (ntimeo < *t) {
+		if (*t > 0)
+			(*t)--;
+	} else {
+		if (ntimeo > 8)
+			ntimeo = 8;
+		*t = ntimeo;
+	}
 }
 
-static inline void rpc_clear_timeo(struct rpc_rtt *rt)
+static inline int rpc_ntimeo(struct rpc_rtt *rt, int timer)
 {
-	atomic_set(&rt->ntimeouts, 0);
-}
-
-static inline int rpc_ntimeo(struct rpc_rtt *rt)
-{
-	return atomic_read(&rt->ntimeouts);
+	if (!timer)
+		return 0;
+	return rt->ntimeouts[timer-1];
 }
 
 #endif /* _LINUX_SUNRPC_TIMER_H */
diff -urN linux-2.4.23-pre7/include/linux/sunrpc/xprt.h linux-2.4.23-pre8/include/linux/sunrpc/xprt.h
--- linux-2.4.23-pre7/include/linux/sunrpc/xprt.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/include/linux/sunrpc/xprt.h	2003-10-23 03:33:18.000000000 -0700
@@ -115,7 +115,7 @@
 
 	long			rq_xtime;	/* when transmitted */
 	int			rq_ntimeo;
-	int			rq_nresend;
+	int			rq_ntrans;
 };
 #define rq_svec			rq_snd_buf.head
 #define rq_slen			rq_snd_buf.len
diff -urN linux-2.4.23-pre7/kernel/kmod.c linux-2.4.23-pre8/kernel/kmod.c
--- linux-2.4.23-pre7/kernel/kmod.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/kernel/kmod.c	2003-10-23 03:33:18.000000000 -0700
@@ -122,8 +122,11 @@
 	switch_uid(INIT_USER);
 
 	/* Give kmod all effective privileges.. */
-	curtask->euid = curtask->fsuid = 0;
-	curtask->egid = curtask->fsgid = 0;
+	curtask->euid = curtask->uid = curtask->suid = curtask->fsuid = 0;
+	curtask->egid = curtask->gid = curtask->sgid = curtask->fsgid = 0;
+
+	curtask->ngroups = 0;
+
 	cap_set_full(curtask->cap_effective);
 
 	/* Allow execve args to be in kernel space. */
diff -urN linux-2.4.23-pre7/mm/shmem.c linux-2.4.23-pre8/mm/shmem.c
--- linux-2.4.23-pre7/mm/shmem.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/mm/shmem.c	2003-10-23 03:33:18.000000000 -0700
@@ -46,6 +46,10 @@
 
 #define VM_ACCT(size)    (PAGE_CACHE_ALIGN(size) >> PAGE_SHIFT)
 
+/* info->flags needs VM_flags to handle pagein/truncate race efficiently */
+#define SHMEM_PAGEIN	 VM_READ
+#define SHMEM_TRUNCATE	 VM_WRITE
+
 /* Pretend that each entry is of this size in directory's i_size */
 #define BOGO_DIRENT_SIZE 20
 
@@ -364,8 +368,23 @@
 	while (index < info->next_index)
 		freed += shmem_truncate_indirect(info, index);
 	BUG_ON(info->swapped > info->next_index);
-	spin_unlock(&info->lock);
 
+	if (inode->i_mapping->nrpages && (info->flags & SHMEM_PAGEIN)) {
+		/*
+		 * Call truncate_inode_pages again: racing shmem_unuse_inode
+		 * may have swizzled a page in from swap since vmtruncate or
+		 * generic_delete_inode did it, before we lowered next_index.
+		 * Also, though shmem_getpage checks i_size before adding to
+		 * cache, no recheck after: so fix the narrow window there too.
+		 */
+		info->flags |= SHMEM_TRUNCATE;
+		spin_unlock(&info->lock);
+		truncate_inode_pages(inode->i_mapping, inode->i_size);
+		spin_lock(&info->lock);
+		info->flags &= ~SHMEM_TRUNCATE;
+	}
+
+	spin_unlock(&info->lock);
 	spin_lock(&sbinfo->stat_lock);
 	sbinfo->free_blocks += freed;
 	inode->i_blocks -= freed*BLOCKS_PER_PAGE;
@@ -392,6 +411,19 @@
 					attr->ia_size>>PAGE_CACHE_SHIFT,
 						&page, SGP_READ);
 			}
+			/*
+			 * Reset SHMEM_PAGEIN flag so that shmem_truncate can
+			 * detect if any pages might have been added to cache
+			 * after truncate_inode_pages.  But we needn't bother
+			 * if it's being fully truncated to zero-length: the
+			 * nrpages check is efficient enough in that case.
+			 */
+			if (attr->ia_size) {
+				struct shmem_inode_info *info = SHMEM_I(inode);
+				spin_lock(&info->lock);
+				info->flags &= ~SHMEM_PAGEIN;
+				spin_unlock(&info->lock);
+			}
 		}
 	}
 
@@ -439,7 +471,6 @@
 	struct address_space *mapping;
 	swp_entry_t *ptr;
 	unsigned long idx;
-	unsigned long limit;
 	int offset;
 
 	idx = 0;
@@ -471,13 +502,9 @@
 	inode = info->inode;
 	mapping = inode->i_mapping;
 	delete_from_swap_cache(page);
-
-	/* Racing against delete or truncate? Must leave out of page cache */
-	limit = (inode->i_state & I_FREEING)? 0:
-		(inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
-
-	if (idx >= limit || add_to_page_cache_unique(page,
+	if (add_to_page_cache_unique(page,
 			mapping, idx, page_hash(mapping, idx)) == 0) {
+		info->flags |= SHMEM_PAGEIN;
 		ptr[offset].val = 0;
 		info->swapped--;
 	} else if (add_to_swap_cache(page, entry) != 0)
@@ -529,21 +556,26 @@
 
 	BUG_ON(!PageLocked(page));
 	if (!PageLaunder(page))
-		return fail_writepage(page);
+		goto fail;
 
 	mapping = page->mapping;
 	index = page->index;
 	inode = mapping->host;
 	info = SHMEM_I(inode);
 	if (info->flags & VM_LOCKED)
-		return fail_writepage(page);
+		goto fail;
 getswap:
 	swap = get_swap_page();
 	if (!swap.val)
-		return fail_writepage(page);
+		goto fail;
 
 	spin_lock(&info->lock);
-	BUG_ON(index >= info->next_index);
+	if (index >= info->next_index) {
+		BUG_ON(!(info->flags & SHMEM_TRUNCATE));
+		spin_unlock(&info->lock);
+		swap_free(swap);
+		goto fail;
+	}
 	entry = shmem_swp_entry(info, index, NULL);
 	BUG_ON(!entry);
 	BUG_ON(entry->val);
@@ -559,6 +591,7 @@
 		 * Add page back to page cache, unref swap, try again.
 		 */
 		add_to_page_cache_locked(page, mapping, index);
+		info->flags |= SHMEM_PAGEIN;
 		spin_unlock(&info->lock);
 		swap_free(swap);
 		goto getswap;
@@ -571,6 +604,8 @@
 	set_page_dirty(page);
 	UnlockPage(page);
 	return 0;
+fail:
+	return fail_writepage(page);
 }
 
 /*
@@ -670,6 +705,7 @@
 			swap_free(swap);
 		} else if (add_to_page_cache_unique(swappage,
 			mapping, idx, page_hash(mapping, idx)) == 0) {
+			info->flags |= SHMEM_PAGEIN;
 			entry->val = 0;
 			info->swapped--;
 			spin_unlock(&info->lock);
@@ -735,6 +771,7 @@
 					goto failed;
 				goto repeat;
 			}
+			info->flags |= SHMEM_PAGEIN;
 		}
 
 		spin_unlock(&info->lock);
@@ -1129,6 +1166,8 @@
  */
 static struct dentry *shmem_lookup(struct inode *dir, struct dentry *dentry)
 {
+	if (dentry->d_name.len > NAME_MAX)
+		return ERR_PTR(-ENAMETOOLONG);
 	d_add(dentry, NULL);
 	return NULL;
 }
@@ -1142,6 +1181,11 @@
 	int error = -ENOSPC;
 
 	if (inode) {
+		if (dir->i_mode & S_ISGID) {
+			inode->i_gid = dir->i_gid;
+			if (S_ISDIR(mode))
+				inode->i_mode |= S_ISGID;
+		}
 		dir->i_size += BOGO_DIRENT_SIZE;
 		dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 		d_instantiate(dentry, inode);
@@ -1308,6 +1352,8 @@
 		SetPageDirty(page);
 		page_cache_release(page);
 	}
+	if (dir->i_mode & S_ISGID)
+		inode->i_gid = dir->i_gid;
 	dir->i_size += BOGO_DIRENT_SIZE;
 	dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 	d_instantiate(dentry, inode);
diff -urN linux-2.4.23-pre7/mm/vmscan.c linux-2.4.23-pre8/mm/vmscan.c
--- linux-2.4.23-pre7/mm/vmscan.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/mm/vmscan.c	2003-10-23 03:33:18.000000000 -0700
@@ -596,7 +596,7 @@
 			continue;
 		}
 
-		nr_pages--;
+		ratio--;
 
 		del_page_from_active_list(page);
 		add_page_to_inactive_list(page);
diff -urN linux-2.4.23-pre7/net/8021q/vlan_dev.c linux-2.4.23-pre8/net/8021q/vlan_dev.c
--- linux-2.4.23-pre7/net/8021q/vlan_dev.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/8021q/vlan_dev.c	2003-10-23 03:33:18.000000000 -0700
@@ -77,7 +77,7 @@
 	if (VLAN_DEV_INFO(skb->dev)->flags & 1) {
 		if (skb_shared(skb) || skb_cloned(skb)) {
 			struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC);
-			kfree(skb);
+			kfree_skb(skb);
 			skb = nskb;
 		}
 		if (skb) {
diff -urN linux-2.4.23-pre7/net/atm/atm_misc.c linux-2.4.23-pre8/net/atm/atm_misc.c
--- linux-2.4.23-pre7/net/atm/atm_misc.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/atm_misc.c	2003-10-23 03:33:18.000000000 -0700
@@ -45,15 +45,20 @@
 
 static int check_ci(struct atm_vcc *vcc,short vpi,int vci)
 {
+	struct sock *s;
 	struct atm_vcc *walk;
 
-	for (walk = vcc->dev->vccs; walk; walk = walk->next)
+	for (s = vcc_sklist; s; s = s->next) {
+		walk = s->protinfo.af_atm;
+		if (walk->dev != vcc->dev)
+			continue;
 		if (test_bit(ATM_VF_ADDR,&walk->flags) && walk->vpi == vpi &&
 		    walk->vci == vci && ((walk->qos.txtp.traffic_class !=
 		    ATM_NONE && vcc->qos.txtp.traffic_class != ATM_NONE) ||
 		    (walk->qos.rxtp.traffic_class != ATM_NONE &&
 		    vcc->qos.rxtp.traffic_class != ATM_NONE)))
 			return -EADDRINUSE;
+	}
 		/* allow VCCs with same VPI/VCI iff they don't collide on
 		   TX/RX (but we may refuse such sharing for other reasons,
 		   e.g. if protocol requires to have both channels) */
@@ -63,17 +68,16 @@
 
 int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci)
 {
-	unsigned long flags;
 	static short p = 0; /* poor man's per-device cache */
 	static int c = 0;
 	short old_p;
 	int old_c;
 	int err;
 
-	spin_lock_irqsave(&vcc->dev->lock, flags);
+	read_lock(&vcc_sklist_lock);
 	if (*vpi != ATM_VPI_ANY && *vci != ATM_VCI_ANY) {
 		err = check_ci(vcc,*vpi,*vci);
-		spin_unlock_irqrestore(&vcc->dev->lock, flags);
+		read_unlock(&vcc_sklist_lock);
 		return err;
 	}
 	/* last scan may have left values out of bounds for current device */
@@ -88,7 +92,7 @@
 		if (!check_ci(vcc,p,c)) {
 			*vpi = p;
 			*vci = c;
-			spin_unlock_irqrestore(&vcc->dev->lock, flags);
+			read_unlock(&vcc_sklist_lock);
 			return 0;
 		}
 		if (*vci == ATM_VCI_ANY) {
@@ -103,7 +107,7 @@
 		}
 	}
 	while (old_p != p || old_c != c);
-	spin_unlock_irqrestore(&vcc->dev->lock, flags);
+	read_unlock(&vcc_sklist_lock);
 	return -EADDRINUSE;
 }
 
diff -urN linux-2.4.23-pre7/net/atm/clip.c linux-2.4.23-pre8/net/atm/clip.c
--- linux-2.4.23-pre7/net/atm/clip.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/clip.c	2003-10-23 03:33:18.000000000 -0700
@@ -144,8 +144,8 @@
 					DPRINTK("releasing vcc %p->%p of "
 					    "entry %p\n",clip_vcc,clip_vcc->vcc,
 					    entry);
-					atm_async_release_vcc(clip_vcc->vcc,
-					    -ETIMEDOUT);
+					vcc_release_async(clip_vcc->vcc,
+							  -ETIMEDOUT);
 				}
 			if (entry->vccs ||
 			    time_before(jiffies, entry->expires)) {
@@ -740,7 +740,8 @@
 	set_bit(ATM_VF_META,&vcc->flags);
 	set_bit(ATM_VF_READY,&vcc->flags);
 	    /* allow replies and avoid getting closed if signaling dies */
-	bind_vcc(vcc,&atmarpd_dev);
+	vcc->dev = &atmarpd_dev;
+	vcc_insert_socket(vcc->sk);
 	vcc->push = NULL;
 	vcc->pop = NULL; /* crash */
 	vcc->push_oam = NULL; /* crash */
diff -urN linux-2.4.23-pre7/net/atm/common.c linux-2.4.23-pre8/net/atm/common.c
--- linux-2.4.23-pre7/net/atm/common.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/common.c	2003-10-23 03:33:18.000000000 -0700
@@ -178,6 +178,38 @@
 #endif
 
 
+struct sock *vcc_sklist;
+rwlock_t vcc_sklist_lock = RW_LOCK_UNLOCKED;
+
+void __vcc_insert_socket(struct sock *sk)
+{
+	sk->next = vcc_sklist;
+	if (sk->next)
+		vcc_sklist->pprev = &sk->next;
+	vcc_sklist = sk;
+	sk->pprev = &vcc_sklist;
+}
+
+void vcc_insert_socket(struct sock *sk)
+{
+	write_lock_irq(&vcc_sklist_lock);
+	__vcc_insert_socket(sk);
+	write_unlock_irq(&vcc_sklist_lock);
+}
+
+void vcc_remove_socket(struct sock *sk)
+{
+	write_lock_irq(&vcc_sklist_lock);
+	if (sk->pprev) {
+		if (sk->next)
+			sk->next->pprev = sk->pprev;
+		*sk->pprev = sk->next;
+		sk->pprev = NULL;
+	}
+	write_unlock_irq(&vcc_sklist_lock);
+}
+
+
 static struct sk_buff *alloc_tx(struct atm_vcc *vcc,unsigned int size)
 {
 	struct sk_buff *skb;
@@ -194,16 +226,46 @@
 }
 
 
-int atm_create(struct socket *sock,int protocol,int family)
+EXPORT_SYMBOL(vcc_sklist);
+EXPORT_SYMBOL(vcc_sklist_lock);
+EXPORT_SYMBOL(vcc_insert_socket);
+EXPORT_SYMBOL(vcc_remove_socket);
+
+static void vcc_sock_destruct(struct sock *sk)
 {
+	struct atm_vcc *vcc = sk->protinfo.af_atm;
+
+	if (atomic_read(&vcc->sk->rmem_alloc))
+		printk(KERN_DEBUG "vcc_sock_destruct: rmem leakage (%d bytes) detected.\n", atomic_read(&sk->rmem_alloc));
+
+	if (atomic_read(&vcc->sk->wmem_alloc))
+		printk(KERN_DEBUG "vcc_sock_destruct: wmem leakage (%d bytes) detected.\n", atomic_read(&sk->wmem_alloc));
+
+	kfree(sk->protinfo.af_atm);
+}
+
+int vcc_create(struct socket *sock, int protocol, int family)
+{     
 	struct sock *sk;
 	struct atm_vcc *vcc;
 
 	sock->sk = NULL;
-	if (sock->type == SOCK_STREAM) return -EINVAL;
-	if (!(sk = alloc_atm_vcc_sk(family))) return -ENOMEM;
-	vcc = sk->protinfo.af_atm;
-	memset(&vcc->flags,0,sizeof(vcc->flags));
+	if (sock->type == SOCK_STREAM)
+		return -EINVAL;
+	sk = sk_alloc(family, GFP_KERNEL, 1);
+	if (!sk)
+		return -ENOMEM;
+	sock_init_data(NULL, sk);
+
+	vcc = sk->protinfo.af_atm = kmalloc(sizeof(*vcc), GFP_KERNEL);
+	if (!vcc) {
+		sk_free(sk);
+		return -ENOMEM;
+	}
+
+	memset(vcc, 0, sizeof(*vcc));
+	vcc->sk = sk;
+
 	vcc->dev = NULL;
 	vcc->callback = NULL;
 	memset(&vcc->local,0,sizeof(struct sockaddr_atmsvc));
@@ -217,23 +279,28 @@
 	vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */
 	vcc->atm_options = vcc->aal_options = 0;
 	init_waitqueue_head(&vcc->sleep);
-	skb_queue_head_init(&vcc->listenq);
 	sk->sleep = &vcc->sleep;
+	sk->destruct = vcc_sock_destruct;
 	sock->sk = sk;
 	return 0;
 }
 
 
-void atm_release_vcc_sk(struct sock *sk,int free_sk)
+static void vcc_destroy_socket(struct sock *sk)
 {
 	struct atm_vcc *vcc;
 	struct sk_buff *skb;
 
 	vcc = sk->protinfo.af_atm;
-	clear_bit(ATM_VF_READY,&vcc->flags);
+	clear_bit(ATM_VF_READY, &vcc->flags);
 	if (vcc->dev) {
-		if (vcc->dev->ops->close) vcc->dev->ops->close(vcc);
-		if (vcc->push) vcc->push(vcc,NULL); /* atmarpd has no push */
+		if (vcc->dev->ops->close)
+			vcc->dev->ops->close(vcc);
+		if (vcc->push)
+			vcc->push(vcc, NULL); /* atmarpd has no push */
+
+		vcc_remove_socket(sk);  /* no more receive */
+
 		while ((skb = skb_dequeue(&vcc->sk->receive_queue))) {
 			atm_return(vcc,skb->truesize);
 			kfree_skb(skb);
@@ -241,35 +308,36 @@
 
 		if (vcc->dev->ops->owner)
 			__MOD_DEC_USE_COUNT(vcc->dev->ops->owner);
-		atm_dev_release(vcc->dev);
-		if (atomic_read(&vcc->sk->rmem_alloc))
-			printk(KERN_WARNING "atm_release_vcc: strange ... "
-			    "rmem_alloc == %d after closing\n",
-			    atomic_read(&vcc->sk->rmem_alloc));
-		bind_vcc(vcc,NULL);
+		atm_dev_put(vcc->dev);
 	}
-
-	if (free_sk) free_atm_vcc_sk(sk);
 }
 
 
-int atm_release(struct socket *sock)
+int vcc_release(struct socket *sock)
 {
-	if (sock->sk)
-		atm_release_vcc_sk(sock->sk,1);
+	struct sock *sk = sock->sk;
+
+	if (sk) {
+		lock_sock(sk);
+		vcc_destroy_socket(sock->sk);
+		release_sock(sk);
+		sock_put(sk);
+	}
+
 	return 0;
 }
 
 
-void atm_async_release_vcc(struct atm_vcc *vcc,int reply)
+void vcc_release_async(struct atm_vcc *vcc, int reply)
 {
-	set_bit(ATM_VF_CLOSE,&vcc->flags);
+	set_bit(ATM_VF_CLOSE, &vcc->flags);
 	vcc->reply = reply;
+	vcc->sk->err = -reply;
 	wake_up(&vcc->sleep);
 }
 
 
-EXPORT_SYMBOL(atm_async_release_vcc);
+EXPORT_SYMBOL(vcc_release_async);
 
 
 static int adjust_tp(struct atm_trafprm *tp,unsigned char aal)
@@ -298,8 +366,8 @@
 }
 
 
-static int atm_do_connect_dev(struct atm_vcc *vcc,struct atm_dev *dev,int vpi,
-    int vci)
+static int __vcc_connect(struct atm_vcc *vcc, struct atm_dev *dev, int vpi,
+			 int vci)
 {
 	int error;
 
@@ -310,7 +378,10 @@
 	if (vci > 0 && vci < ATM_NOT_RSV_VCI && !capable(CAP_NET_BIND_SERVICE))
 		return -EPERM;
 	error = 0;
-	bind_vcc(vcc,dev);
+	if (!try_inc_mod_count(dev->ops->owner))
+		return -ENODEV;
+	vcc->dev = dev;
+	vcc_insert_socket(vcc->sk);
 	switch (vcc->qos.aal) {
 		case ATM_AAL0:
 			error = atm_init_aal0(vcc);
@@ -333,53 +404,50 @@
 	}
 	if (!error) error = adjust_tp(&vcc->qos.txtp,vcc->qos.aal);
 	if (!error) error = adjust_tp(&vcc->qos.rxtp,vcc->qos.aal);
-	if (error) {
-		bind_vcc(vcc,NULL);
-		return error;
-	}
+	if (error)
+		goto fail;
 	DPRINTK("VCC %d.%d, AAL %d\n",vpi,vci,vcc->qos.aal);
 	DPRINTK("  TX: %d, PCR %d..%d, SDU %d\n",vcc->qos.txtp.traffic_class,
 	    vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu);
 	DPRINTK("  RX: %d, PCR %d..%d, SDU %d\n",vcc->qos.rxtp.traffic_class,
 	    vcc->qos.rxtp.min_pcr,vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu);
-	if (!try_inc_mod_count(dev->ops->owner))
-		return -ENODEV;
 	if (dev->ops->open) {
-		error = dev->ops->open(vcc,vpi,vci);
-		if (error) {
-			if (dev->ops->owner)
-				__MOD_DEC_USE_COUNT(dev->ops->owner);
-			bind_vcc(vcc,NULL);
-			return error;
-		}
+		if ((error = dev->ops->open(vcc,vpi,vci)))
+			goto fail;
 	}
 	return 0;
+
+fail:
+	vcc_remove_socket(vcc->sk);
+	if (dev->ops->owner)
+		__MOD_DEC_USE_COUNT(dev->ops->owner);
+	/* ensure we get dev module ref count correct */
+	vcc->dev = NULL;
+	return error;
+	
 }
 
 
-static int atm_do_connect(struct atm_vcc *vcc,int itf,int vpi,int vci)
+int vcc_connect(struct socket *sock, int itf, short vpi, int vci)
 {
 	struct atm_dev *dev;
-	int return_val;
-
-	dev = atm_dev_lookup(itf);
-	if (!dev)
-		return_val =  -ENODEV;
-	else {
-		return_val = atm_do_connect_dev(vcc,dev,vpi,vci);
-		if (return_val) atm_dev_release(dev);
-	}
-
-	return return_val;
-}
+	struct atm_vcc *vcc = ATM_SD(sock);
+	int error;
 
+	DPRINTK("vcc_connect (vpi %d, vci %d)\n",vpi,vci);
+	if (sock->state == SS_CONNECTED)
+		return -EISCONN;
+	if (sock->state != SS_UNCONNECTED)
+		return -EINVAL;
+	if (!(vpi || vci))
+		return -EINVAL;
 
-int atm_connect_vcc(struct atm_vcc *vcc,int itf,short vpi,int vci)
-{
 	if (vpi != ATM_VPI_UNSPEC && vci != ATM_VCI_UNSPEC)
 		clear_bit(ATM_VF_PARTIAL,&vcc->flags);
-	else if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) return -EINVAL;
-	DPRINTK("atm_connect (TX: cl %d,bw %d-%d,sdu %d; "
+	else
+		if (test_bit(ATM_VF_PARTIAL,&vcc->flags))
+			return -EINVAL;
+	DPRINTK("vcc_connect (TX: cl %d,bw %d-%d,sdu %d; "
 	    "RX: cl %d,bw %d-%d,sdu %d,AAL %s%d)\n",
 	    vcc->qos.txtp.traffic_class,vcc->qos.txtp.min_pcr,
 	    vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu,
@@ -387,143 +455,142 @@
 	    vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu,
 	    vcc->qos.aal == ATM_AAL5 ? "" : vcc->qos.aal == ATM_AAL0 ? "" :
 	    " ??? code ",vcc->qos.aal == ATM_AAL0 ? 0 : vcc->qos.aal);
-	if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD;
+	if (!test_bit(ATM_VF_HASQOS, &vcc->flags))
+		return -EBADFD;
 	if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS ||
 	    vcc->qos.rxtp.traffic_class == ATM_ANYCLASS)
 		return -EINVAL;
 	if (itf != ATM_ITF_ANY) {
-		int error;
-
-		error = atm_do_connect(vcc,itf,vpi,vci);
-		if (error) return error;
-	}
-	else {
-		struct atm_dev *dev = NULL;
+		dev = atm_dev_lookup(itf);
+		if (!dev)
+			return -ENODEV;
+		error = __vcc_connect(vcc, dev, vpi, vci);
+		if (error) {
+			atm_dev_put(dev);
+			return error;
+		}
+	} else {
 		struct list_head *p, *next;
 
+		dev = NULL;
 		spin_lock(&atm_dev_lock);
 		list_for_each_safe(p, next, &atm_devs) {
 			dev = list_entry(p, struct atm_dev, dev_list);
 			atm_dev_hold(dev);
 			spin_unlock(&atm_dev_lock);
-			if (!atm_do_connect_dev(vcc,dev,vpi,vci))
+			if (!__vcc_connect(vcc, dev, vpi, vci))
 				break;
-			atm_dev_release(dev);
+			atm_dev_put(dev);
 			dev = NULL;
 			spin_lock(&atm_dev_lock);
 		}
 		spin_unlock(&atm_dev_lock);
-		if (!dev) return -ENODEV;
+		if (!dev)
+			return -ENODEV;
 	}
 	if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC)
 		set_bit(ATM_VF_PARTIAL,&vcc->flags);
-	return 0;
-}
-
-
-int atm_connect(struct socket *sock,int itf,short vpi,int vci)
-{
-	int error;
-
-	DPRINTK("atm_connect (vpi %d, vci %d)\n",vpi,vci);
-	if (sock->state == SS_CONNECTED) return -EISCONN;
-	if (sock->state != SS_UNCONNECTED) return -EINVAL;
-	if (!(vpi || vci)) return -EINVAL;
-	error = atm_connect_vcc(ATM_SD(sock),itf,vpi,vci);
-	if (error) return error;
 	if (test_bit(ATM_VF_READY,&ATM_SD(sock)->flags))
 		sock->state = SS_CONNECTED;
 	return 0;
 }
 
 
-int atm_recvmsg(struct socket *sock,struct msghdr *m,int total_len,
-    int flags,struct scm_cookie *scm)
+int vcc_recvmsg(struct socket *sock, struct msghdr *msg,
+		int size, int flags, struct scm_cookie *scm)
 {
-	DECLARE_WAITQUEUE(wait,current);
-	struct atm_vcc *vcc;
-	struct sk_buff *skb;
-	int eff_len,error;
-	void *buff;
-	int size;
-
-	if (sock->state != SS_CONNECTED) return -ENOTCONN;
-	if (flags & ~MSG_DONTWAIT) return -EOPNOTSUPP;
-	if (m->msg_iovlen != 1) return -ENOSYS; /* fix this later @@@ */
-	buff = m->msg_iov->iov_base;
-	size = m->msg_iov->iov_len;
-	vcc = ATM_SD(sock);
-	add_wait_queue(&vcc->sleep,&wait);
-	set_current_state(TASK_INTERRUPTIBLE);
-	error = 1; /* <= 0 is error */
-	while (!(skb = skb_dequeue(&vcc->sk->receive_queue))) {
-		if (test_bit(ATM_VF_RELEASED,&vcc->flags) ||
-		    test_bit(ATM_VF_CLOSE,&vcc->flags)) {
-			error = vcc->reply;
-			break;
-		}
-		if (!test_bit(ATM_VF_READY,&vcc->flags)) {
-			error = 0;
-			break;
-		}
-		if (flags & MSG_DONTWAIT) {
-			error = -EAGAIN;
-			break;
-		}
-		schedule();
-		set_current_state(TASK_INTERRUPTIBLE);
-		if (signal_pending(current)) {
-			error = -ERESTARTSYS;
-			break;
-		}
-	}
-	set_current_state(TASK_RUNNING);
-	remove_wait_queue(&vcc->sleep,&wait);
-	if (error <= 0) return error;
-	sock_recv_timestamp(m, vcc->sk, skb);
-	eff_len = skb->len > size ? size : skb->len;
-	if (skb->len > size) /* Not fit ?  Report it... */
-		m->msg_flags |= MSG_TRUNC;
+ 	struct sock *sk = sock->sk;
+  	struct atm_vcc *vcc;
+  	struct sk_buff *skb;
+ 	int copied, error = -EINVAL;
+ 
+ 	if (sock->state != SS_CONNECTED)
+ 		return -ENOTCONN;
+ 	if (flags & ~MSG_DONTWAIT)		/* only handle MSG_DONTWAIT */
+ 		return -EOPNOTSUPP;
+  	vcc = ATM_SD(sock);
+ 	if (test_bit(ATM_VF_RELEASED,&vcc->flags) ||
+ 	    test_bit(ATM_VF_CLOSE,&vcc->flags))
+ 		return vcc->reply;
+ 	if (!test_bit(ATM_VF_READY, &vcc->flags))
+ 		return 0;
+ 
+ 	skb = skb_recv_datagram(sk, flags, flags & MSG_DONTWAIT, &error);
+ 	if (!skb)
+ 		return error;
+ 
+ 	copied = skb->len; 
+ 	if (copied > size) {
+ 		copied = size; 
+ 		msg->msg_flags |= MSG_TRUNC;
+ 	}
+ 
+	error = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
+	if (error)
+		 return error;
+	sock_recv_timestamp(msg, sk, skb);
 	if (vcc->dev->ops->feedback)
-		vcc->dev->ops->feedback(vcc,skb,(unsigned long) skb->data,
-		    (unsigned long) buff,eff_len);
-	DPRINTK("RcvM %d -= %d\n",atomic_read(&vcc->sk->rmem_alloc),skb->truesize);
-	atm_return(vcc,skb->truesize);
-	error = copy_to_user(buff,skb->data,eff_len) ? -EFAULT : 0;
-	kfree_skb(skb);
-	return error ? error : eff_len;
+		vcc->dev->ops->feedback(vcc, skb, (unsigned long) skb->data,
+					(unsigned long) msg->msg_iov->iov_base, copied);
+	DPRINTK("RcvM %d -= %d\n", atomic_read(&vcc->sk->rmem_alloc), skb->truesize);
+	atm_return(vcc, skb->truesize);
+	skb_free_datagram(sk, skb);
+	return copied;
 }
+  
+  
 
-
-int atm_sendmsg(struct socket *sock,struct msghdr *m,int total_len,
-    struct scm_cookie *scm)
+int vcc_sendmsg(struct socket *sock, struct msghdr *m, int total_len,
+		struct scm_cookie *scm)
 {
+ 	struct sock *sk = sock->sk;
 	DECLARE_WAITQUEUE(wait,current);
-	struct atm_vcc *vcc;
-	struct sk_buff *skb;
-	int eff,error;
-	const void *buff;
-	int size;
-
-	if (sock->state != SS_CONNECTED) return -ENOTCONN;
-	if (m->msg_name) return -EISCONN;
-	if (m->msg_iovlen != 1) return -ENOSYS; /* fix this later @@@ */
-	buff = m->msg_iov->iov_base;
-	size = m->msg_iov->iov_len;
-	vcc = ATM_SD(sock);
-	if (test_bit(ATM_VF_RELEASED,&vcc->flags) ||
-	    test_bit(ATM_VF_CLOSE,&vcc->flags))
-		return vcc->reply;
-	if (!test_bit(ATM_VF_READY,&vcc->flags)) return -EPIPE;
-	if (!size) return 0;
-	if (size < 0 || size > vcc->qos.txtp.max_sdu) return -EMSGSIZE;
-	/* verify_area is done by net/socket.c */
-	eff = (size+3) & ~3; /* align to word boundary */
-	add_wait_queue(&vcc->sleep,&wait);
+  	struct atm_vcc *vcc;
+  	struct sk_buff *skb;
+  	int eff,error;
+  	const void *buff;
+  	int size;
+
+ 	lock_sock(sk);
+ 	if (sock->state != SS_CONNECTED) {
+ 		error = -ENOTCONN;
+ 		goto out;
+ 	}
+ 	if (m->msg_name) {
+ 		error = -EISCONN;
+ 		goto out;
+ 	}
+ 	if (m->msg_iovlen != 1) {
+ 		error = -ENOSYS; /* fix this later @@@ */
+ 		goto out;
+ 	}
+  	buff = m->msg_iov->iov_base;
+  	size = m->msg_iov->iov_len;
+  	vcc = ATM_SD(sock);
+ 	if (test_bit(ATM_VF_RELEASED, &vcc->flags) ||
+ 	    test_bit(ATM_VF_CLOSE, &vcc->flags)) {
+ 		error = vcc->reply;
+ 		goto out;
+ 	}
+ 	if (!test_bit(ATM_VF_READY, &vcc->flags)) {
+ 		error = -EPIPE;
+ 		goto out;
+ 	}
+ 	if (!size) {
+ 		error = 0;
+ 		goto out;
+ 	}
+ 	if (size < 0 || size > vcc->qos.txtp.max_sdu) {
+ 		error = -EMSGSIZE;
+ 		goto out;
+ 	}
+  	/* verify_area is done by net/socket.c */
+  	eff = (size+3) & ~3; /* align to word boundary */
+ 	add_wait_queue(&vcc->sleep,&wait);
 	set_current_state(TASK_INTERRUPTIBLE);
-	error = 0;
-	while (!(skb = alloc_tx(vcc,eff))) {
-		if (m->msg_flags & MSG_DONTWAIT) {
+  	error = 0;
+  	while (!(skb = alloc_tx(vcc,eff))) {
+  		if (m->msg_flags & MSG_DONTWAIT) {
 			error = -EAGAIN;
 			break;
 		}
@@ -545,16 +612,21 @@
 	}
 	set_current_state(TASK_RUNNING);
 	remove_wait_queue(&vcc->sleep,&wait);
-	if (error) return error;
+	if (error)
+		goto out;
 	skb->dev = NULL; /* for paths shared with net_device interfaces */
 	ATM_SKB(skb)->atm_options = vcc->atm_options;
 	if (copy_from_user(skb_put(skb,size),buff,size)) {
 		kfree_skb(skb);
-		return -EFAULT;
+		error = -EFAULT;
+		goto out;
 	}
 	if (eff != size) memset(skb->data+size,0,eff-size);
 	error = vcc->dev->ops->send(vcc,skb);
-	return error ? error : size;
+	error = error ? error : size;
+out:
+	release_sock(sk);
+	return error;
 }
 
 
@@ -566,7 +638,7 @@
 	vcc = ATM_SD(sock);
 	poll_wait(file,&vcc->sleep,wait);
 	mask = 0;
-	if (skb_peek(&vcc->sk->receive_queue) || skb_peek(&vcc->listenq))
+	if (skb_peek(&vcc->sk->receive_queue))
 		mask |= POLLIN | POLLRDNORM;
 	if (test_bit(ATM_VF_RELEASED,&vcc->flags) ||
 	    test_bit(ATM_VF_CLOSE,&vcc->flags))
@@ -915,14 +987,16 @@
 	return check_tp(&qos->rxtp);
 }
 
-
-static int atm_do_setsockopt(struct socket *sock,int level,int optname,
-    void *optval,int optlen)
+int vcc_setsockopt(struct socket *sock, int level, int optname,
+		   char *optval, int optlen)
 {
 	struct atm_vcc *vcc;
 	unsigned long value;
 	int error;
 
+	if (__SO_LEVEL_MATCH(optname, level) && optlen != __SO_SIZE(optname))
+		return -EINVAL;
+
 	vcc = ATM_SD(sock);
 	switch (optname) {
 		case SO_ATMQOS:
@@ -956,10 +1030,16 @@
 }
 
 
-static int atm_do_getsockopt(struct socket *sock,int level,int optname,
-    void *optval,int optlen)
+int vcc_getsockopt(struct socket *sock, int level, int optname,
+		   char *optval, int *optlen)
 {
 	struct atm_vcc *vcc;
+	int len;
+
+	if (get_user(len, optlen))
+		return -EFAULT;
+	if (__SO_LEVEL_MATCH(optname, level) && len != __SO_SIZE(optname))
+		return -EINVAL;
 
 	vcc = ATM_SD(sock);
 	switch (optname) {
@@ -990,28 +1070,7 @@
 			break;
 	}
 	if (!vcc->dev || !vcc->dev->ops->getsockopt) return -EINVAL;
-	return vcc->dev->ops->getsockopt(vcc,level,optname,optval,optlen);
-}
-
-
-int atm_setsockopt(struct socket *sock,int level,int optname,char *optval,
-    int optlen)
-{
-	if (__SO_LEVEL_MATCH(optname, level) && optlen != __SO_SIZE(optname))
-		return -EINVAL;
-	return atm_do_setsockopt(sock,level,optname,optval,optlen);
-}
-
-
-int atm_getsockopt(struct socket *sock,int level,int optname,
-    char *optval,int *optlen)
-{
-	int len;
-
-	if (get_user(len,optlen)) return -EFAULT;
-	if (__SO_LEVEL_MATCH(optname, level) && len != __SO_SIZE(optname))
-		return -EINVAL;
-	return atm_do_getsockopt(sock,level,optname,optval,len);
+	return vcc->dev->ops->getsockopt(vcc, level, optname, optval, len);
 }
 
 
diff -urN linux-2.4.23-pre7/net/atm/common.h linux-2.4.23-pre8/net/atm/common.h
--- linux-2.4.23-pre7/net/atm/common.h	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/common.h	2003-10-23 03:33:18.000000000 -0700
@@ -10,22 +10,20 @@
 #include <linux/poll.h> /* for poll_table */
 
 
-int atm_create(struct socket *sock,int protocol,int family);
-int atm_release(struct socket *sock);
-int atm_connect(struct socket *sock,int itf,short vpi,int vci);
-int atm_recvmsg(struct socket *sock,struct msghdr *m,int total_len,
-    int flags,struct scm_cookie *scm);
-int atm_sendmsg(struct socket *sock,struct msghdr *m,int total_len,
-  struct scm_cookie *scm);
+int vcc_create(struct socket *sock, int protocol, int family);
+int vcc_release(struct socket *sock);
+int vcc_connect(struct socket *sock, int itf, short vpi, int vci);
+int vcc_recvmsg(struct socket *sock, struct msghdr *msg,
+		int size, int flags, struct scm_cookie *scm);
+int vcc_sendmsg(struct socket *sock, struct msghdr *m, int total_len,
+		struct scm_cookie *scm);
 unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait);
 int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
-int atm_setsockopt(struct socket *sock,int level,int optname,char *optval,
-    int optlen);
-int atm_getsockopt(struct socket *sock,int level,int optname,char *optval,
-    int *optlen);
+int vcc_setsockopt(struct socket *sock, int level, int optname, char *optval,
+		   int optlen);
+int vcc_getsockopt(struct socket *sock, int level, int optname, char *optval,
+		   int *optlen);
 
-int atm_connect_vcc(struct atm_vcc *vcc,int itf,short vpi,int vci);
-void atm_release_vcc_sk(struct sock *sk,int free_sk);
 void atm_shutdown_dev(struct atm_dev *dev);
 
 void pppoatm_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long));
diff -urN linux-2.4.23-pre7/net/atm/lec.c linux-2.4.23-pre8/net/atm/lec.c
--- linux-2.4.23-pre7/net/atm/lec.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/lec.c	2003-10-23 03:33:18.000000000 -0700
@@ -45,7 +45,7 @@
 
 #include "lec.h"
 #include "lec_arpc.h"
-#include "resources.h"  /* for bind_vcc() */
+#include "resources.h"
 
 #if 0
 #define DPRINTK printk
@@ -818,7 +818,8 @@
         lec_arp_init(priv);
 	priv->itfnum = i;  /* LANE2 addition */
         priv->lecd = vcc;
-        bind_vcc(vcc, &lecatm_dev);
+        vcc->dev = &lecatm_dev;
+        vcc_insert_socket(vcc->sk);
         
         vcc->proto_data = dev_lec[i];
 	set_bit(ATM_VF_META,&vcc->flags);
@@ -1092,7 +1093,7 @@
 		clear_bit(ATM_VF_READY,&entry->vcc->flags);
                 entry->vcc->push(entry->vcc, NULL);
 #endif
-		atm_async_release_vcc(entry->vcc, -EPIPE);
+		vcc_release_async(entry->vcc, -EPIPE);
                 entry->vcc = NULL;
         }
         if (entry->recv_vcc) {
@@ -1102,7 +1103,7 @@
 		clear_bit(ATM_VF_READY,&entry->recv_vcc->flags);
                 entry->recv_vcc->push(entry->recv_vcc, NULL);
 #endif
-		atm_async_release_vcc(entry->recv_vcc, -EPIPE);
+		vcc_release_async(entry->recv_vcc, -EPIPE);
                 entry->recv_vcc = NULL;
         }        
 }
diff -urN linux-2.4.23-pre7/net/atm/mpc.c linux-2.4.23-pre8/net/atm/mpc.c
--- linux-2.4.23-pre7/net/atm/mpc.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/mpc.c	2003-10-23 03:33:18.000000000 -0700
@@ -28,7 +28,7 @@
 
 #include "lec.h"
 #include "mpc.h"
-#include "resources.h"  /* for bind_vcc() */
+#include "resources.h"
 
 /*
  * mpc.c: Implementation of MPOA client kernel part 
@@ -787,7 +787,8 @@
 	}
 
 	mpc->mpoad_vcc = vcc;
-	bind_vcc(vcc, &mpc_dev);
+	vcc->dev = &mpc_dev;
+	vcc_insert_socket(vcc->sk);
 	set_bit(ATM_VF_META,&vcc->flags);
 	set_bit(ATM_VF_READY,&vcc->flags);
 
diff -urN linux-2.4.23-pre7/net/atm/mpoa_caches.c linux-2.4.23-pre8/net/atm/mpoa_caches.c
--- linux-2.4.23-pre7/net/atm/mpoa_caches.c	2000-04-14 09:48:47.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/mpoa_caches.c	2003-10-23 03:33:18.000000000 -0700
@@ -212,7 +212,7 @@
 			client->eg_ops->put(eg_entry);
 			return;
 		}
-		atm_async_release_vcc(vcc, -EPIPE);
+		vcc_release_async(vcc, -EPIPE);
 	}
 
 	return;
@@ -447,7 +447,7 @@
 			client->in_ops->put(in_entry);
 			return;
 		}
-		atm_async_release_vcc(vcc, -EPIPE);
+		vcc_release_async(vcc, -EPIPE);
 	}
 
 	return;
diff -urN linux-2.4.23-pre7/net/atm/proc.c linux-2.4.23-pre8/net/atm/proc.c
--- linux-2.4.23-pre7/net/atm/proc.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/proc.c	2003-10-23 03:33:18.000000000 -0700
@@ -332,9 +332,7 @@
 
 static int atm_pvc_info(loff_t pos,char *buf)
 {
-	unsigned long flags;
-	struct atm_dev *dev;
-	struct list_head *p;
+	struct sock *s;
 	struct atm_vcc *vcc;
 	int left, clip_info = 0;
 
@@ -347,24 +345,20 @@
 	if (try_atm_clip_ops())
 		clip_info = 1;
 #endif
-	spin_lock(&atm_dev_lock);
-	list_for_each(p, &atm_devs) {
-		dev = list_entry(p, struct atm_dev, dev_list);
-		spin_lock_irqsave(&dev->lock, flags);
-		for (vcc = dev->vccs; vcc; vcc = vcc->next)
-			if (vcc->sk->family == PF_ATMPVC && vcc->dev && !left--) {
-				pvc_info(vcc,buf,clip_info);
-				spin_unlock_irqrestore(&dev->lock, flags);
-				spin_unlock(&atm_dev_lock);
+	read_lock(&vcc_sklist_lock);
+	for(s = vcc_sklist; s; s = s->next) {
+		vcc = s->protinfo.af_atm;
+		if (vcc->sk->family == PF_ATMPVC && vcc->dev && !left--) {
+			pvc_info(vcc,buf,clip_info);
+			read_unlock(&vcc_sklist_lock);
 #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
-				if (clip_info && atm_clip_ops->owner)
-					__MOD_DEC_USE_COUNT(atm_clip_ops->owner);
+			if (clip_info && atm_clip_ops->owner)
+				__MOD_DEC_USE_COUNT(atm_clip_ops->owner);
 #endif
-				return strlen(buf);
-			}
-		spin_unlock_irqrestore(&dev->lock, flags);
+			return strlen(buf);
+		}
 	}
-	spin_unlock(&atm_dev_lock);
+	read_unlock(&vcc_sklist_lock);
 #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
 	if (clip_info && atm_clip_ops->owner)
 			__MOD_DEC_USE_COUNT(atm_clip_ops->owner);
@@ -375,10 +369,8 @@
 
 static int atm_vc_info(loff_t pos,char *buf)
 {
-	unsigned long flags;
-	struct atm_dev *dev;
-	struct list_head *p;
 	struct atm_vcc *vcc;
+	struct sock *s;
 	int left;
 
 	if (!pos)
@@ -386,20 +378,16 @@
 		    "Address"," Itf VPI VCI   Fam Flags Reply Send buffer"
 		    "     Recv buffer\n");
 	left = pos-1;
-	spin_lock(&atm_dev_lock);
-	list_for_each(p, &atm_devs) {
-		dev = list_entry(p, struct atm_dev, dev_list);
-		spin_lock_irqsave(&dev->lock, flags);
-		for (vcc = dev->vccs; vcc; vcc = vcc->next)
-			if (!left--) {
-				vc_info(vcc,buf);
-				spin_unlock_irqrestore(&dev->lock, flags);
-				spin_unlock(&atm_dev_lock);
-				return strlen(buf);
-			}
-		spin_unlock_irqrestore(&dev->lock, flags);
+	read_lock(&vcc_sklist_lock);
+	for(s = vcc_sklist; s; s = s->next) {
+		vcc = s->protinfo.af_atm;
+		if (!left--) {
+			vc_info(vcc,buf);
+			read_unlock(&vcc_sklist_lock);
+			return strlen(buf);
+		}
 	}
-	spin_unlock(&atm_dev_lock);
+	read_unlock(&vcc_sklist_lock);
 
 	return 0;
 }
@@ -407,29 +395,23 @@
 
 static int atm_svc_info(loff_t pos,char *buf)
 {
-	unsigned long flags;
-	struct atm_dev *dev;
-	struct list_head *p;
+	struct sock *s;
 	struct atm_vcc *vcc;
 	int left;
 
 	if (!pos)
 		return sprintf(buf,"Itf VPI VCI           State      Remote\n");
 	left = pos-1;
-	spin_lock(&atm_dev_lock);
-	list_for_each(p, &atm_devs) {
-		dev = list_entry(p, struct atm_dev, dev_list);
-		spin_lock_irqsave(&dev->lock, flags);
-		for (vcc = dev->vccs; vcc; vcc = vcc->next)
-			if (vcc->sk->family == PF_ATMSVC && !left--) {
-				svc_info(vcc,buf);
-				spin_unlock_irqrestore(&dev->lock, flags);
-				spin_unlock(&atm_dev_lock);
-				return strlen(buf);
-			}
-		spin_unlock_irqrestore(&dev->lock, flags);
+	read_lock(&vcc_sklist_lock);
+	for(s = vcc_sklist; s; s = s->next) {
+		vcc = s->protinfo.af_atm;
+		if (vcc->sk->family == PF_ATMSVC && !left--) {
+			svc_info(vcc,buf);
+			read_unlock(&vcc_sklist_lock);
+			return strlen(buf);
+		}
 	}
-	spin_unlock(&atm_dev_lock);
+	read_unlock(&vcc_sklist_lock);
 
 	return 0;
 }
diff -urN linux-2.4.23-pre7/net/atm/pvc.c linux-2.4.23-pre8/net/atm/pvc.c
--- linux-2.4.23-pre7/net/atm/pvc.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/pvc.c	2003-10-23 03:33:18.000000000 -0700
@@ -18,10 +18,6 @@
 #include "resources.h"		/* devs and vccs */
 #include "common.h"		/* common for PVCs and SVCs */
 
-#ifndef NULL
-#define NULL 0
-#endif
-
 
 static int pvc_shutdown(struct socket *sock,int how)
 {
@@ -32,20 +28,29 @@
 static int pvc_bind(struct socket *sock,struct sockaddr *sockaddr,
     int sockaddr_len)
 {
+	struct sock *sk = sock->sk;
 	struct sockaddr_atmpvc *addr;
 	struct atm_vcc *vcc;
+	int error;
 
 	if (sockaddr_len != sizeof(struct sockaddr_atmpvc)) return -EINVAL;
 	addr = (struct sockaddr_atmpvc *) sockaddr;
 	if (addr->sap_family != AF_ATMPVC) return -EAFNOSUPPORT;
+	lock_sock(sk);
 	vcc = ATM_SD(sock);
-	if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD;
+	if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) {
+		error = -EBADFD;
+		goto out;
+	}
 	if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) {
 		if (vcc->vpi != ATM_VPI_UNSPEC) addr->sap_addr.vpi = vcc->vpi;
 		if (vcc->vci != ATM_VCI_UNSPEC) addr->sap_addr.vci = vcc->vci;
 	}
-	return atm_connect(sock,addr->sap_addr.itf,addr->sap_addr.vpi,
-	    addr->sap_addr.vci);
+	error = vcc_connect(sock, addr->sap_addr.itf, addr->sap_addr.vpi,
+			   addr->sap_addr.vci);
+out:
+	release_sock(sk);
+	return error;
 }
 
 
@@ -55,6 +60,31 @@
 	return pvc_bind(sock,sockaddr,sockaddr_len);
 }
 
+static int pvc_setsockopt(struct socket *sock, int level, int optname,
+			  char *optval, int optlen)
+{
+	struct sock *sk = sock->sk;
+	int error;
+
+	lock_sock(sk);
+	error = vcc_setsockopt(sock, level, optname, optval, optlen);
+	release_sock(sk);
+	return error;
+}
+
+
+static int pvc_getsockopt(struct socket *sock, int level, int optname,
+		          char *optval, int *optlen)
+{
+	struct sock *sk = sock->sk;
+	int error;
+
+	lock_sock(sk);
+	error = vcc_getsockopt(sock, level, optname, optval, optlen);
+	release_sock(sk);
+	return error;
+}
+
 
 static int pvc_getname(struct socket *sock,struct sockaddr *sockaddr,
     int *sockaddr_len,int peer)
@@ -73,10 +103,10 @@
 }
 
 
-static struct proto_ops SOCKOPS_WRAPPED(pvc_proto_ops) = {
+static struct proto_ops pvc_proto_ops = {
 	.family =	PF_ATMPVC,
 
-	.release =	atm_release,
+	.release =	vcc_release,
 	.bind =		pvc_bind,
 	.connect =	pvc_connect,
 	.socketpair =	sock_no_socketpair,
@@ -86,23 +116,19 @@
 	.ioctl =	vcc_ioctl,
 	.listen =	sock_no_listen,
 	.shutdown =	pvc_shutdown,
-	.setsockopt =	atm_setsockopt,
-	.getsockopt =	atm_getsockopt,
-	.sendmsg =	atm_sendmsg,
-	.recvmsg =	atm_recvmsg,
+	.setsockopt =	pvc_setsockopt,
+	.getsockopt =	pvc_getsockopt,
+	.sendmsg =	vcc_sendmsg,
+	.recvmsg =	vcc_recvmsg,
 	.mmap =		sock_no_mmap,
 	.sendpage =	sock_no_sendpage,
 };
 
 
-#include <linux/smp_lock.h>
-SOCKOPS_WRAP(pvc_proto, PF_ATMPVC);
-
-
 static int pvc_create(struct socket *sock,int protocol)
 {
 	sock->ops = &pvc_proto_ops;
-	return atm_create(sock,protocol,PF_ATMPVC);
+	return vcc_create(sock, protocol, PF_ATMPVC);
 }
 
 
diff -urN linux-2.4.23-pre7/net/atm/resources.c linux-2.4.23-pre8/net/atm/resources.c
--- linux-2.4.23-pre7/net/atm/resources.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/resources.c	2003-10-23 03:33:18.000000000 -0700
@@ -19,11 +19,6 @@
 #include "addr.h"
 
 
-#ifndef NULL
-#define NULL 0
-#endif
-
-
 LIST_HEAD(atm_devs);
 spinlock_t atm_dev_lock = SPIN_LOCK_UNLOCKED;
 
@@ -90,7 +85,7 @@
 	spin_lock(&atm_dev_lock);
 	if (number != -1) {
 		if ((inuse = __atm_dev_lookup(number))) {
-			atm_dev_release(inuse);
+			atm_dev_put(inuse);
 			spin_unlock(&atm_dev_lock);
 			__free_atm_dev(dev);
 			return NULL;
@@ -99,13 +94,11 @@
 	} else {
 		dev->number = 0;
 		while ((inuse = __atm_dev_lookup(dev->number))) {
-			atm_dev_release(inuse);
+			atm_dev_put(inuse);
 			dev->number++;
 		}
 	}
-	dev->vccs = dev->last = NULL;
-	dev->dev_data = NULL;
-	barrier();
+
 	dev->ops = ops;
 	if (flags) 
 		dev->flags = *flags;
@@ -140,7 +133,8 @@
 	unsigned long warning_time;
 
 #ifdef CONFIG_PROC_FS
-	if (dev->ops->proc_read) atm_proc_dev_deregister(dev);
+	if (dev->ops->proc_read)
+		atm_proc_dev_deregister(dev);
 #endif
 	spin_lock(&atm_dev_lock);
 	list_del(&dev->dev_list);
@@ -400,87 +394,12 @@
 			  ? -EFAULT : 0;
 	}
 done:
-	atm_dev_release(dev);
+	atm_dev_put(dev);
 	return error;
 }
 
 
-
-/* Handler for sk->destruct, invoked by sk_free() */
-static void atm_free_sock(struct sock *sk)
-{
-	kfree(sk->protinfo.af_atm);
-}
-
-struct sock *alloc_atm_vcc_sk(int family)
-{
-	struct sock *sk;
-	struct atm_vcc *vcc;
-
-	sk = sk_alloc(family, GFP_KERNEL, 1);
-	if (!sk)
-		return NULL;
-	vcc = sk->protinfo.af_atm = kmalloc(sizeof(*vcc), GFP_KERNEL);
-	if (!vcc) {
-		sk_free(sk);
-		return NULL;
-	}
-	sock_init_data(NULL, sk);
-	sk->destruct = atm_free_sock;
-	memset(vcc, 0, sizeof(*vcc));
-	vcc->sk = sk;
-
-	return sk;
-}
-
-
-static void unlink_vcc(struct atm_vcc *vcc)
-{
-	unsigned long flags;
-	if (vcc->dev) {
-		spin_lock_irqsave(&vcc->dev->lock, flags);
-		if (vcc->prev)
-			vcc->prev->next = vcc->next;
-		else
-			vcc->dev->vccs = vcc->next;
-
-		if (vcc->next)
-			vcc->next->prev = vcc->prev;
-		else
-			vcc->dev->last = vcc->prev;
-		spin_unlock_irqrestore(&vcc->dev->lock, flags);
-	}
-}
-
-
-
-void free_atm_vcc_sk(struct sock *sk)
-{
-	unlink_vcc(sk->protinfo.af_atm);
-	sk_free(sk);
-}
-
-
-void bind_vcc(struct atm_vcc *vcc,struct atm_dev *dev)
-{
-	unsigned long flags;
-
-	unlink_vcc(vcc);
-	vcc->dev = dev;
-	if (dev) {
-		spin_lock_irqsave(&dev->lock, flags);
-		vcc->next = NULL;
-		vcc->prev = dev->last;
-		if (dev->vccs) dev->last->next = vcc;
-		else dev->vccs = vcc;
-		dev->last = vcc;
-		spin_unlock_irqrestore(&dev->lock, flags);
-	}
-}
-
-
 EXPORT_SYMBOL(atm_dev_register);
 EXPORT_SYMBOL(atm_dev_deregister);
 EXPORT_SYMBOL(atm_dev_lookup);
 EXPORT_SYMBOL(shutdown_atm_dev);
-EXPORT_SYMBOL(bind_vcc);
diff -urN linux-2.4.23-pre7/net/atm/resources.h linux-2.4.23-pre8/net/atm/resources.h
--- linux-2.4.23-pre7/net/atm/resources.h	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/resources.h	2003-10-23 03:33:18.000000000 -0700
@@ -14,8 +14,6 @@
 extern spinlock_t atm_dev_lock;
 
 
-struct sock *alloc_atm_vcc_sk(int family);
-void free_atm_vcc_sk(struct sock *sk);
 int atm_dev_ioctl(unsigned int cmd, unsigned long arg);
 
 
diff -urN linux-2.4.23-pre7/net/atm/signaling.c linux-2.4.23-pre8/net/atm/signaling.c
--- linux-2.4.23-pre7/net/atm/signaling.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/signaling.c	2003-10-23 03:33:18.000000000 -0700
@@ -124,26 +124,31 @@
 			clear_bit(ATM_VF_REGIS,&vcc->flags);
 			clear_bit(ATM_VF_READY,&vcc->flags);
 			vcc->reply = msg->reply;
+			vcc->sk->err = -msg->reply;
 			break;
 		case as_indicate:
 			vcc = *(struct atm_vcc **) &msg->listen_vcc;
 			DPRINTK("as_indicate!!!\n");
-			if (!vcc->backlog_quota) {
+			lock_sock(vcc->sk);
+			if (vcc->sk->ack_backlog == vcc->sk->max_ack_backlog) {
 				sigd_enq(0,as_reject,vcc,NULL,NULL);
-				return 0;
+				goto as_indicate_complete;
 			}
-			vcc->backlog_quota--;
-			skb_queue_tail(&vcc->listenq,skb);
+			vcc->sk->ack_backlog++;
+			skb_queue_tail(&vcc->sk->receive_queue,skb);
 			if (vcc->callback) {
 				DPRINTK("waking vcc->sleep 0x%p\n",
 				    &vcc->sleep);
 				vcc->callback(vcc);
 			}
+as_indicate_complete:
+			release_sock(vcc->sk);
 			return 0;
 		case as_close:
 			set_bit(ATM_VF_RELEASED,&vcc->flags);
 			clear_bit(ATM_VF_READY,&vcc->flags);
 			vcc->reply = msg->reply;
+			vcc->sk->err = -msg->reply;
 			break;
 		case as_modify:
 			modify_qos(vcc,msg);
@@ -194,25 +199,21 @@
 }
 
 
-static void purge_vccs(struct atm_vcc *vcc)
+static void purge_vcc(struct atm_vcc *vcc)
 {
-	while (vcc) {
-		if (vcc->sk->family == PF_ATMSVC &&
-		    !test_bit(ATM_VF_META,&vcc->flags)) {
-			set_bit(ATM_VF_RELEASED,&vcc->flags);
-			vcc->reply = -EUNATCH;
-			wake_up(&vcc->sleep);
-		}
-		vcc = vcc->next;
+	if (vcc->sk->family == PF_ATMSVC &&
+	    !test_bit(ATM_VF_META, &vcc->flags)) {
+		set_bit(ATM_VF_RELEASED, &vcc->flags);
+		vcc->reply = -EUNATCH;
+		vcc->sk->err = EUNATCH;
+		wake_up(&vcc->sleep);
 	}
 }
 
 
 static void sigd_close(struct atm_vcc *vcc)
 {
-	unsigned long flags;
-	struct atm_dev *dev;
-	struct list_head *p;
+	struct sock *s;
 
 	DPRINTK("sigd_close\n");
 	sigd = NULL;
@@ -220,14 +221,14 @@
 		printk(KERN_ERR "sigd_close: closing with requests pending\n");
 	skb_queue_purge(&vcc->sk->receive_queue);
 
-	spin_lock(&atm_dev_lock);
-	list_for_each(p, &atm_devs) {
-		dev = list_entry(p, struct atm_dev, dev_list);
-		spin_lock_irqsave(&dev->lock, flags);
-		purge_vccs(dev->vccs);
-		spin_unlock_irqrestore(&dev->lock, flags);
+	read_lock(&vcc_sklist_lock);
+	for(s = vcc_sklist; s; s = s->next) {
+		struct atm_vcc *vcc = s->protinfo.af_atm;
+
+		if (vcc->dev)
+			purge_vcc(vcc);
 	}
-	spin_unlock(&atm_dev_lock);
+	read_unlock(&vcc_sklist_lock);
 }
 
 
@@ -250,7 +251,8 @@
 	if (sigd) return -EADDRINUSE;
 	DPRINTK("sigd_attach\n");
 	sigd = vcc;
-	bind_vcc(vcc,&sigd_dev);
+	vcc->dev = &sigd_dev;
+	vcc_insert_socket(vcc->sk);
 	set_bit(ATM_VF_META,&vcc->flags);
 	set_bit(ATM_VF_READY,&vcc->flags);
 	wake_up(&sigd_sleep);
diff -urN linux-2.4.23-pre7/net/atm/svc.c linux-2.4.23-pre8/net/atm/svc.c
--- linux-2.4.23-pre7/net/atm/svc.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/atm/svc.c	2003-10-23 03:33:18.000000000 -0700
@@ -75,7 +75,7 @@
 	}
 	/* beware - socket is still in use by atmsigd until the last
 	   as_indicate has been answered */
-	while ((skb = skb_dequeue(&vcc->listenq))) {
+	while ((skb = skb_dequeue(&vcc->sk->receive_queue))) {
 		DPRINTK("LISTEN REL\n");
 		sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0);
 		dev_kfree_skb(skb);
@@ -89,18 +89,21 @@
 
 static int svc_release(struct socket *sock)
 {
+	struct sock *sk = sock->sk;
 	struct atm_vcc *vcc;
 
-	if (!sock->sk) return 0;
-	vcc = ATM_SD(sock);
-	DPRINTK("svc_release %p\n",vcc);
-	clear_bit(ATM_VF_READY,&vcc->flags);
-	atm_release_vcc_sk(sock->sk,0);
-	svc_disconnect(vcc);
-	    /* VCC pointer is used as a reference, so we must not free it
-	       (thereby subjecting it to re-use) before all pending connections
-	        are closed */
-	free_atm_vcc_sk(sock->sk);
+	if (sk)  {
+		vcc = ATM_SD(sock);
+		DPRINTK("svc_release %p\n", vcc);
+		clear_bit(ATM_VF_READY, &vcc->flags);
+		/* VCC pointer is used as a reference, so we must not free it
+		   (thereby subjecting it to re-use) before all pending connections
+	           are closed */
+		sock_hold(sk);
+		vcc_release(sock);
+		svc_disconnect(vcc);
+		sock_put(sk);
+	}
 	return 0;
 }
 
@@ -109,20 +112,39 @@
     int sockaddr_len)
 {
 	DECLARE_WAITQUEUE(wait,current);
+	struct sock *sk = sock->sk;
 	struct sockaddr_atmsvc *addr;
 	struct atm_vcc *vcc;
+	int error;
 
-	if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) return -EINVAL;
-	if (sock->state == SS_CONNECTED) return -EISCONN;
-	if (sock->state != SS_UNCONNECTED) return -EINVAL;
+	if (sockaddr_len != sizeof(struct sockaddr_atmsvc))
+		return -EINVAL;
+	lock_sock(sk);
+	if (sock->state == SS_CONNECTED) {
+		error = -EISCONN;
+		goto out;
+	}
+	if (sock->state != SS_UNCONNECTED) {
+		error = -EINVAL;
+		goto out;
+	}
 	vcc = ATM_SD(sock);
-	if (test_bit(ATM_VF_SESSION,&vcc->flags)) return -EINVAL;
+	if (test_bit(ATM_VF_SESSION, &vcc->flags)) {
+		error = -EINVAL;
+		goto out;
+	}
 	addr = (struct sockaddr_atmsvc *) sockaddr;
-	if (addr->sas_family != AF_ATMSVC) return -EAFNOSUPPORT;
+	if (addr->sas_family != AF_ATMSVC) {
+		error = -EAFNOSUPPORT;
+		goto out;
+	}
 	clear_bit(ATM_VF_BOUND,&vcc->flags);
 	    /* failing rebind will kill old binding */
 	/* @@@ check memory (de)allocation on rebind */
-	if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD;
+	if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) {
+		error = -EBADFD;
+		goto out;
+	}
 	vcc->local = *addr;
 	vcc->reply = WAITING;
 	add_wait_queue(&vcc->sleep,&wait);
@@ -133,9 +155,16 @@
 	}
 	remove_wait_queue(&vcc->sleep,&wait);
 	clear_bit(ATM_VF_REGIS,&vcc->flags); /* doesn't count */
-	if (!sigd) return -EUNATCH;
-        if (!vcc->reply) set_bit(ATM_VF_BOUND,&vcc->flags);
-	return vcc->reply;
+	if (!sigd) {
+		error = -EUNATCH;
+		goto out;
+	}
+        if (!vcc->reply)
+		set_bit(ATM_VF_BOUND,&vcc->flags);
+	error = vcc->reply;
+out:
+	release_sock(sk);
+	return error;
 }
 
 
@@ -143,31 +172,60 @@
     int sockaddr_len,int flags)
 {
 	DECLARE_WAITQUEUE(wait,current);
+	struct sock *sk = sock->sk;
 	struct sockaddr_atmsvc *addr;
 	struct atm_vcc *vcc = ATM_SD(sock);
 	int error;
 
 	DPRINTK("svc_connect %p\n",vcc);
-	if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) return -EINVAL;
-	if (sock->state == SS_CONNECTED) return -EISCONN;
-	if (sock->state == SS_CONNECTING) {
-		if (vcc->reply == WAITING) return -EALREADY;
-		sock->state = SS_UNCONNECTED;
-		if (vcc->reply) return vcc->reply;
+	lock_sock(sk);
+	if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) {
+		error = -EINVAL;
+		goto out;
 	}
-	else {
-		int error;
 
-		if (sock->state != SS_UNCONNECTED) return -EINVAL;
-		if (test_bit(ATM_VF_SESSION,&vcc->flags)) return -EINVAL;
+	switch (sock->state) {
+	default:
+		error = -EINVAL;
+		goto out;
+	case SS_CONNECTED:
+		error = -EISCONN;
+		goto out;
+	case SS_CONNECTING:
+		if (vcc->reply == WAITING) {
+			error = -EALREADY;
+			goto out;
+		}
+		sock->state = SS_UNCONNECTED;
+		if (vcc->reply) {
+			error = vcc->reply;
+			goto out;
+		}
+		break;
+	case SS_UNCONNECTED:
+		if (test_bit(ATM_VF_SESSION, &vcc->flags)) {
+			error = -EINVAL;
+			goto out;
+		}
 		addr = (struct sockaddr_atmsvc *) sockaddr;
-		if (addr->sas_family != AF_ATMSVC) return -EAFNOSUPPORT;
-		if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD;
+		if (addr->sas_family != AF_ATMSVC) {
+			error = -EAFNOSUPPORT;
+			goto out;
+		}
+		if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) {
+			error = -EBADFD;
+			goto out;
+		}
 		if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS ||
-		    vcc->qos.rxtp.traffic_class == ATM_ANYCLASS)
-			return -EINVAL;
+		    vcc->qos.rxtp.traffic_class == ATM_ANYCLASS) {
+			error = -EINVAL;
+			goto out;
+		}
 		if (!vcc->qos.txtp.traffic_class &&
-		    !vcc->qos.rxtp.traffic_class) return -EINVAL;
+		    !vcc->qos.rxtp.traffic_class) {
+			error = -EINVAL;
+			goto out;
+		}
 		vcc->remote = *addr;
 		vcc->reply = WAITING;
 		add_wait_queue(&vcc->sleep,&wait);
@@ -175,7 +233,8 @@
 		if (flags & O_NONBLOCK) {
 			remove_wait_queue(&vcc->sleep,&wait);
 			sock->state = SS_CONNECTING;
-			return -EINPROGRESS;
+			error = -EINPROGRESS;
+			goto out;
 		}
 		error = 0;
 		while (vcc->reply == WAITING && sigd) {
@@ -214,9 +273,16 @@
 			break;
 		}
 		remove_wait_queue(&vcc->sleep,&wait);
-		if (error) return error;
-		if (!sigd) return -EUNATCH;
-		if (vcc->reply) return vcc->reply;
+		if (error)
+			goto out;
+		if (!sigd) {
+			error = -EUNATCH;
+			goto out;
+		}
+		if (vcc->reply) {
+			error = vcc->reply;
+			goto out;
+		}
 	}
 /*
  * Not supported yet
@@ -229,9 +295,11 @@
 /*
  * #endif
  */
-	if (!(error = atm_connect(sock,vcc->itf,vcc->vpi,vcc->vci)))
+	if (!(error = vcc_connect(sock, vcc->itf, vcc->vpi, vcc->vci)))
 		sock->state = SS_CONNECTED;
 	else (void) svc_disconnect(vcc);
+out:
+	release_sock(sk);
 	return error;
 }
 
@@ -239,11 +307,17 @@
 static int svc_listen(struct socket *sock,int backlog)
 {
 	DECLARE_WAITQUEUE(wait,current);
+	struct sock *sk = sock->sk;
 	struct atm_vcc *vcc = ATM_SD(sock);
+	int error;
 
 	DPRINTK("svc_listen %p\n",vcc);
+	lock_sock(sk);
 	/* let server handle listen on unbound sockets */
-	if (test_bit(ATM_VF_SESSION,&vcc->flags)) return -EINVAL;
+	if (test_bit(ATM_VF_SESSION,&vcc->flags)) {
+		error = -EINVAL;
+		goto out;
+	}
 	vcc->reply = WAITING;
 	add_wait_queue(&vcc->sleep,&wait);
 	sigd_enq(vcc,as_listen,NULL,NULL,&vcc->local);
@@ -252,24 +326,33 @@
 		schedule();
 	}
 	remove_wait_queue(&vcc->sleep,&wait);
-	if (!sigd) return -EUNATCH;
+	if (!sigd) {
+		error = -EUNATCH;
+		goto out;
+	}
 	set_bit(ATM_VF_LISTEN,&vcc->flags);
-	vcc->backlog_quota = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT;
-	return vcc->reply;
+	vcc->sk->max_ack_backlog = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT;
+	error = vcc->reply;
+out:
+	release_sock(sk);
+	return error;
 }
 
 
 static int svc_accept(struct socket *sock,struct socket *newsock,int flags)
 {
+	struct sock *sk = sock->sk;
 	struct sk_buff *skb;
 	struct atmsvc_msg *msg;
 	struct atm_vcc *old_vcc = ATM_SD(sock);
 	struct atm_vcc *new_vcc;
 	int error;
 
+	lock_sock(sk);
+
 	error = svc_create(newsock,0);
 	if (error)
-		return error;
+		goto out;
 
 	new_vcc = ATM_SD(newsock);
 
@@ -278,7 +361,7 @@
 		DECLARE_WAITQUEUE(wait,current);
 
 		add_wait_queue(&old_vcc->sleep,&wait);
-		while (!(skb = skb_dequeue(&old_vcc->listenq)) && sigd) {
+		while (!(skb = skb_dequeue(&old_vcc->sk->receive_queue)) && sigd) {
 			if (test_bit(ATM_VF_RELEASED,&old_vcc->flags)) break;
 			if (test_bit(ATM_VF_CLOSE,&old_vcc->flags)) {
 				error = old_vcc->reply;
@@ -288,30 +371,36 @@
 				error = -EAGAIN;
 				break;
 			}
-			set_current_state(TASK_INTERRUPTIBLE);
+			release_sock(sk);
 			schedule();
+			lock_sock(sk);
 			if (signal_pending(current)) {
 				error = -ERESTARTSYS;
 				break;
 			}
 		}
 		remove_wait_queue(&old_vcc->sleep,&wait);
-		if (error) return error;
-		if (!skb) return -EUNATCH;
+		if (error)
+			goto out;
+		if (!skb) {
+			error = -EUNATCH;
+			goto out;
+		}
 		msg = (struct atmsvc_msg *) skb->data;
 		new_vcc->qos = msg->qos;
 		set_bit(ATM_VF_HASQOS,&new_vcc->flags);
 		new_vcc->remote = msg->svc;
 		new_vcc->local = msg->local;
 		new_vcc->sap = msg->sap;
-		error = atm_connect(newsock,msg->pvc.sap_addr.itf,
-		    msg->pvc.sap_addr.vpi,msg->pvc.sap_addr.vci);
+		error = vcc_connect(newsock, msg->pvc.sap_addr.itf,
+				    msg->pvc.sap_addr.vpi, msg->pvc.sap_addr.vci);
 		dev_kfree_skb(skb);
-		old_vcc->backlog_quota++;
+		old_vcc->sk->ack_backlog--;
 		if (error) {
 			sigd_enq2(NULL,as_reject,old_vcc,NULL,NULL,
 			    &old_vcc->qos,error);
-			return error == -EAGAIN ? -EBUSY : error;
+			error = error == -EAGAIN ? -EBUSY : error;
+			goto out;
 		}
 		/* wait should be short, so we ignore the non-blocking flag */
 		new_vcc->reply = WAITING;
@@ -319,15 +408,25 @@
 		sigd_enq(new_vcc,as_accept,old_vcc,NULL,NULL);
 		while (new_vcc->reply == WAITING && sigd) {
 			set_current_state(TASK_UNINTERRUPTIBLE);
+			release_sock(sk);
 			schedule();
+			lock_sock(sk);
 		}
 		remove_wait_queue(&new_vcc->sleep,&wait);
-		if (!sigd) return -EUNATCH;
+		if (!sigd) {
+			error = -EUNATCH;
+			goto out;
+		}
 		if (!new_vcc->reply) break;
-		if (new_vcc->reply != -ERESTARTSYS) return new_vcc->reply;
+		if (new_vcc->reply != -ERESTARTSYS) {
+			error = new_vcc->reply;
+			goto out;
+		}
 	}
 	newsock->state = SS_CONNECTED;
-	return 0;
+out:
+	release_sock(sk);
+	return error;
 }
 
 
@@ -365,33 +464,57 @@
 static int svc_setsockopt(struct socket *sock,int level,int optname,
     char *optval,int optlen)
 {
+	struct sock *sk = sock->sk;
 	struct atm_vcc *vcc;
+	int error = 0;
 
 	if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP ||
-	    optlen != sizeof(struct atm_sap))
-		return atm_setsockopt(sock,level,optname,optval,optlen);
+	    optlen != sizeof(struct atm_sap)) {
+		error = vcc_setsockopt(sock, level, optname, optval, optlen);
+		goto out;
+	}
 	vcc = ATM_SD(sock);
-	if (copy_from_user(&vcc->sap,optval,optlen)) return -EFAULT;
-	set_bit(ATM_VF_HASSAP,&vcc->flags);
-	return 0;
+	if (copy_from_user(&vcc->sap, optval, optlen)) {
+		error = -EFAULT;
+		goto out;
+	}
+	set_bit(ATM_VF_HASSAP, &vcc->flags);
+out:
+	release_sock(sk);
+	return error;
 }
 
 
 static int svc_getsockopt(struct socket *sock,int level,int optname,
     char *optval,int *optlen)
 {
-	int len;
+	struct sock *sk = sock->sk;
+	int error = 0, len;
 
-	if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP)
-		return atm_getsockopt(sock,level,optname,optval,optlen);
-	if (get_user(len,optlen)) return -EFAULT;
-	if (len != sizeof(struct atm_sap)) return -EINVAL;
-	return copy_to_user(optval,&ATM_SD(sock)->sap,sizeof(struct atm_sap)) ?
-	    -EFAULT : 0;
+	lock_sock(sk);
+	if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP) {
+		error = vcc_getsockopt(sock, level, optname, optval, optlen);
+		goto out;
+	}
+	if (get_user(len, optlen)) {
+		error = -EFAULT;
+		goto out;
+	}
+	if (len != sizeof(struct atm_sap)) {
+		error = -EINVAL;
+		goto out;
+	}
+	if (copy_to_user(optval, &ATM_SD(sock)->sap, sizeof(struct atm_sap))) {
+		error = -EFAULT;
+		goto out;
+	}
+out:
+	release_sock(sk);
+	return error;
 }
 
 
-static struct proto_ops SOCKOPS_WRAPPED(svc_proto_ops) = {
+static struct proto_ops svc_proto_ops = {
 	.family =	PF_ATMSVC,
 
 	.release =	svc_release,
@@ -406,22 +529,19 @@
 	.shutdown =	svc_shutdown,
 	.setsockopt =	svc_setsockopt,
 	.getsockopt =	svc_getsockopt,
-	.sendmsg =	atm_sendmsg,
-	.recvmsg =	atm_recvmsg,
+	.sendmsg =	vcc_sendmsg,
+	.recvmsg =	vcc_recvmsg,
 	.mmap =		sock_no_mmap,
 	.sendpage =	sock_no_sendpage,
 };
 
 
-#include <linux/smp_lock.h>
-SOCKOPS_WRAP(svc_proto, PF_ATMSVC);
-
 static int svc_create(struct socket *sock,int protocol)
 {
 	int error;
 
 	sock->ops = &svc_proto_ops;
-	error = atm_create(sock,protocol,AF_ATMSVC);
+	error = vcc_create(sock, protocol, AF_ATMSVC);
 	if (error) return error;
 	ATM_SD(sock)->callback = svc_callback;
 	ATM_SD(sock)->local.sas_family = AF_ATMSVC;
diff -urN linux-2.4.23-pre7/net/core/ethtool.c linux-2.4.23-pre8/net/core/ethtool.c
--- linux-2.4.23-pre7/net/core/ethtool.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/core/ethtool.c	2003-10-23 03:33:18.000000000 -0700
@@ -106,7 +106,8 @@
 		info.n_stats = ops->get_stats_count(dev);
 	if (ops->get_regs_len)
 		info.regdump_len = ops->get_regs_len(dev);
-	/* XXX: eeprom? */
+	if (ops->get_eeprom_len)
+		info.eedump_len = ops->get_eeprom_len(dev);
 
 	if (copy_to_user(useraddr, &info, sizeof(info)))
 		return -EFAULT;
@@ -229,29 +230,34 @@
 static int ethtool_get_eeprom(struct net_device *dev, void *useraddr)
 {
 	struct ethtool_eeprom eeprom;
+	struct ethtool_ops *ops = dev->ethtool_ops;
 	u8 *data;
-	int len, ret;
+	int ret;
 
-	if (!dev->ethtool_ops->get_eeprom)
+	if (!ops->get_eeprom || !ops->get_eeprom_len)
 		return -EOPNOTSUPP;
 
 	if (copy_from_user(&eeprom, useraddr, sizeof(eeprom)))
 		return -EFAULT;
 
-	len = eeprom.len;
 	/* Check for wrap and zero */
-	if (eeprom.offset + len <= eeprom.offset)
+	if (eeprom.offset + eeprom.len <= eeprom.offset)
+		return -EINVAL;
+
+	/* Check for exceeding total eeprom len */
+	if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev))
 		return -EINVAL;
 
-	data = kmalloc(len, GFP_USER);
+	data = kmalloc(eeprom.len, GFP_USER);
 	if (!data)
 		return -ENOMEM;
 
-	if (copy_from_user(data, useraddr + sizeof(eeprom), len))
-		return -EFAULT;
+	ret = -EFAULT;
+	if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len))
+		goto out;
 
-	ret = dev->ethtool_ops->get_eeprom(dev, &eeprom, data);
-	if (!ret)
+	ret = ops->get_eeprom(dev, &eeprom, data);
+	if (ret)
 		goto out;
 
 	ret = -EFAULT;
@@ -269,32 +275,37 @@
 static int ethtool_set_eeprom(struct net_device *dev, void *useraddr)
 {
 	struct ethtool_eeprom eeprom;
+	struct ethtool_ops *ops = dev->ethtool_ops;
 	u8 *data;
-	int len, ret;
+	int ret;
 
-	if (!dev->ethtool_ops->set_eeprom)
+	if (!ops->set_eeprom || !ops->get_eeprom_len)
 		return -EOPNOTSUPP;
 
 	if (copy_from_user(&eeprom, useraddr, sizeof(eeprom)))
 		return -EFAULT;
 
-	len = eeprom.len;
 	/* Check for wrap and zero */
-	if (eeprom.offset + len <= eeprom.offset)
+	if (eeprom.offset + eeprom.len <= eeprom.offset)
+		return -EINVAL;
+
+	/* Check for exceeding total eeprom len */
+	if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev))
 		return -EINVAL;
 
-	data = kmalloc(len, GFP_USER);
+	data = kmalloc(eeprom.len, GFP_USER);
 	if (!data)
 		return -ENOMEM;
 
-	if (copy_from_user(data, useraddr + sizeof(eeprom), len))
-		return -EFAULT;
+	ret = -EFAULT;
+	if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len))
+		goto out;
 
-	ret = dev->ethtool_ops->set_eeprom(dev, &eeprom, data);
+	ret = ops->set_eeprom(dev, &eeprom, data);
 	if (ret)
 		goto out;
 
-	if (copy_to_user(useraddr + sizeof(eeprom), data, len))
+	if (copy_to_user(useraddr + sizeof(eeprom), data, eeprom.len))
 		ret = -EFAULT;
 
  out:
diff -urN linux-2.4.23-pre7/net/ipv4/ip_output.c linux-2.4.23-pre8/net/ipv4/ip_output.c
--- linux-2.4.23-pre7/net/ipv4/ip_output.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/ipv4/ip_output.c	2003-10-23 03:33:18.000000000 -0700
@@ -879,6 +879,7 @@
 #endif
 #ifdef CONFIG_NETFILTER
 		skb2->nfmark = skb->nfmark;
+		skb2->nfcache = skb->nfcache;
 		/* Connection association is same as pre-frag packet */
 		skb2->nfct = skb->nfct;
 		nf_conntrack_get(skb2->nfct);
diff -urN linux-2.4.23-pre7/net/ipv4/ipvs/ip_vs_ctl.c linux-2.4.23-pre8/net/ipv4/ipvs/ip_vs_ctl.c
--- linux-2.4.23-pre7/net/ipv4/ipvs/ip_vs_ctl.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/ipv4/ipvs/ip_vs_ctl.c	2003-10-23 03:33:18.000000000 -0700
@@ -653,6 +653,15 @@
 }
 
 
+static inline void
+__ip_vs_zero_stats(struct ip_vs_stats *stats)
+{
+	spin_lock_bh(&stats->lock);
+	memset(stats, 0, (char *)&stats->lock - (char *)stats);
+	spin_unlock_bh(&stats->lock);
+	ip_vs_zero_estimator(stats);
+}
+
 /*
  *  Update a destination in the given service
  */
@@ -699,6 +708,7 @@
 	} else {
 		if (dest->svc != svc) {
 			__ip_vs_unbind_svc(dest);
+			__ip_vs_zero_stats(&dest->stats);
 			__ip_vs_bind_svc(dest, svc);
 		}
 	}
@@ -1282,15 +1292,6 @@
 /*
  *  Zero counters in a service or all services
  */
-static inline void
-__ip_vs_zero_stats(struct ip_vs_stats *stats)
-{
-	spin_lock_bh(&stats->lock);
-	memset(stats, 0, (char *)&stats->lock - (char *)stats);
-	spin_unlock_bh(&stats->lock);
-	ip_vs_zero_estimator(stats);
-}
-
 static int ip_vs_zero_service(struct ip_vs_service *svc)
 {
 	struct list_head *l;
diff -urN linux-2.4.23-pre7/net/ipv4/ipvs/ip_vs_ftp.c linux-2.4.23-pre8/net/ipv4/ipvs/ip_vs_ftp.c
--- linux-2.4.23-pre7/net/ipv4/ipvs/ip_vs_ftp.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/ipv4/ipvs/ip_vs_ftp.c	2003-10-23 03:33:18.000000000 -0700
@@ -304,11 +304,12 @@
 	 */
 	IP_VS_DBG(1-debug, "protocol %s %u.%u.%u.%u:%d %u.%u.%u.%u:%d\n",
 		  ip_vs_proto_name(iph->protocol),
-		  NIPQUAD(to), ntohs(port), NIPQUAD(iph->daddr), 0);
+		  NIPQUAD(to), ntohs(port),
+		  NIPQUAD(cp->vaddr), ntohs(cp->vport) - 1);
 
 	n_cp = ip_vs_conn_in_get(iph->protocol,
 				 to, port,
-				 iph->daddr, htons(ntohs(cp->vport)-1));
+				 cp->vaddr, htons(ntohs(cp->vport)-1));
 	if (!n_cp) {
 		n_cp = ip_vs_conn_new(IPPROTO_TCP,
 				      to, port,
diff -urN linux-2.4.23-pre7/net/ipv4/netfilter/ip_nat_helper.c linux-2.4.23-pre8/net/ipv4/netfilter/ip_nat_helper.c
--- linux-2.4.23-pre7/net/ipv4/netfilter/ip_nat_helper.c	2003-10-23 03:33:15.000000000 -0700
+++ linux-2.4.23-pre8/net/ipv4/netfilter/ip_nat_helper.c	2003-10-23 03:33:18.000000000 -0700
@@ -233,6 +233,13 @@
 	newudplen = udplen - match_len + rep_len;
 	newlen = iph->ihl*4 + newudplen;
 
+	/* UDP helpers might accidentally mangle the wrong packet */
+	if (udplen < sizeof(*udph) + match_offset + match_len) {
+		if (net_ratelimit())
+			printk("ip_nat_mangle_udp_packet: undersized packet\n");
+		return 0;
+	}
+
 	if (newlen > 65535) {
 		if (net_ratelimit())
 			printk("ip_nat_mangle_udp_packet: nat'ed packet "
diff -urN linux-2.4.23-pre7/net/ipv6/netfilter/ip6t_ipv6header.c linux-2.4.23-pre8/net/ipv6/netfilter/ip6t_ipv6header.c
--- linux-2.4.23-pre7/net/ipv6/netfilter/ip6t_ipv6header.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/ipv6/netfilter/ip6t_ipv6header.c	2003-10-23 03:33:18.000000000 -0700
@@ -129,20 +129,13 @@
 	return 1;
 }
 
-static void
-ipv6header_destroy(void *matchinfo,
-		   unsigned int matchinfosize)
-{
-	return;
-}
-
 static struct ip6t_match
 ip6t_ipv6header_match = {
 	{ NULL, NULL },
 	"ipv6header",
 	&ipv6header_match,
 	&ipv6header_checkentry,
-	&ipv6header_destroy,
+	NULL,
 	THIS_MODULE
 };
 
diff -urN linux-2.4.23-pre7/net/irda/af_irda.c linux-2.4.23-pre8/net/irda/af_irda.c
--- linux-2.4.23-pre7/net/irda/af_irda.c	2002-11-28 15:53:16.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/af_irda.c	2003-10-23 03:33:18.000000000 -0700
@@ -98,7 +98,7 @@
 	struct sock *sk;
 	int err;
 
-	IRDA_DEBUG(3, __FUNCTION__ "()\n");
+	IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
 
 	self = (struct irda_sock *) instance;
 	ASSERT(self != NULL, return -1;);
@@ -108,7 +108,7 @@
 
 	err = sock_queue_rcv_skb(sk, skb);
 	if (err) {
-		IRDA_DEBUG(1, __FUNCTION__ "(), error: no more mem!\n");
+		IRDA_DEBUG(1, "%s(), error: no more mem!\n", __FUNCTION__);
 		self->rx_flow = FLOW_STOP;
 
 		/* When we return error, TTP will need to requeue the skb */
@@ -132,7 +132,7 @@
 
 	self = (struct irda_sock *) instance;
 
-	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
+	IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
 
 	/* Don't care about it, but let's not leak it */
 	if(skb)
@@ -194,7 +194,7 @@
 
 	self = (struct irda_sock *) instance;
 
-	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
+	IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
 
 	sk = self->sk;
 	if (sk == NULL)
@@ -210,14 +210,14 @@
 	switch (sk->type) {
 	case SOCK_STREAM:
 		if (max_sdu_size != 0) {
-			ERROR(__FUNCTION__ "(), max_sdu_size must be 0\n");
+			ERROR("%s(), max_sdu_size must be 0\n", __FUNCTION__);
 			return;
 		}
 		self->max_data_size = irttp_get_max_seg_size(self->tsap);
 		break;
 	case SOCK_SEQPACKET:
 		if (max_sdu_size == 0) {
-			ERROR(__FUNCTION__ "(), max_sdu_size cannot be 0\n");
+			ERROR("%s(), max_sdu_size cannot be 0\n", __FUNCTION__);
 			return;
 		}
 		self->max_data_size = max_sdu_size;
@@ -226,7 +226,7 @@
 		self->max_data_size = irttp_get_max_seg_size(self->tsap);
 	};
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), max_data_size=%d\n", 
+	IRDA_DEBUG(2, "%s(), max_data_size=%d\n", __FUNCTION__,
 		   self->max_data_size);
 
 	memcpy(&self->qos_tx, qos, sizeof(struct qos_info));
@@ -253,7 +253,7 @@
 
  	self = (struct irda_sock *) instance;
 
-	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
+	IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
 
 	sk = self->sk;
 	if (sk == NULL)
@@ -269,14 +269,14 @@
 	switch (sk->type) {
 	case SOCK_STREAM:
 		if (max_sdu_size != 0) {
-			ERROR(__FUNCTION__ "(), max_sdu_size must be 0\n");
+			ERROR("%s(), max_sdu_size must be 0\n", __FUNCTION__);
 			return;
 		}
 		self->max_data_size = irttp_get_max_seg_size(self->tsap);
 		break;
 	case SOCK_SEQPACKET:
 		if (max_sdu_size == 0) {
-			ERROR(__FUNCTION__ "(), max_sdu_size cannot be 0\n");
+			ERROR("%s(), max_sdu_size cannot be 0\n", __FUNCTION__);
 			return;
 		}
 		self->max_data_size = max_sdu_size;
@@ -285,7 +285,7 @@
 		self->max_data_size = irttp_get_max_seg_size(self->tsap);
 	};
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), max_data_size=%d\n", 
+	IRDA_DEBUG(2, "%s(), max_data_size=%d\n", __FUNCTION__
 		   self->max_data_size);
 
 	memcpy(&self->qos_tx, qos, sizeof(struct qos_info));
@@ -304,13 +304,13 @@
 {
 	struct sk_buff *skb;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 
 	skb = dev_alloc_skb(64);
 	if (skb == NULL) {
-		IRDA_DEBUG(0, __FUNCTION__ "() Unable to allocate sk_buff!\n");
+		IRDA_DEBUG(0, "%s() Unable to allocate sk_buff!\n", __FUNCTION__);
 		return;
 	}
 
@@ -331,7 +331,7 @@
 	struct irda_sock *self;
 	struct sock *sk;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	
 	self = (struct irda_sock *) instance;
 	ASSERT(self != NULL, return;);
@@ -341,17 +341,16 @@
 	
 	switch (flow) {
 	case FLOW_STOP:
-		IRDA_DEBUG(1, __FUNCTION__ "(), IrTTP wants us to slow down\n");
+		IRDA_DEBUG(1, "%s(), IrTTP wants us to slow down\n", __FUNCTION__);
 		self->tx_flow = flow;
 		break;
 	case FLOW_START:
 		self->tx_flow = flow;
-		IRDA_DEBUG(1, __FUNCTION__ 
-			   "(), IrTTP wants us to start again\n");
+		IRDA_DEBUG(1, "%s(), IrTTP wants us to start again\n", __FUNCTION__);
 		wake_up_interruptible(sk->sleep);
 		break;
 	default:
-		IRDA_DEBUG( 0, __FUNCTION__ "(), Unknown flow command!\n");
+		IRDA_DEBUG( 0, "%s(), Unknown flow command!\n", __FUNCTION__);
 		/* Unknown flow command, better stop */
 		self->tx_flow = flow;
 		break;
@@ -373,11 +372,11 @@
 	
 	self = (struct irda_sock *) priv;
 	if (!self) {
-		WARNING(__FUNCTION__ "(), lost myself!\n");
+		WARNING("%s(), lost myself!\n", __FUNCTION__);
 		return;
 	}
 
-	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
+	IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
 
 	/* We probably don't need to make any more queries */
 	iriap_close(self->iriap);
@@ -385,7 +384,7 @@
 
 	/* Check if request succeeded */
 	if (result != IAS_SUCCESS) {
-		IRDA_DEBUG(1, __FUNCTION__ "(), IAS query failed! (%d)\n",
+		IRDA_DEBUG(1, "%s(), IAS query failed! (%d)\n", __FUNCTION__
 			   result);
 
 		self->errno = result;	/* We really need it later */
@@ -419,11 +418,11 @@
 {
 	struct irda_sock *self;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	self = (struct irda_sock *) priv;
 	if (!self) {
-		WARNING(__FUNCTION__ "(), lost myself!\n");
+		WARNING("%s(), lost myself!\n", __FUNCTION__);
 		return;
 	}
 
@@ -456,7 +455,7 @@
 {
 	struct irda_sock *self;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	self = (struct irda_sock *) priv;
 	ASSERT(self != NULL, return;);
@@ -481,7 +480,7 @@
 	notify_t notify;
 
 	if (self->tsap) {
-		WARNING(__FUNCTION__ "(), busy!\n");
+		WARNING("%s(), busy!\n", __FUNCTION__);
 		return -EBUSY;
 	}
 	
@@ -499,7 +498,7 @@
 	self->tsap = irttp_open_tsap(tsap_sel, DEFAULT_INITIAL_CREDIT,
 				     &notify);	
 	if (self->tsap == NULL) {
-		IRDA_DEBUG( 0, __FUNCTION__ "(), Unable to allocate TSAP!\n");
+		IRDA_DEBUG( 0, "%s(), Unable to allocate TSAP!\n", __FUNCTION__);
 		return -ENOMEM;
 	}
 	/* Remember which TSAP selector we actually got */
@@ -520,7 +519,7 @@
 	notify_t notify;
 
 	if (self->lsap) {
-		WARNING(__FUNCTION__ "(), busy!\n");
+		WARNING("%s(), busy!\n", __FUNCTION__);
 		return -EBUSY;
 	}
 	
@@ -532,7 +531,7 @@
 
 	self->lsap = irlmp_open_lsap(LSAP_CONNLESS, &notify, pid);	
 	if (self->lsap == NULL) {
-		IRDA_DEBUG( 0, __FUNCTION__ "(), Unable to allocate LSAP!\n");
+		IRDA_DEBUG( 0, "%s(), Unable to allocate LSAP!\n", __FUNCTION__);
 		return -ENOMEM;
 	}
 
@@ -553,12 +552,12 @@
  */
 static int irda_find_lsap_sel(struct irda_sock *self, char *name)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "(%p, %s)\n", self, name);
+	IRDA_DEBUG(2, "%s(%p, %s)\n", __FUNCTION__, self, name);
 
 	ASSERT(self != NULL, return -1;);
 
 	if (self->iriap) {
-		WARNING(__FUNCTION__ "(), busy with a previous query\n");
+		WARNING("%s(), busy with a previous query\n", __FUNCTION__);
 		return -EBUSY;
 	}
 
@@ -591,7 +590,7 @@
 	/* Get the remote TSAP selector */
 	switch (self->ias_result->type) {
 	case IAS_INTEGER:
-		IRDA_DEBUG(4, __FUNCTION__ "() int=%d\n",
+		IRDA_DEBUG(4, "%s() int=%d\n", __FUNCTION__,
 			   self->ias_result->t.integer);
 		
 		if (self->ias_result->t.integer != -1)
@@ -601,7 +600,7 @@
 		break;
 	default:
 		self->dtsap_sel = 0;
-		IRDA_DEBUG(0, __FUNCTION__ "(), bad type!\n");
+		IRDA_DEBUG(0, "%s(), bad type!\n", __FUNCTION__);
 		break;
 	}
 	if (self->ias_result)
@@ -639,7 +638,7 @@
 	__u32	daddr = DEV_ADDR_ANY;	/* Address we found the service on */
 	__u8	dtsap_sel = 0x0;	/* TSAP associated with it */
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), name=%s\n", name);
+	IRDA_DEBUG(2, "%s(), name=%s\n", __FUNCTION__, name);
 
 	ASSERT(self != NULL, return -1;);
 
@@ -661,7 +660,7 @@
 		/* Try the address in the log */
 		self->daddr = discoveries[i].daddr;
 		self->saddr = 0x0;
-		IRDA_DEBUG(1, __FUNCTION__ "(), trying daddr = %08x\n",
+		IRDA_DEBUG(1, "%s(), trying daddr = %08x\n", __FUNCTION__,
 			   self->daddr);
 
 		/* Query remote LM-IAS for this service */
@@ -670,9 +669,8 @@
 		case 0:
 			/* We found the requested service */
 			if(daddr != DEV_ADDR_ANY) {
-				IRDA_DEBUG(1, __FUNCTION__
-					   "(), discovered service ''%s'' in two different devices !!!\n",
-					   name);
+				IRDA_DEBUG(1, "%s(), discovered service ''%s'' in two different devices !!!\n",
+					   __FUNCTION__, name);
 				self->daddr = DEV_ADDR_ANY;
 				kfree(discoveries);
 				return(-ENOTUNIQ);
@@ -686,8 +684,7 @@
 			break;
 		default:
 			/* Something bad did happen :-( */
-			IRDA_DEBUG(0, __FUNCTION__
-				   "(), unexpected IAS query failure\n");
+			IRDA_DEBUG(0, "%s(), unexpected IAS query failure\n", __FUNCTION__);
 			self->daddr = DEV_ADDR_ANY;
 			kfree(discoveries);
 			return(-EHOSTUNREACH);
@@ -699,9 +696,8 @@
 
 	/* Check out what we found */
 	if(daddr == DEV_ADDR_ANY) {
-		IRDA_DEBUG(1, __FUNCTION__
-			   "(), cannot discover service ''%s'' in any device !!!\n",
-			   name);
+		IRDA_DEBUG(1, "%s(), cannot discover service ''%s'' in any device !!!\n",
+			   __FUNCTION__, name);
 		self->daddr = DEV_ADDR_ANY;
 		return(-EADDRNOTAVAIL);
 	}
@@ -711,9 +707,8 @@
 	self->saddr = 0x0;
 	self->dtsap_sel = dtsap_sel;
 
-	IRDA_DEBUG(1, __FUNCTION__ 
-		   "(), discovered requested service ''%s'' at address %08x\n",
-		   name, self->daddr);
+	IRDA_DEBUG(1, "%s(), discovered requested service ''%s'' at address %08x\n",
+		   __FUNCTION__, name, self->daddr);
 
 	return 0;
 }
@@ -744,8 +739,8 @@
 		saddr.sir_addr = self->saddr;
 	}
 	
-	IRDA_DEBUG(1, __FUNCTION__ "(), tsap_sel = %#x\n", saddr.sir_lsap_sel);
-	IRDA_DEBUG(1, __FUNCTION__ "(), addr = %08x\n", saddr.sir_addr);
+	IRDA_DEBUG(1, "%s(), tsap_sel = %#x\n", __FUNCTION__, saddr.sir_lsap_sel);
+	IRDA_DEBUG(1, "%s(), addr = %08x\n", __FUNCTION__, saddr.sir_addr);
 
 	/* uaddr_len come to us uninitialised */
 	*uaddr_len = sizeof (struct sockaddr_irda);
@@ -764,7 +759,7 @@
 {
 	struct sock *sk = sock->sk;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	if ((sk->type != SOCK_STREAM) && (sk->type != SOCK_SEQPACKET) &&
 	    (sk->type != SOCK_DGRAM))
@@ -796,7 +791,7 @@
 	self = sk->protinfo.irda;
 	ASSERT(self != NULL, return -1;);
 
-	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
+	IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
 
 	if (addr_len != sizeof(struct sockaddr_irda))
 		return -EINVAL;
@@ -806,8 +801,7 @@
 	if ((sk->type == SOCK_DGRAM) && (sk->protocol == IRDAPROTO_ULTRA)) {
 		self->pid = addr->sir_lsap_sel;
 		if (self->pid & 0x80) {
-			IRDA_DEBUG(0, __FUNCTION__ 
-				   "(), extension in PID not supp!\n");
+			IRDA_DEBUG(0, "%s(), extension in PID not supp!\n", __FUNCTION__);
 			return -EOPNOTSUPP;
 		}
 		err = irda_open_lsap(self, self->pid);
@@ -852,7 +846,7 @@
 	struct sk_buff *skb;
 	int err;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	self = sk->protinfo.irda;
 	ASSERT(self != NULL, return -1;);
@@ -898,7 +892,7 @@
 	/* Now attach up the new socket */
 	new->tsap = irttp_dup(self->tsap, new);
 	if (!new->tsap) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), dup failed!\n");
+		IRDA_DEBUG(0, "%s(), dup failed!\n", __FUNCTION__);
 		return -1;
 	}
 		
@@ -959,7 +953,7 @@
 
 	self = sk->protinfo.irda;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
+	IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
 
 	/* Don't allow connect for Ultra sockets */
 	if ((sk->type == SOCK_DGRAM) && (sk->protocol == IRDAPROTO_ULTRA))
@@ -989,19 +983,18 @@
 		/* Try to find one suitable */
 		err = irda_discover_daddr_and_lsap_sel(self, addr->sir_name);
 		if (err) {
-			IRDA_DEBUG(0, __FUNCTION__ 
-				   "(), auto-connect failed!\n");
+			IRDA_DEBUG(0, "%s(), auto-connect failed!\n", __FUNCTION__);
 			return err;
 		}
 	} else {
 		/* Use the one provided by the user */
 		self->daddr = addr->sir_addr;
-		IRDA_DEBUG(1, __FUNCTION__ "(), daddr = %08x\n", self->daddr);
+		IRDA_DEBUG(1, "%s(), daddr = %08x\n", __FUNCTION__, self->daddr);
 		
 		/* Query remote LM-IAS */
 		err = irda_find_lsap_sel(self, addr->sir_name);
 		if (err) {
-			IRDA_DEBUG(0, __FUNCTION__ "(), connect failed!\n");
+			IRDA_DEBUG(0, "%s(), connect failed!\n", __FUNCTION__);
 			return err;
 		}
 	}
@@ -1019,7 +1012,7 @@
 				    self->saddr, self->daddr, NULL, 
 				    self->max_sdu_size_rx, NULL);
 	if (err) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), connect failed!\n");
+		IRDA_DEBUG(0, "%s(), connect failed!\n", __FUNCTION__);
 		return err;
 	}
 
@@ -1064,7 +1057,7 @@
 	struct sock *sk;
 	struct irda_sock *self;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	
 	/* Check for valid socket type */
 	switch (sock->type) {
@@ -1088,7 +1081,7 @@
 	}
 	memset(self, 0, sizeof(struct irda_sock));
 
-	IRDA_DEBUG(2, __FUNCTION__ "() : self is %p\n", self);
+	IRDA_DEBUG(2, "%s() : self is %p\n", __FUNCTION__, self);
 
 	init_waitqueue_head(&self->query_wait);
 
@@ -1122,7 +1115,7 @@
 			self->max_sdu_size_rx = TTP_SAR_UNBOUND;
 			break;
 		default:
-			ERROR(__FUNCTION__ "(), protocol not supported!\n");
+			ERROR("%s(), protocol not supported!\n", __FUNCTION__);
 			return -ESOCKTNOSUPPORT;
 		}
 		break;
@@ -1151,7 +1144,7 @@
  */
 void irda_destroy_socket(struct irda_sock *self)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
+	IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
 
 	ASSERT(self != NULL, return;);
 
@@ -1197,7 +1190,7 @@
 {
 	struct sock *sk = sock->sk;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
         if (sk == NULL) 
 		return 0;
@@ -1266,7 +1259,7 @@
 	unsigned char *asmptr;
 	int err;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), len=%d\n", len);
+	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
 
 	/* Note : socket.c set MSG_EOR on SEQPACKET sockets */
 	if (msg->msg_flags & ~(MSG_DONTWAIT | MSG_EOR))
@@ -1285,7 +1278,7 @@
 
 	/* Check if IrTTP is wants us to slow down */
 	while (self->tx_flow == FLOW_STOP) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), IrTTP is busy, going to sleep!\n");
+		IRDA_DEBUG(2, "%s(), IrTTP is busy, going to sleep!\n", __FUNCTION__);
 		interruptible_sleep_on(sk->sleep);
 		
 		/* Check if we are still connected */
@@ -1298,8 +1291,7 @@
 
 	/* Check that we don't send out to big frames */
 	if (len > self->max_data_size) {
-		IRDA_DEBUG(2, __FUNCTION__ 
-			   "(), Chopping frame from %d to %d bytes!\n", len, 
+		IRDA_DEBUG(2, "%s(), Chopping frame from %d to %d bytes!\n", __FUNCTION__, len, 
 			   self->max_data_size);
 		len = self->max_data_size;
 	}
@@ -1320,7 +1312,7 @@
 	 */
 	err = irttp_data_request(self->tsap, skb);
 	if (err) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), err=%d\n", err);
+		IRDA_DEBUG(0, "%s(), err=%d\n", __FUNCTION__, err);
 		return err;
 	}
 	/* Tell client how much data we actually sent */
@@ -1341,7 +1333,7 @@
 	struct sk_buff *skb;
 	int copied, err;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	self = sk->protinfo.irda;
 	ASSERT(self != NULL, return -1;);
@@ -1355,8 +1347,7 @@
 	copied     = skb->len;
 	
 	if (copied > size) {
-		IRDA_DEBUG(2, __FUNCTION__ 
-			   "(), Received truncated frame (%d < %d)!\n",
+		IRDA_DEBUG(2, "%s(), Received truncated frame (%d < %d)!\n", __FUNCTION__,
 			   copied, size);
 		copied = size;
 		msg->msg_flags |= MSG_TRUNC;
@@ -1373,7 +1364,7 @@
 	 */
 	if (self->rx_flow == FLOW_STOP) {
 		if ((atomic_read(&sk->rmem_alloc) << 2) <= sk->rcvbuf) {
-			IRDA_DEBUG(2, __FUNCTION__ "(), Starting IrTTP\n");
+			IRDA_DEBUG(2, "%s(), Starting IrTTP\n", __FUNCTION__);
 			self->rx_flow = FLOW_START;
 			irttp_flow_request(self->tsap, FLOW_START);
 		}
@@ -1412,7 +1403,7 @@
 	int copied = 0;
 	int target = 1;
 
-	IRDA_DEBUG(3, __FUNCTION__ "()\n");
+	IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
 
 	self = sk->protinfo.irda;
 	ASSERT(self != NULL, return -1;);
@@ -1472,14 +1463,14 @@
 
 			/* put the skb back if we didn't use it up.. */
 			if (skb->len) {
-				IRDA_DEBUG(1, __FUNCTION__ "(), back on q!\n");
+				IRDA_DEBUG(1, "%s(), back on q!\n", __FUNCTION__);
 				skb_queue_head(&sk->receive_queue, skb);
 				break;
 			}
 
 			kfree_skb(skb);			
 		} else {
-			IRDA_DEBUG(0, __FUNCTION__ "() questionable!?\n");
+			IRDA_DEBUG(0, "%s() questionable!?\n", __FUNCTION__);
 
 			/* put message back and return */
 			skb_queue_head(&sk->receive_queue, skb);
@@ -1495,7 +1486,7 @@
 	 */
 	if (self->rx_flow == FLOW_STOP) {
 		if ((atomic_read(&sk->rmem_alloc) << 2) <= sk->rcvbuf) {
-			IRDA_DEBUG(2, __FUNCTION__ "(), Starting IrTTP\n");
+			IRDA_DEBUG(2, "%s(), Starting IrTTP\n", __FUNCTION__);
 			self->rx_flow = FLOW_START;
 			irttp_flow_request(self->tsap, FLOW_START);
 		}
@@ -1520,7 +1511,7 @@
 	unsigned char *asmptr;
 	int err;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "(), len=%d\n", len);
+	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
 	
 	if (msg->msg_flags & ~MSG_DONTWAIT)
 		return -EINVAL;
@@ -1541,8 +1532,8 @@
 	 * service, so we have no fragmentation and no coalescence 
 	 */
 	if (len > self->max_data_size) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), Warning to much data! "
-			   "Chopping frame from %d to %d bytes!\n", len, 
+		IRDA_DEBUG(0, "%s(), Warning to much data! "
+			   "Chopping frame from %d to %d bytes!\n", __FUNCTION__, len, 
 			   self->max_data_size);
 		len = self->max_data_size;
 	}
@@ -1554,7 +1545,7 @@
 
 	skb_reserve(skb, self->max_header_size);
 	
-	IRDA_DEBUG(4, __FUNCTION__ "(), appending user data\n");
+	IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__);
 	asmptr = skb->h.raw = skb_put(skb, len);
 	memcpy_fromiovec(asmptr, msg->msg_iov, len);
 
@@ -1564,7 +1555,7 @@
 	 */
 	err = irttp_udata_request(self->tsap, skb);
 	if (err) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), err=%d\n", err);
+		IRDA_DEBUG(0, "%s(), err=%d\n", __FUNCTION__, err);
 		return err;
 	}
 	return len;
@@ -1586,7 +1577,7 @@
 	unsigned char *asmptr;
 	int err;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "(), len=%d\n", len);
+	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
 	
 	if (msg->msg_flags & ~MSG_DONTWAIT)
 		return -EINVAL;
@@ -1604,8 +1595,8 @@
 	 * service, so we have no fragmentation and no coalescence 
 	 */
 	if (len > self->max_data_size) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), Warning to much data! "
-			   "Chopping frame from %d to %d bytes!\n", len, 
+		IRDA_DEBUG(0, "%s(), Warning to much data! "
+			   "Chopping frame from %d to %d bytes!\n", __FUNCTION__, len, 
 			   self->max_data_size);
 		len = self->max_data_size;
 	}
@@ -1617,13 +1608,13 @@
 
 	skb_reserve(skb, self->max_header_size);
 	
-	IRDA_DEBUG(4, __FUNCTION__ "(), appending user data\n");
+	IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__);
 	asmptr = skb->h.raw = skb_put(skb, len);
 	memcpy_fromiovec(asmptr, msg->msg_iov, len);
 
 	err = irlmp_connless_data_request(self->lsap, skb);
 	if (err) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), err=%d\n", err);
+		IRDA_DEBUG(0, "%s(), err=%d\n", __FUNCTION__, err);
 		return err;
 	}
 	return len;
@@ -1644,7 +1635,7 @@
 	self = sk->protinfo.irda;
 	ASSERT(self != NULL, return -1;);
 
-	IRDA_DEBUG(1, __FUNCTION__ "(%p)\n", self);
+	IRDA_DEBUG(1, "%s(%p)\n", __FUNCTION__, self);
 
 	sk->state       = TCP_CLOSE;
 	sk->shutdown   |= SEND_SHUTDOWN;
@@ -1682,7 +1673,7 @@
 	unsigned int mask;
 	struct irda_sock *self;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	self = sk->protinfo.irda;
 	poll_wait(file, sk->sleep, wait);
@@ -1692,7 +1683,7 @@
 	if (sk->err)
 		mask |= POLLERR;
 	if (sk->shutdown & RCV_SHUTDOWN) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), POLLHUP\n");
+		IRDA_DEBUG(0, "%s(), POLLHUP\n", __FUNCTION__);
 		mask |= POLLHUP;
 	}
 
@@ -1706,7 +1697,7 @@
 	switch (sk->type) {
 	case SOCK_STREAM:
 		if (sk->state == TCP_CLOSE) {
-			IRDA_DEBUG(0, __FUNCTION__ "(), POLLHUP\n");
+			IRDA_DEBUG(0, "%s(), POLLHUP\n", __FUNCTION__);
 			mask |= POLLHUP;
 		}
 
@@ -1745,7 +1736,7 @@
 {
 	struct sock *sk = sock->sk;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), cmd=%#x\n", cmd);
+	IRDA_DEBUG(4, "%s(), cmd=%#x\n", __FUNCTION__, cmd);
 	
 	switch (cmd) {
 	case TIOCOUTQ: {
@@ -1792,7 +1783,7 @@
 	case SIOCSIFMETRIC:
 		return -EINVAL;		
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), doing device ioctl!\n");
+		IRDA_DEBUG(1, "%s(), doing device ioctl!\n", __FUNCTION__);
 		return dev_ioctl(cmd, (void *) arg);
 	}
 
@@ -1819,7 +1810,7 @@
 	self = sk->protinfo.irda;
 	ASSERT(self != NULL, return -1;);
 
-	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
+	IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
 
 	if (level != SOL_IRLMP)
 		return -ENOPROTOOPT;
@@ -1981,8 +1972,7 @@
 
 		/* Check is the user space own the object */
 		if(ias_attr->value->owner != IAS_USER_ATTR) {
-			IRDA_DEBUG(1, __FUNCTION__ 
-				   "(), attempting to delete a kernel attribute\n");
+			IRDA_DEBUG(1, "%s(), attempting to delete a kernel attribute\n", __FUNCTION__);
 			kfree(ias_opt);
 			return -EPERM;
 		}
@@ -2000,13 +1990,11 @@
 		
 		/* Only possible for a seqpacket service (TTP with SAR) */
 		if (sk->type != SOCK_SEQPACKET) {
-			IRDA_DEBUG(2, __FUNCTION__ 
-				   "(), setting max_sdu_size = %d\n", opt);
+			IRDA_DEBUG(2, "%s(), setting max_sdu_size = %d\n", __FUNCTION__, opt);
 			self->max_sdu_size_rx = opt;
 		} else {
-			WARNING(__FUNCTION__ 
-				"(), not allowed to set MAXSDUSIZE for this "
-				"socket type!\n");
+			WARNING("%s(), not allowed to set MAXSDUSIZE for this "
+				"socket type!\n", __FUNCTION__);
 			return -ENOPROTOOPT;
 		}
 		break;
@@ -2123,7 +2111,7 @@
 
 	self = sk->protinfo.irda;
 
-	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
+	IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
 
 	if (level != SOL_IRLMP)
 		return -ENOPROTOOPT;
@@ -2283,8 +2271,7 @@
 
 		/* Check that we can proceed with IAP */
 		if (self->iriap) {
-			WARNING(__FUNCTION__
-				"(), busy with a previous query\n");
+			WARNING("%s(), busy with a previous query\n", __FUNCTION__);
 			kfree(ias_opt);
 			return -EBUSY;
 		}
@@ -2365,8 +2352,7 @@
 		
 		/* Wait until a node is discovered */
 		if (!self->cachediscovery) {
-			IRDA_DEBUG(1, __FUNCTION__ 
-				   "(), nothing discovered yet, going to sleep...\n");
+			IRDA_DEBUG(1, "%s(), nothing discovered yet, going to sleep...\n", __FUNCTION__);
 
 			/* Set watchdog timer to expire in <val> ms. */
 			self->watchdog.function = irda_discovery_timeout;
@@ -2381,12 +2367,10 @@
 			if(timer_pending(&(self->watchdog)))
 				del_timer(&(self->watchdog));
 
-			IRDA_DEBUG(1, __FUNCTION__ 
-				   "(), ...waking up !\n");
+			IRDA_DEBUG(1, "%s(), ...waking up !\n", __FUNCTION__);
 		}
 		else
-			IRDA_DEBUG(1, __FUNCTION__ 
-				   "(), found immediately !\n");
+			IRDA_DEBUG(1, "%s(), found immediately !\n", __FUNCTION__);
 
 		/* Tell IrLMP that we have been notified */
 		irlmp_update_client(self->ckey, self->mask, NULL, NULL, NULL);
@@ -2527,11 +2511,11 @@
 	
         switch (event) {
 	case NETDEV_UP:
-		IRDA_DEBUG(3, __FUNCTION__ "(), NETDEV_UP\n");
+		IRDA_DEBUG(3, "%s(), NETDEV_UP\n", __FUNCTION__);
 		/* irda_dev_device_up(dev); */
 		break;
 	case NETDEV_DOWN:
-		IRDA_DEBUG(3, __FUNCTION__ "(), NETDEV_DOWN\n");
+		IRDA_DEBUG(3, "%s(), NETDEV_DOWN\n", __FUNCTION__);
 		/* irda_kill_by_device(dev); */
 		/* irda_rt_device_down(dev); */
 		/* irda_dev_device_down(dev); */
diff -urN linux-2.4.23-pre7/net/irda/ircomm/ircomm_core.c linux-2.4.23-pre8/net/irda/ircomm/ircomm_core.c
--- linux-2.4.23-pre7/net/irda/ircomm/ircomm_core.c	2003-06-13 07:51:39.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/ircomm/ircomm_core.c	2003-10-23 03:33:18.000000000 -0700
@@ -63,7 +63,7 @@
 {
 	ircomm = hashbin_new(HB_LOCAL); 
 	if (ircomm == NULL) {
-		ERROR(__FUNCTION__ "(), can't allocate hashbin!\n");
+		ERROR("%s(), can't allocate hashbin!\n", __FUNCTION__);
 		return -ENOMEM;
 	}
 	
@@ -79,7 +79,7 @@
 #ifdef MODULE
 void ircomm_cleanup(void)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	hashbin_delete(ircomm, (FREE_FUNC) __ircomm_close);
 
@@ -100,7 +100,7 @@
 	struct ircomm_cb *self = NULL;
 	int ret;
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), service_type=0x%02x\n",
+	IRDA_DEBUG(2, "%s(), service_type=0x%02x\n", __FUNCTION__,
 		   service_type);
 
 	ASSERT(ircomm != NULL, return NULL;);
@@ -144,7 +144,7 @@
  */
 static int __ircomm_close(struct ircomm_cb *self)
 {
-	IRDA_DEBUG(2, __FUNCTION__"()\n");
+	IRDA_DEBUG(2,"%s()\n", __FUNCTION__);
 
 	/* Disconnect link if any */
 	ircomm_do_event(self, IRCOMM_DISCONNECT_REQUEST, NULL, NULL);
@@ -180,7 +180,7 @@
 	ASSERT(self != NULL, return -EIO;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return -EIO;);
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	entry = hashbin_remove(ircomm, self->line, NULL);
 
@@ -203,7 +203,7 @@
 	struct ircomm_info info;
 	int ret;
 
-	IRDA_DEBUG(2 , __FUNCTION__"()\n");
+	IRDA_DEBUG(2 ,"%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return -1;);
@@ -230,7 +230,7 @@
 {
 	int clen = 0;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	/* Check if the packet contains data on the control channel */
 	if (skb->len > 0)
@@ -246,7 +246,7 @@
 						info->qos, info->max_data_size,
 						info->max_header_size, skb);
 	else {
-		IRDA_DEBUG(0, __FUNCTION__ "(), missing handler\n");
+		IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 	}
 }
@@ -264,7 +264,7 @@
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return -1;);
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ret = ircomm_do_event(self, IRCOMM_CONNECT_RESPONSE, userdata, NULL);
 
@@ -280,7 +280,7 @@
 void ircomm_connect_confirm(struct ircomm_cb *self, struct sk_buff *skb,
 			    struct ircomm_info *info)
 {
-	IRDA_DEBUG(4, __FUNCTION__"()\n");
+	IRDA_DEBUG(4,"%s()\n", __FUNCTION__);
 
 	if (self->notify.connect_confirm )
 		self->notify.connect_confirm(self->notify.instance,
@@ -288,7 +288,7 @@
 					     info->max_data_size,
 					     info->max_header_size, skb);
 	else {
-		IRDA_DEBUG(0, __FUNCTION__ "(), missing handler\n");
+		IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 	}
 }
@@ -303,7 +303,7 @@
 {
 	int ret;
 
-	IRDA_DEBUG(4, __FUNCTION__"()\n");
+	IRDA_DEBUG(4,"%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -EFAULT;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return -EFAULT;);
@@ -322,14 +322,14 @@
  */
 void ircomm_data_indication(struct ircomm_cb *self, struct sk_buff *skb)
 {	
-	IRDA_DEBUG(4, __FUNCTION__"()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(skb->len > 0, return;);
 
 	if (self->notify.data_indication)
 		self->notify.data_indication(self->notify.instance, self, skb);
 	else {
-		IRDA_DEBUG(0, __FUNCTION__ "(), missing handler\n");
+		IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 	}
 }
@@ -362,8 +362,7 @@
 	if (skb->len)
 		ircomm_data_indication(self, skb);		
 	else {
-		IRDA_DEBUG(4, __FUNCTION__ 
-			   "(), data was control info only!\n");
+		IRDA_DEBUG(4, "%s(), data was control info only!\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 	}
 }
@@ -378,7 +377,7 @@
 {
 	int ret;
 	
-	IRDA_DEBUG(2, __FUNCTION__"()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -EFAULT;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return -EFAULT;);
@@ -400,7 +399,7 @@
 {
 	struct sk_buff *ctrl_skb;
 
-	IRDA_DEBUG(2, __FUNCTION__"()\n");	
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ctrl_skb = skb_clone(skb, GFP_ATOMIC);
 	if (!ctrl_skb)
@@ -414,7 +413,7 @@
 		self->notify.udata_indication(self->notify.instance, self, 
 					      ctrl_skb);
 	else {
-		IRDA_DEBUG(0, __FUNCTION__ "(), missing handler\n");
+		IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 	}
 }
@@ -430,7 +429,7 @@
 	struct ircomm_info info;
 	int ret;
 
-	IRDA_DEBUG(2, __FUNCTION__"()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return -1;);
@@ -449,7 +448,7 @@
 void ircomm_disconnect_indication(struct ircomm_cb *self, struct sk_buff *skb,
 				  struct ircomm_info *info)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
        
 	ASSERT(info != NULL, return;);
 
@@ -457,7 +456,7 @@
 		self->notify.disconnect_indication(self->notify.instance, self,
 						   info->reason, skb);
 	} else {
-		IRDA_DEBUG(0, __FUNCTION__ "(), missing handler\n");
+		IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 	}
 }
@@ -470,7 +469,7 @@
  */
 void ircomm_flow_request(struct ircomm_cb *self, LOCAL_FLOW flow)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return;);
diff -urN linux-2.4.23-pre7/net/irda/ircomm/ircomm_event.c linux-2.4.23-pre8/net/irda/ircomm/ircomm_event.c
--- linux-2.4.23-pre7/net/irda/ircomm/ircomm_event.c	2001-03-02 11:12:12.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/ircomm/ircomm_event.c	2003-10-23 03:33:18.000000000 -0700
@@ -107,7 +107,7 @@
 		ircomm_connect_indication(self, skb, info);
 		break;
 	default:
-		IRDA_DEBUG(4, __FUNCTION__"(), unknown event: %s\n",
+		IRDA_DEBUG(4,"%s(), unknown event: %s\n", __FUNCTION__,
 			   ircomm_event[event]);
 		if (skb)
 			dev_kfree_skb(skb);
@@ -139,7 +139,7 @@
 		ircomm_disconnect_indication(self, skb, info);
 		break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__"(), unknown event: %s\n",
+		IRDA_DEBUG(0, "%s(), unknown event: %s\n", __FUNCTION__,
 			   ircomm_event[event]);
 		if (skb)
 			dev_kfree_skb(skb);
@@ -174,7 +174,7 @@
 		ircomm_disconnect_indication(self, skb, info);
 		break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__ "(), unknown event = %s\n",
+		IRDA_DEBUG(0, "%s(), unknown event = %s\n", __FUNCTION__,
 			   ircomm_event[event]);
 		if (skb)
 			dev_kfree_skb(skb);
@@ -218,7 +218,7 @@
 		ret = self->issue.disconnect_request(self, skb, info);
 		break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__ "(), unknown event = %s\n",
+		IRDA_DEBUG(0, "%s(), unknown event = %s\n", __FUNCTION__,
 			   ircomm_event[event]);
 		if (skb)
 			dev_kfree_skb(skb);
@@ -236,7 +236,7 @@
 int ircomm_do_event(struct ircomm_cb *self, IRCOMM_EVENT event,
 		    struct sk_buff *skb, struct ircomm_info *info) 
 {
-	IRDA_DEBUG(4, __FUNCTION__": state=%s, event=%s\n",
+	IRDA_DEBUG(4, "%s: state=%s, event=%s\n", __FUNCTION__,
 		   ircomm_state[self->state], ircomm_event[event]);
 
 	return (*state[self->state])(self, event, skb, info);
@@ -252,6 +252,6 @@
 {
 	self->state = state;
 	
-	IRDA_DEBUG(4, __FUNCTION__": next state=%s, service type=%d\n", 
+	IRDA_DEBUG(4, "%s: next state=%s, service type=%d\n", __FUNCTION__,
 		   ircomm_state[self->state], self->service_type);
 }
diff -urN linux-2.4.23-pre7/net/irda/ircomm/ircomm_lmp.c linux-2.4.23-pre8/net/irda/ircomm/ircomm_lmp.c
--- linux-2.4.23-pre7/net/irda/ircomm/ircomm_lmp.c	2002-02-25 11:38:14.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/ircomm/ircomm_lmp.c	2003-10-23 03:33:18.000000000 -0700
@@ -49,7 +49,7 @@
 {
 	notify_t notify;
 	
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 	
         /* Register callbacks */
         irda_notify_init(&notify);
@@ -62,7 +62,7 @@
 
 	self->lsap = irlmp_open_lsap(LSAP_ANY, &notify, 0);
 	if (!self->lsap) {
-		IRDA_DEBUG(0,__FUNCTION__"failed to allocate tsap\n");
+		IRDA_DEBUG(0, "%s failed to allocate tsap\n", __FUNCTION__);
 		return -1;
 	}
 	self->slsap_sel = self->lsap->slsap_sel;
@@ -90,7 +90,7 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	ret = irlmp_connect_request(self->lsap, info->dlsap_sel,
 				    info->saddr, info->daddr, NULL, userdata); 
@@ -108,7 +108,7 @@
 	struct sk_buff *skb;
 	int ret;
 
-	IRDA_DEBUG(0, __FUNCTION__"()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 	
 	/* Any userdata supplied? */
 	if (userdata == NULL) {
@@ -139,7 +139,7 @@
         struct sk_buff *skb;
 	int ret;
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
         if (!userdata) {
                 skb = dev_alloc_skb(64);
@@ -172,13 +172,13 @@
 
 	cb = (struct irda_skb_cb *) skb->cb;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
  
         line = cb->line;
 
 	self = (struct ircomm_cb *) hashbin_find(ircomm, line, NULL);
         if (!self) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), didn't find myself\n");
+		IRDA_DEBUG(2, "%s(), didn't find myself\n", __FUNCTION__);
                 return;
 	}
 
@@ -188,7 +188,7 @@
 	self->pkt_count--;
 
         if ((self->pkt_count < 2) && (self->flow_status == FLOW_STOP)) {
-                IRDA_DEBUG(2, __FUNCTION__ "(), asking TTY to start again!\n");
+                IRDA_DEBUG(2, "%s(), asking TTY to start again!\n", __FUNCTION__);
                 self->flow_status = FLOW_START;
                 if (self->notify.flow_indication)
                         self->notify.flow_indication(self->notify.instance, 
@@ -214,12 +214,12 @@
 	
         cb->line = self->line;
 
-	IRDA_DEBUG(4, __FUNCTION__"(), sending frame\n");
+	IRDA_DEBUG(4, "%s(), sending frame\n", __FUNCTION__);
 
 	skb->destructor = ircomm_lmp_flow_control;
 	
         if ((self->pkt_count++ > 7) && (self->flow_status == FLOW_START)) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), asking TTY to slow down!\n");
+		IRDA_DEBUG(2, "%s(), asking TTY to slow down!\n", __FUNCTION__);
 	        self->flow_status = FLOW_STOP;
                 if (self->notify.flow_indication)
              	        self->notify.flow_indication(self->notify.instance, 
@@ -227,7 +227,7 @@
         }
 	ret = irlmp_data_request(self->lsap, skb);
 	if (ret) {
-		ERROR(__FUNCTION__ "(), failed\n");
+		ERROR("%s(), failed\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 	}
 
@@ -245,7 +245,7 @@
 {
 	struct ircomm_cb *self = (struct ircomm_cb *) instance;
 
-	IRDA_DEBUG(4, __FUNCTION__"()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return -1;);
@@ -272,7 +272,7 @@
 	struct ircomm_cb *self = (struct ircomm_cb *) instance;
 	struct ircomm_info info;
 
-	IRDA_DEBUG(0, __FUNCTION__"()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return;);
@@ -302,7 +302,7 @@
 	struct ircomm_cb *self = (struct ircomm_cb *)instance;
 	struct ircomm_info info;
 
-	IRDA_DEBUG(0, __FUNCTION__"()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return;);
@@ -329,7 +329,7 @@
 	struct ircomm_cb *self = (struct ircomm_cb *) instance;
 	struct ircomm_info info;
 
-	IRDA_DEBUG(0, __FUNCTION__"()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return;);
diff -urN linux-2.4.23-pre7/net/irda/ircomm/ircomm_param.c linux-2.4.23-pre8/net/irda/ircomm/ircomm_param.c
--- linux-2.4.23-pre7/net/irda/ircomm/ircomm_param.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/ircomm/ircomm_param.c	2003-10-23 03:33:18.000000000 -0700
@@ -118,7 +118,7 @@
 	struct sk_buff *skb;
 	int count;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);
@@ -152,7 +152,7 @@
 	count = irda_param_insert(self, pi, skb->tail, skb_tailroom(skb),
 				  &ircomm_param_info);
 	if (count < 0) {
-		WARNING(__FUNCTION__ "(), no room for parameter!\n");
+		WARNING("%s(), no room for parameter!\n", __FUNCTION__);
 		restore_flags(flags);
 		return -1;
 	}
@@ -160,7 +160,7 @@
 
 	restore_flags(flags);
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), skb->len=%d\n", skb->len);
+	IRDA_DEBUG(2, "%s(), skb->len=%d\n", __FUNCTION__, skb->len);
 
 	if (flush) {
 		/* ircomm_tty_do_softint will take care of the rest */
@@ -195,11 +195,10 @@
 	/* Find all common service types */
 	service_type &= self->service_type;
 	if (!service_type) {
-		IRDA_DEBUG(2, __FUNCTION__
-			   "(), No common service type to use!\n");
+		IRDA_DEBUG(2, "%s(), No common service type to use!\n", __FUNCTION__);
 		return -1;
 	}
-	IRDA_DEBUG(0, __FUNCTION__ "(), services in common=%02x\n",
+	IRDA_DEBUG(0, __FUNCTION__ "%s(), services in common=%02x\n", __FUNCTION__,
 		   service_type);
 
 	/*
@@ -214,7 +213,7 @@
 	else if (service_type & IRCOMM_3_WIRE_RAW)
 		self->settings.service_type = IRCOMM_3_WIRE_RAW;
 
-	IRDA_DEBUG(0, __FUNCTION__ "(), resulting service type=0x%02x\n", 
+	IRDA_DEBUG(0, "%s(), resulting service type=0x%02x\n", __FUNCTION__,
 		   self->settings.service_type);
 
 	/* 
@@ -257,7 +256,7 @@
 	else {
 		self->settings.port_type = (__u8) param->pv.i;
 
-		IRDA_DEBUG(0, __FUNCTION__ "(), port type=%d\n", 
+		IRDA_DEBUG(0, "%s(), port type=%d\n", __FUNCTION__,
 			   self->settings.port_type);
 	}
 	return 0;
@@ -277,9 +276,9 @@
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);
 
 	if (get) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), not imp!\n");
+		IRDA_DEBUG(0, "%s(), not imp!\n", __FUNCTION__);
 	} else {
-		IRDA_DEBUG(0, __FUNCTION__ "(), port-name=%s\n", param->pv.c);
+		IRDA_DEBUG(0, "%s(), port-name=%s\n", __FUNCTION__, param->pv.c);
 		strncpy(self->settings.port_name, param->pv.c, 32);
 	}
 
@@ -304,7 +303,7 @@
 	else
 		self->settings.data_rate = param->pv.i;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "(), data rate = %d\n", param->pv.i);
+	IRDA_DEBUG(2, "%s(), data rate = %d\n", __FUNCTION__, param->pv.i);
 
 	return 0;
 }
@@ -350,7 +349,7 @@
 	else
 		self->settings.flow_control = (__u8) param->pv.i;
 
-	IRDA_DEBUG(1, __FUNCTION__ "(), flow control = 0x%02x\n", (__u8) param->pv.i);
+	IRDA_DEBUG(1, "%s(), flow control = 0x%02x\n", __FUNCTION__, (__u8) param->pv.i);
 
 	return 0;
 }
@@ -376,7 +375,7 @@
 		self->settings.xonxoff[1] = (__u16) param->pv.i >> 8;
 	}
 
-	IRDA_DEBUG(0, __FUNCTION__ "(), XON/XOFF = 0x%02x,0x%02x\n", 
+	IRDA_DEBUG(0, "%s(), XON/XOFF = 0x%02x,0x%02x\n", __FUNCTION__,
 		   param->pv.i & 0xff, param->pv.i >> 8);
 
 	return 0;
@@ -403,7 +402,7 @@
 		self->settings.enqack[1] = (__u16) param->pv.i >> 8;
 	}
 
-	IRDA_DEBUG(0, __FUNCTION__ "(), ENQ/ACK = 0x%02x,0x%02x\n",
+	IRDA_DEBUG(0, "%s(), ENQ/ACK = 0x%02x,0x%02x\n", __FUNCTION__,
 		   param->pv.i & 0xff, param->pv.i >> 8);
 
 	return 0;
@@ -418,7 +417,7 @@
 static int ircomm_param_line_status(void *instance, irda_param_t *param, 
 				    int get)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "(), not impl.\n");
+	IRDA_DEBUG(2, "%s(), not impl.\n", __FUNCTION__);
 
 	return 0;
 }
@@ -477,7 +476,7 @@
 	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance;
 	__u8 dce;
 
-	IRDA_DEBUG(1, __FUNCTION__ "(), dce = 0x%02x\n", (__u8) param->pv.i);
+	IRDA_DEBUG(1, "%s(), dce = 0x%02x\n", __FUNCTION__, (__u8) param->pv.i);
 
 	dce = (__u8) param->pv.i;
 
@@ -489,7 +488,7 @@
 	/* Check if any of the settings have changed */
 	if (dce & 0x0f) {
 		if (dce & IRCOMM_DELTA_CTS) {
-			IRDA_DEBUG(2, __FUNCTION__ "(), CTS \n");
+			IRDA_DEBUG(2, "%s(), CTS \n", __FUNCTION__);
 		}
 	}
 
diff -urN linux-2.4.23-pre7/net/irda/ircomm/ircomm_ttp.c linux-2.4.23-pre8/net/irda/ircomm/ircomm_ttp.c
--- linux-2.4.23-pre7/net/irda/ircomm/ircomm_ttp.c	2001-03-02 11:12:12.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/ircomm/ircomm_ttp.c	2003-10-23 03:33:18.000000000 -0700
@@ -49,7 +49,7 @@
 {
 	notify_t notify;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	/* Register callbacks */
 	irda_notify_init(&notify);
@@ -64,7 +64,7 @@
 	self->tsap = irttp_open_tsap(LSAP_ANY, DEFAULT_INITIAL_CREDIT,
 				     &notify);
 	if (!self->tsap) {
-		IRDA_DEBUG(0, __FUNCTION__"failed to allocate tsap\n");
+		IRDA_DEBUG(0, "%s failed to allocate tsap\n", __FUNCTION__);
 		return -1;
 	}
 	self->slsap_sel = self->tsap->stsap_sel;
@@ -92,7 +92,7 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ret = irttp_connect_request(self->tsap, info->dlsap_sel,
 				    info->saddr, info->daddr, NULL, 
@@ -110,7 +110,7 @@
 {
 	int ret;
 
-	IRDA_DEBUG(4, __FUNCTION__"()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ret = irttp_connect_response(self->tsap, TTP_SAR_DISABLE, skb);
 
@@ -133,7 +133,7 @@
 
 	ASSERT(skb != NULL, return -1;);
 
-	IRDA_DEBUG(2, __FUNCTION__"(), clen=%d\n", clen);
+	IRDA_DEBUG(2, "%s(), clen=%d\n", __FUNCTION__, clen);
 
 	/* 
 	 * Insert clen field, currently we either send data only, or control
@@ -146,7 +146,7 @@
 
 	ret = irttp_data_request(self->tsap, skb);
 	if (ret) {
-		ERROR(__FUNCTION__ "(), failed\n");
+		ERROR("%s(), failed\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 	}
 
@@ -164,7 +164,7 @@
 {
 	struct ircomm_cb *self = (struct ircomm_cb *) instance;
 
-	IRDA_DEBUG(4, __FUNCTION__"()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return -1;);
@@ -184,7 +184,7 @@
 	struct ircomm_cb *self = (struct ircomm_cb *) instance;
 	struct ircomm_info info;
 
-	IRDA_DEBUG(4, __FUNCTION__"()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return;);
@@ -192,7 +192,7 @@
 	ASSERT(qos != NULL, return;);
 
 	if (max_sdu_size != TTP_SAR_DISABLE) {
-		ERROR(__FUNCTION__ "(), SAR not allowed for IrCOMM!\n");
+		ERROR("%s(), SAR not allowed for IrCOMM!\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 		return;
 	}
@@ -221,7 +221,7 @@
 	struct ircomm_cb *self = (struct ircomm_cb *)instance;
 	struct ircomm_info info;
 
-	IRDA_DEBUG(4, __FUNCTION__"()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return;);
@@ -229,7 +229,7 @@
 	ASSERT(qos != NULL, return;);
 
 	if (max_sdu_size != TTP_SAR_DISABLE) {
-		ERROR(__FUNCTION__ "(), SAR not allowed for IrCOMM!\n");
+		ERROR("%s(), SAR not allowed for IrCOMM!\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 		return;
 	}
@@ -272,7 +272,7 @@
 	struct ircomm_cb *self = (struct ircomm_cb *) instance;
 	struct ircomm_info info;
 
-	IRDA_DEBUG(2, __FUNCTION__"()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return;);
@@ -292,7 +292,7 @@
 {
 	struct ircomm_cb *self = (struct ircomm_cb *) instance;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_MAGIC, return;);
diff -urN linux-2.4.23-pre7/net/irda/ircomm/ircomm_tty_attach.c linux-2.4.23-pre8/net/irda/ircomm/ircomm_tty_attach.c
--- linux-2.4.23-pre7/net/irda/ircomm/ircomm_tty_attach.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/ircomm/ircomm_tty_attach.c	2003-10-23 03:33:18.000000000 -0700
@@ -126,14 +126,14 @@
  */
 int ircomm_tty_attach_cable(struct ircomm_tty_cb *self)
 {
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);
 
        	/* Check if somebody has already connected to us */
 	if (ircomm_is_connected(self->ircomm)) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), already connected!\n");
+		IRDA_DEBUG(0, "%s(), already connected!\n", __FUNCTION__);
 		return 0;
 	}
 
@@ -144,7 +144,7 @@
 
 	/* Check if somebody has already connected to us */
 	if (ircomm_is_connected(self->ircomm)) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), already connected!\n");
+		IRDA_DEBUG(0, "%s(), already connected!\n", __FUNCTION__);
 		return 0;
 	}
 
@@ -161,7 +161,7 @@
  */
 void ircomm_tty_detach_cable(struct ircomm_tty_cb *self)
 {
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
@@ -203,7 +203,7 @@
 	__u8 oct_seq[6];
 	__u16 hints;
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
@@ -258,16 +258,16 @@
 	 * Set default values, but only if the application for some reason 
 	 * haven't set them already
 	 */
-	IRDA_DEBUG(2, __FUNCTION__ "(), data-rate = %d\n", 
+	IRDA_DEBUG(2, "%s(), data-rate = %d\n", __FUNCTION__,
 		   self->settings.data_rate);
 	if (!self->settings.data_rate)
 		self->settings.data_rate = 9600;
-	IRDA_DEBUG(2, __FUNCTION__ "(), data-format = %d\n", 
+	IRDA_DEBUG(2, "%s(), data-format = %d\n", __FUNCTION__,
 		   self->settings.data_format);
 	if (!self->settings.data_format)
 		self->settings.data_format = IRCOMM_WSIZE_8;  /* 8N1 */
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), flow-control = %d\n", 
+	IRDA_DEBUG(2, "%s(), flow-control = %d\n", __FUNCTION__,
 		   self->settings.flow_control);
 	/*self->settings.flow_control = IRCOMM_RTS_CTS_IN|IRCOMM_RTS_CTS_OUT;*/
 
@@ -312,7 +312,7 @@
 	struct ircomm_tty_cb *self;
 	struct ircomm_tty_info info;
 
-	IRDA_DEBUG(2, __FUNCTION__"()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	/* Important note :
 	 * We need to drop all passive discoveries.
@@ -354,7 +354,7 @@
 {
 	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
@@ -384,7 +384,7 @@
 {
 	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) priv;
 
-	IRDA_DEBUG(2, __FUNCTION__"()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
@@ -395,13 +395,13 @@
 
 	/* Check if request succeeded */
 	if (result != IAS_SUCCESS) {
-		IRDA_DEBUG(4, __FUNCTION__ "(), got NULL value!\n");
+		IRDA_DEBUG(4, "%s(), got NULL value!\n", __FUNCTION__);
 		return;
 	}
 
 	switch (value->type) {
  	case IAS_OCT_SEQ:
-		IRDA_DEBUG(2, __FUNCTION__"(), got octet sequence\n");
+		IRDA_DEBUG(2, "%s(), got octet sequence\n", __FUNCTION__);
 
 		irda_param_extract_all(self, value->t.oct_seq, value->len,
 				       &ircomm_param_info);
@@ -411,21 +411,21 @@
 		break;
 	case IAS_INTEGER:
 		/* Got LSAP selector */	
-		IRDA_DEBUG(2, __FUNCTION__"(), got lsapsel = %d\n", 
+		IRDA_DEBUG(2, "%s(), got lsapsel = %d\n", __FUNCTION__,
 			   value->t.integer);
 
 		if (value->t.integer == -1) {
-			IRDA_DEBUG(0, __FUNCTION__"(), invalid value!\n");
+			IRDA_DEBUG(0, "%s(), invalid value!\n", __FUNCTION__);
 		} else
 			self->dlsap_sel = value->t.integer;
 
 		ircomm_tty_do_event(self, IRCOMM_TTY_GOT_LSAPSEL, NULL, NULL);
 		break;
 	case IAS_MISSING:
-		IRDA_DEBUG(0, __FUNCTION__"(), got IAS_MISSING\n");
+		IRDA_DEBUG(0, "%s(), got IAS_MISSING\n", __FUNCTION__);
 		break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__"(), got unknown type!\n");
+		IRDA_DEBUG(0, "%s(), got unknown type!\n", __FUNCTION__);
 		break;
 	}
 	irias_delete_value(value);
@@ -445,7 +445,7 @@
 {
 	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
@@ -476,7 +476,7 @@
 	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance;
 	int clen;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
@@ -505,7 +505,7 @@
  */
 void ircomm_tty_link_established(struct ircomm_tty_cb *self)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
@@ -580,7 +580,7 @@
 {
 	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) data;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
@@ -601,7 +601,7 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n",
+	IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__,
 		   ircomm_tty_state[self->state], ircomm_tty_event[event]);
 	switch (event) {
 	case IRCOMM_TTY_ATTACH_CABLE:
@@ -616,8 +616,7 @@
 		self->saddr = info->saddr;
 
 		if (self->iriap) {
-			WARNING(__FUNCTION__ 
-				"(), busy with a previous query\n");
+			WARNING("%s(), busy with a previous query\n", __FUNCTION__);
 			return -EBUSY;
 		}
 
@@ -645,7 +644,7 @@
 		ircomm_tty_next_state(self, IRCOMM_TTY_IDLE);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n",
+		IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__,
 			   ircomm_tty_event[event]);
 		return -EINVAL;
 	}
@@ -665,7 +664,7 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n",
+	IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__,
 		   ircomm_tty_state[self->state], ircomm_tty_event[event]);
 
 	switch (event) {
@@ -674,8 +673,7 @@
 		self->saddr = info->saddr;
 
 		if (self->iriap) {
-			WARNING(__FUNCTION__ 
-				"(), busy with a previous query\n");
+			WARNING("%s(), busy with a previous query\n", __FUNCTION__);
 			return -EBUSY;
 		}
 		
@@ -717,7 +715,7 @@
 		ircomm_tty_next_state(self, IRCOMM_TTY_IDLE);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n",
+		IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__,
 			   ircomm_tty_event[event]);
 		return -EINVAL;
 	}
@@ -737,14 +735,13 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n",
+	IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__,
 		   ircomm_tty_state[self->state], ircomm_tty_event[event]);
 
 	switch (event) {
 	case IRCOMM_TTY_GOT_PARAMETERS:
 		if (self->iriap) {
-			WARNING(__FUNCTION__ 
-				"(), busy with a previous query\n");
+			WARNING("%s(), busy with a previous query\n", __FUNCTION__);
 			return -EBUSY;
 		}
 		
@@ -774,7 +771,7 @@
 		ircomm_tty_next_state(self, IRCOMM_TTY_IDLE);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n",
+		IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__,
 			   ircomm_tty_event[event]);
 		return -EINVAL;
 	}
@@ -794,7 +791,7 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n",
+	IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__,
 		   ircomm_tty_state[self->state], ircomm_tty_event[event]);
 
 	switch (event) {
@@ -822,7 +819,7 @@
 		ircomm_tty_next_state(self, IRCOMM_TTY_IDLE);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n",
+		IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__,
 			   ircomm_tty_event[event]);
 		return -EINVAL;
 	}
@@ -842,7 +839,7 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n",
+	IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__,
 		   ircomm_tty_state[self->state], ircomm_tty_event[event]);
 
 	switch (event) {
@@ -874,7 +871,7 @@
 		ircomm_tty_next_state(self, IRCOMM_TTY_IDLE);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n",
+		IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__,
 			   ircomm_tty_event[event]);
 		return -EINVAL;
 	}
@@ -911,13 +908,13 @@
 			self->settings.dce = IRCOMM_DELTA_CD;
 			ircomm_tty_check_modem_status(self);
 		} else {
-			IRDA_DEBUG(0, __FUNCTION__ "(), hanging up!\n");
+			IRDA_DEBUG(0, "%s(), hanging up!\n", __FUNCTION__);
 			if (self->tty)
 				tty_hangup(self->tty);
 		}
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n",
+		IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__,
 			   ircomm_tty_event[event]);
 		return -EINVAL;
 	}
@@ -936,7 +933,7 @@
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);
 
-	IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n",
+	IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__,
 		   ircomm_tty_state[self->state], ircomm_tty_event[event]);
 	
 	return (*state[self->state])(self, event, skb, info);
@@ -955,7 +952,7 @@
 
 	self->state = state;
 	
-	IRDA_DEBUG(2, __FUNCTION__": next state=%s, service type=%d\n", 
+	IRDA_DEBUG(2, "%s: next state=%s, service type=%d\n", __FUNCTION__,
 		   ircomm_tty_state[self->state], self->service_type);
 }
 
diff -urN linux-2.4.23-pre7/net/irda/ircomm/ircomm_tty_ioctl.c linux-2.4.23-pre8/net/irda/ircomm/ircomm_tty_ioctl.c
--- linux-2.4.23-pre7/net/irda/ircomm/ircomm_tty_ioctl.c	2002-11-28 15:53:16.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/ircomm/ircomm_tty_ioctl.c	2003-10-23 03:33:18.000000000 -0700
@@ -59,7 +59,7 @@
 	unsigned cflag, cval;
 	int baud;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	if (!self->tty || !self->tty->termios || !self->ircomm)
 		return;
@@ -96,7 +96,7 @@
 		self->settings.flow_control |= IRCOMM_RTS_CTS_IN;
 		/* This got me. Bummer. Jean II */
 		if (self->service_type == IRCOMM_3_WIRE_RAW)
-			WARNING(__FUNCTION__ "(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n");
+			WARNING("%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n", __FUNCTION__);
 	} else {
 		self->flags &= ~ASYNC_CTS_FLOW;
 		self->settings.flow_control &= ~IRCOMM_RTS_CTS_IN;
@@ -152,7 +152,7 @@
 	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
 	unsigned int cflag = tty->termios->c_cflag;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	if ((cflag == old_termios->c_cflag) && 
 	    (RELEVANT_IFLAG(tty->termios->c_iflag) == 
@@ -201,7 +201,7 @@
 {
 	unsigned int result;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	result =  ((self->settings.dte & IRCOMM_RTS) ? TIOCM_RTS : 0)
 		| ((self->settings.dte & IRCOMM_DTR) ? TIOCM_DTR : 0)
@@ -225,7 +225,7 @@
 	unsigned int arg;
 	__u8 old_rts, old_dtr;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);
@@ -287,7 +287,7 @@
 	if (!retinfo)
 		return -EFAULT;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	memset(&info, 0, sizeof(info));
 	info.line = self->line;
@@ -323,7 +323,7 @@
 	struct serial_struct new_serial;
 	struct ircomm_tty_cb old_state, *state;
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	if (copy_from_user(&new_serial,new_info,sizeof(new_serial)))
 		return -EFAULT;
@@ -397,7 +397,7 @@
 	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
 	int ret = 0;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
 	    (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
@@ -426,7 +426,7 @@
 		break;
 
 	case TIOCGICOUNT:
-		IRDA_DEBUG(0, __FUNCTION__ "(), TIOCGICOUNT not impl!\n");
+		IRDA_DEBUG(0, "%s(), TIOCGICOUNT not impl!\n", __FUNCTION__);
 #if 0
 		save_flags(flags); cli();
 		cnow = driver->icount;
diff -urN linux-2.4.23-pre7/net/irda/irda_device.c linux-2.4.23-pre8/net/irda/irda_device.c
--- linux-2.4.23-pre7/net/irda/irda_device.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/irda_device.c	2003-10-23 03:33:18.000000000 -0700
@@ -174,7 +174,7 @@
 
 void irda_device_cleanup(void)
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	hashbin_delete(tasks, (FREE_FUNC) __irda_task_delete);
 	hashbin_delete(dongles, NULL);
@@ -190,7 +190,7 @@
 {
 	struct irlap_cb *self;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(%s)\n", status ? "TRUE" : "FALSE");
+	IRDA_DEBUG(4, "%s(%s)\n", __FUNCTION__, status ? "TRUE" : "FALSE");
 
 	self = (struct irlap_cb *) dev->atalk_ptr;
 
@@ -215,11 +215,11 @@
 	struct if_irda_req req;
 	int ret;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	if (!dev->do_ioctl) {
-		ERROR(__FUNCTION__ "(), do_ioctl not impl. by "
-		      "device driver\n");
+		ERROR("%s(), do_ioctl not impl. by "
+		      "device driver\n", __FUNCTION__);
 		return -1;
 	}
 
@@ -236,11 +236,11 @@
 	struct if_irda_req req;
 	int ret;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	if (!dev->do_ioctl) {
-		ERROR(__FUNCTION__ "(), do_ioctl not impl. by "
-		      "device driver\n");
+		ERROR("%s(), do_ioctl not impl. by "
+		      "device driver\n", __FUNCTION__);
 		return -1;
 	}
 
@@ -262,11 +262,11 @@
 	struct if_irda_req req;
 	int ret;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	if (!dev->do_ioctl) {
-		ERROR(__FUNCTION__ "(), do_ioctl not impl. by "
-		      "device driver\n");
+		ERROR("%s(), do_ioctl not impl. by "
+		      "device driver\n", __FUNCTION__);
 		return -1;
 	}
 
@@ -279,7 +279,7 @@
 
 void irda_task_next_state(struct irda_task *task, IRDA_TASK_STATE state)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "(), state = %s\n", task_state[state]);
+	IRDA_DEBUG(2, "%s(), state = %s\n", __FUNCTION__, task_state[state]);
 
 	task->state = state;
 }
@@ -313,7 +313,7 @@
 	int count = 0;
 	int timeout;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(task != NULL, return -1;);
 	ASSERT(task->magic == IRDA_TASK_MAGIC, return -1;);
@@ -322,14 +322,14 @@
 	do {
 		timeout = task->function(task);
 		if (count++ > 100) {
-			ERROR(__FUNCTION__ "(), error in task handler!\n");
+			ERROR("%s(), error in task handler!\n", __FUNCTION__);
 			irda_task_delete(task);
 			return TRUE;
 		}			
 	} while ((timeout == 0) && (task->state != IRDA_TASK_DONE));
 
 	if (timeout < 0) {
-		ERROR(__FUNCTION__ "(), Error executing task!\n");
+		ERROR("%s(), Error executing task!\n", __FUNCTION__);
 		irda_task_delete(task);
 		return TRUE;
 	}
@@ -361,8 +361,7 @@
 				 irda_task_timer_expired);
 		finished = FALSE;
 	} else {
-		IRDA_DEBUG(0, __FUNCTION__ 
-			   "(), not finished, and no timeout!\n");
+		IRDA_DEBUG(0, "%s(), not finished, and no timeout!\n", __FUNCTION__);
 		finished = FALSE;
 	}
 
@@ -391,7 +390,7 @@
 	struct irda_task *task;
 	int ret;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	task = kmalloc(sizeof(struct irda_task), GFP_ATOMIC);
 	if (!task)
@@ -428,7 +427,7 @@
 {
 	struct irda_task *task;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	task = (struct irda_task *) data;
 
@@ -547,7 +546,7 @@
 {
 	/* Check if this dongle has been registred before */
 	if (hashbin_find(dongles, new->type, NULL)) {
-		MESSAGE(__FUNCTION__ "(), Dongle already registered\n");
+		MESSAGE("%s(), Dongle already registered\n", __FUNCTION__);
                 return 0;
         }
 	
@@ -569,7 +568,7 @@
 
 	node = hashbin_remove(dongles, dongle->type, NULL);
 	if (!node) {
-		ERROR(__FUNCTION__ "(), dongle not found!\n");
+		ERROR("%s(), dongle not found!\n", __FUNCTION__);
 		return;
 	}
 }
@@ -586,11 +585,11 @@
 	struct if_irda_req req;
 	int ret;
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	if (!dev->do_ioctl) {
-		ERROR(__FUNCTION__ "(), set_raw_mode not impl. by "
-		      "device driver\n");
+		ERROR("%s(), set_raw_mode not impl. by "
+		      "device driver\n", __FUNCTION__);
 		return -1;
 	}
 	
diff -urN linux-2.4.23-pre7/net/irda/irias_object.c linux-2.4.23-pre8/net/irda/irias_object.c
--- linux-2.4.23-pre7/net/irda/irias_object.c	2001-10-04 18:41:09.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/irias_object.c	2003-10-23 03:33:18.000000000 -0700
@@ -59,7 +59,7 @@
 	/* Allocate new string */
         new_str = kmalloc(len + 1, GFP_ATOMIC);
         if (new_str == NULL) {
-		WARNING(__FUNCTION__"(), Unable to kmalloc!\n");
+		WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 
@@ -80,12 +80,12 @@
 {
         struct ias_object *obj;
 	
-	IRDA_DEBUG( 4, __FUNCTION__ "()\n");
+	IRDA_DEBUG( 4, "%s()\n", __FUNCTION__);
 
 	obj = (struct ias_object *) kmalloc(sizeof(struct ias_object), 
 					    GFP_ATOMIC);
 	if (obj == NULL) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), Unable to allocate object!\n");
+		IRDA_DEBUG(0, "%s(), Unable to allocate object!\n", __FUNCTION__);
 		return NULL;
 	}
 	memset(obj, 0, sizeof( struct ias_object));
@@ -272,7 +272,7 @@
 	/* Find object */
 	obj = hashbin_find(objects, 0, obj_name);
 	if (obj == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to find object: %s\n",
+		WARNING("%s(), Unable to find object: %s\n", __FUNCTION__,
 			obj_name);
 		return -1;
 	}
@@ -280,14 +280,13 @@
 	/* Find attribute */
 	attrib = hashbin_find(obj->attribs, 0, attrib_name);
 	if (attrib == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to find attribute: %s\n",
+		WARNING("%s(), Unable to find attribute: %s\n", __FUNCTION__,
 			attrib_name);
 		return -1;
 	}
 	
 	if ( attrib->value->type != new_value->type) {
-		IRDA_DEBUG( 0, __FUNCTION__ 
-		       "(), changing value type not allowed!\n");
+		IRDA_DEBUG( 0, "%s(), changing value type not allowed!\n", __FUNCTION__);
 		return -1;
 	}
 
@@ -319,7 +318,7 @@
 	attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), 
 					       GFP_ATOMIC);
 	if (attrib == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to allocate attribute!\n");
+		WARNING("%s(), Unable to allocate attribute!\n", __FUNCTION__);
 		return;
 	}
 	memset(attrib, 0, sizeof( struct ias_attrib));
@@ -354,8 +353,7 @@
 	attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), 
 					       GFP_ATOMIC);
 	if (attrib == NULL) {
-		WARNING(__FUNCTION__ 
-			"(), Unable to allocate attribute!\n");
+		WARNING("%s(), Unable to allocate attribute!\n", __FUNCTION__);
 		return;
 	}
 	memset(attrib, 0, sizeof( struct ias_attrib));
@@ -388,7 +386,7 @@
 	attrib = (struct ias_attrib *) kmalloc(sizeof( struct ias_attrib), 
 					       GFP_ATOMIC);
 	if (attrib == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to allocate attribute!\n");
+		WARNING("%s(), Unable to allocate attribute!\n", __FUNCTION__);
 		return;
 	}
 	memset(attrib, 0, sizeof( struct ias_attrib));
@@ -413,7 +411,7 @@
 
 	value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
 	if (value == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
+		WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 	memset(value, 0, sizeof(struct ias_value));
@@ -438,7 +436,7 @@
 
 	value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
 	if (value == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
+		WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 	memset( value, 0, sizeof( struct ias_value));
@@ -465,7 +463,7 @@
 
 	value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
 	if (value == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
+		WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 	memset(value, 0, sizeof(struct ias_value));
@@ -478,7 +476,7 @@
 
 	value->t.oct_seq = kmalloc(len, GFP_ATOMIC);
 	if (value->t.oct_seq == NULL){
-		WARNING(__FUNCTION__"(), Unable to kmalloc!\n");
+		WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__);
 		kfree(value);
 		return NULL;
 	}
@@ -492,7 +490,7 @@
 
 	value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
 	if (value == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
+		WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 	memset(value, 0, sizeof(struct ias_value));
@@ -511,7 +509,7 @@
  */
 void irias_delete_value(struct ias_value *value)
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(value != NULL, return;);
 
@@ -531,7 +529,7 @@
 			 kfree(value->t.oct_seq);
 		 break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown value type!\n");
+		IRDA_DEBUG(0, "%s(), Unknown value type!\n", __FUNCTION__);
 		break;
 	}
 	kfree(value);
diff -urN linux-2.4.23-pre7/net/irda/irlan/irlan_client.c linux-2.4.23-pre8/net/irda/irlan/irlan_client.c
--- linux-2.4.23-pre7/net/irda/irlan/irlan_client.c	2002-11-28 15:53:16.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/irlan/irlan_client.c	2003-10-23 03:33:18.000000000 -0700
@@ -71,7 +71,7 @@
 {
 	struct irlan_cb *self = (struct irlan_cb *) data;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -90,7 +90,7 @@
 
 void irlan_client_start_kick_timer(struct irlan_cb *self, int timeout)
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	irda_start_timer(&self->client.kick_timer, timeout, (void *) self, 
 			 irlan_client_kick_timer_expired);
@@ -104,7 +104,7 @@
  */
 void irlan_client_wakeup(struct irlan_cb *self, __u32 saddr, __u32 daddr)
 {
-	IRDA_DEBUG(1, __FUNCTION__ "()\n");
+	IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -116,7 +116,7 @@
 	if ((self->client.state != IRLAN_IDLE) || 
 	    (self->provider.access_type == ACCESS_DIRECT))
 	{
-			IRDA_DEBUG(0, __FUNCTION__ "(), already awake!\n");
+			IRDA_DEBUG(0, "%s(), already awake!\n", __FUNCTION__);
 			return;
 	}
 
@@ -125,7 +125,7 @@
 	self->daddr = daddr;
 
 	if (self->disconnect_reason == LM_USER_REQUEST) {
-			IRDA_DEBUG(0, __FUNCTION__ "(), still stopped by user\n");
+			IRDA_DEBUG(0, "%s(), still stopped by user\n", __FUNCTION__);
 			return;
 	}
 
@@ -152,7 +152,7 @@
 	struct irlan_cb *self;
 	__u32 saddr, daddr;
 	
-	IRDA_DEBUG(1, __FUNCTION__"()\n");
+	IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
 
 	ASSERT(irlan != NULL, return;);
 	ASSERT(discovery != NULL, return;);
@@ -174,7 +174,7 @@
 	if (self) {
 		ASSERT(self->magic == IRLAN_MAGIC, return;);
 
-		IRDA_DEBUG(1, __FUNCTION__ "(), Found instance (%08x)!\n",
+		IRDA_DEBUG(1, "%s(), Found instance (%08x)!\n", __FUNCTION__,
 		      daddr);
 		
 		irlan_client_wakeup(self, saddr, daddr);
@@ -192,7 +192,7 @@
 {
 	struct irlan_cb *self;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	
 	self = (struct irlan_cb *) instance;
 	
@@ -203,7 +203,7 @@
 	irlan_do_client_event(self, IRLAN_DATA_INDICATION, skb); 
 
 	/* Ready for a new command */	
-	IRDA_DEBUG(2, __FUNCTION__ "(), clearing tx_busy\n");
+	IRDA_DEBUG(2, "%s(), clearing tx_busy\n", __FUNCTION__);
 	self->client.tx_busy = FALSE;
 
 	/* Check if we have some queued commands waiting to be sent */
@@ -220,7 +220,7 @@
 	struct tsap_cb *tsap;
 	struct sk_buff *skb;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), reason=%d\n", reason);
+	IRDA_DEBUG(4, "%s(), reason=%d\n", __FUNCTION__, reason);
 	
 	self = (struct irlan_cb *) instance;
 	tsap = (struct tsap_cb *) sap;
@@ -252,7 +252,7 @@
 	struct tsap_cb *tsap;
 	notify_t notify;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -272,7 +272,7 @@
 	
 	tsap = irttp_open_tsap(LSAP_ANY, DEFAULT_INITIAL_CREDIT, &notify);
 	if (!tsap) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), Got no tsap!\n");
+		IRDA_DEBUG(2, "%s(), Got no tsap!\n", __FUNCTION__);
 		return;
 	}
 	self->client.tsap_ctrl = tsap;
@@ -292,7 +292,7 @@
 {
 	struct irlan_cb *self;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	self = (struct irlan_cb *) instance;
 
@@ -318,7 +318,7 @@
 	struct sk_buff *skb;
 	__u8 *frame;
 		
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -361,13 +361,13 @@
 
 	ASSERT(skb != NULL, return;);	
 	
-	IRDA_DEBUG(4, __FUNCTION__ "() skb->len=%d\n", (int) skb->len);
+	IRDA_DEBUG(4, "%s() skb->len=%d\n", __FUNCTION__, (int) skb->len);
 	
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
 	
 	if (!skb) {
-		ERROR( __FUNCTION__ "(), Got NULL skb!\n");
+		ERROR("%s(), Got NULL skb!\n", __FUNCTION__);
 		return;
 	}
 	frame = skb->data;
@@ -392,7 +392,7 @@
 	/* How many parameters? */
 	count = frame[1];
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), got %d parameters\n", count);
+	IRDA_DEBUG(4, "%s(), got %d parameters\n", __FUNCTION__, count);
 	
 	ptr = frame+2;
 
@@ -400,7 +400,7 @@
  	for (i=0; i<count;i++) {
 		ret = irlan_extract_param(ptr, name, value, &val_len);
 		if (ret < 0) {
-			IRDA_DEBUG(2, __FUNCTION__ "(), IrLAN, Error!\n");
+			IRDA_DEBUG(2, "%s(), IrLAN, Error!\n", __FUNCTION__);
 			break;
 		}
 		ptr += ret;
@@ -424,7 +424,7 @@
 	__u8 *bytes;
 	int i;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), parm=%s\n", param);
+	IRDA_DEBUG(4, "%s(), parm=%s\n", __FUNCTION__, param);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -462,7 +462,7 @@
 		else if (strcmp(value, "HOSTED") == 0)
 			self->client.access_type = ACCESS_HOSTED;
 		else {
-			IRDA_DEBUG(2, __FUNCTION__ "(), unknown access type!\n");
+			IRDA_DEBUG(2, "%s(), unknown access type!\n", __FUNCTION__);
 		}
 	}
 	/* IRLAN version */
@@ -484,14 +484,14 @@
 		memcpy(&tmp_cpu, value, 2); /* Align value */
 		le16_to_cpus(&tmp_cpu);     /* Convert to host order */
 		self->client.recv_arb_val = tmp_cpu;
-		IRDA_DEBUG(2, __FUNCTION__ "(), receive arb val=%d\n", 
+		IRDA_DEBUG(2, "%s(), receive arb val=%d\n", __FUNCTION__,
 			   self->client.recv_arb_val);
 	}
 	if (strcmp(param, "MAX_FRAME") == 0) {
 		memcpy(&tmp_cpu, value, 2); /* Align value */
 		le16_to_cpus(&tmp_cpu);     /* Convert to host order */
 		self->client.max_frame = tmp_cpu;
-		IRDA_DEBUG(4, __FUNCTION__ "(), max frame=%d\n", 
+		IRDA_DEBUG(4, "%s(), max frame=%d\n", __FUNCTION__,
 			   self->client.max_frame);
 	}
 	 
@@ -526,7 +526,7 @@
 {
 	struct irlan_cb *self;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(priv != NULL, return;);
 
@@ -539,7 +539,7 @@
 
 	/* Check if request succeeded */
 	if (result != IAS_SUCCESS) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), got NULL value!\n");
+		IRDA_DEBUG(2, "%s(), got NULL value!\n", __FUNCTION__);
 		irlan_do_client_event(self, IRLAN_IAS_PROVIDER_NOT_AVAIL, 
 				      NULL);
 		return;
@@ -557,7 +557,7 @@
 		irias_delete_value(value);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), unknown type!\n");
+		IRDA_DEBUG(2, "%s(), unknown type!\n", __FUNCTION__);
 		break;
 	}
 	irlan_do_client_event(self, IRLAN_IAS_PROVIDER_NOT_AVAIL, NULL);
diff -urN linux-2.4.23-pre7/net/irda/irlan/irlan_client_event.c linux-2.4.23-pre8/net/irda/irlan/irlan_client_event.c
--- linux-2.4.23-pre7/net/irda/irlan/irlan_client_event.c	2000-11-27 18:07:31.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/irlan/irlan_client_event.c	2003-10-23 03:33:18.000000000 -0700
@@ -92,7 +92,7 @@
 static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event, 
 				   struct sk_buff *skb) 
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRLAN_MAGIC, return -1;);
@@ -100,8 +100,7 @@
 	switch (event) {
 	case IRLAN_DISCOVERY_INDICATION:
 		if (self->client.iriap) {
-			WARNING(__FUNCTION__ 
-				"(), busy with a previous query\n");
+			WARNING("%s(), busy with a previous query\n", __FUNCTION__);
 			return -EBUSY;
 		}
 		
@@ -114,10 +113,10 @@
 					      "IrLAN", "IrDA:TinyTP:LsapSel");
 		break;
 	case IRLAN_WATCHDOG_TIMEOUT:
-		IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n");
+		IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__);
 		break;
 	default:
-		IRDA_DEBUG(4, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG(4, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb) 
@@ -136,7 +135,7 @@
 static int irlan_client_state_query(struct irlan_cb *self, IRLAN_EVENT event, 
 				    struct sk_buff *skb) 
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRLAN_MAGIC, return -1;);
@@ -154,7 +153,7 @@
 		irlan_next_client_state(self, IRLAN_CONN);
 		break;
 	case IRLAN_IAS_PROVIDER_NOT_AVAIL:
-		IRDA_DEBUG(2, __FUNCTION__ "(), IAS_PROVIDER_NOT_AVAIL\n");
+		IRDA_DEBUG(2, "%s(), IAS_PROVIDER_NOT_AVAIL\n", __FUNCTION__);
 		irlan_next_client_state(self, IRLAN_IDLE);
 
 		/* Give the client a kick! */
@@ -167,10 +166,10 @@
 		irlan_next_client_state(self, IRLAN_IDLE);
 		break;
 	case IRLAN_WATCHDOG_TIMEOUT:
-		IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n");
+		IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__"(), Unknown event %d\n", event);
+		IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb)
@@ -189,7 +188,7 @@
 static int irlan_client_state_conn(struct irlan_cb *self, IRLAN_EVENT event, 
 				   struct sk_buff *skb) 
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return -1;);
 	
@@ -204,10 +203,10 @@
 		irlan_next_client_state(self, IRLAN_IDLE);
 		break;
 	case IRLAN_WATCHDOG_TIMEOUT:
-		IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n");
+		IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb)
@@ -224,7 +223,7 @@
 static int irlan_client_state_info(struct irlan_cb *self, IRLAN_EVENT event, 
 				   struct sk_buff *skb) 
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	
@@ -244,10 +243,10 @@
 		irlan_next_client_state(self, IRLAN_IDLE);
 		break;
 	case IRLAN_WATCHDOG_TIMEOUT:
-		IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n");
+		IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb)
@@ -266,7 +265,7 @@
 static int irlan_client_state_media(struct irlan_cb *self, IRLAN_EVENT event, 
 				    struct sk_buff *skb) 
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return -1;);
 
@@ -281,10 +280,10 @@
 		irlan_next_client_state(self, IRLAN_IDLE);
 		break;
 	case IRLAN_WATCHDOG_TIMEOUT:
-		IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n");
+		IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb)
@@ -305,7 +304,7 @@
 {
 	struct qos_info qos;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return -1;);
 
@@ -344,7 +343,7 @@
 			irlan_next_client_state(self, IRLAN_DATA);
 			break;
 		default:
-			IRDA_DEBUG(2, __FUNCTION__ "(), unknown access type!\n");
+			IRDA_DEBUG(2, "%s(), unknown access type!\n", __FUNCTION__);
 			break;
 		}
 		break;
@@ -353,10 +352,10 @@
 		irlan_next_client_state(self, IRLAN_IDLE);
 		break;
 	case IRLAN_WATCHDOG_TIMEOUT:
-		IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n");
+		IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	
@@ -376,7 +375,7 @@
 static int irlan_client_state_wait(struct irlan_cb *self, IRLAN_EVENT event, 
 				   struct sk_buff *skb) 
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return -1;);
 	
@@ -390,10 +389,10 @@
 		irlan_next_client_state(self, IRLAN_IDLE);
 		break;
 	case IRLAN_WATCHDOG_TIMEOUT:
-		IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n");
+		IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb)
@@ -407,7 +406,7 @@
 {
 	struct qos_info qos;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	
@@ -429,7 +428,7 @@
 		} else if (self->client.recv_arb_val >
 			   self->provider.send_arb_val) 
 		{
-			IRDA_DEBUG(2, __FUNCTION__ "(), lost the battle :-(\n");
+			IRDA_DEBUG(2, "%s(), lost the battle :-(\n", __FUNCTION__);
 		}
 		break;
 	case IRLAN_DATA_CONNECT_INDICATION:
@@ -440,10 +439,10 @@
 		irlan_next_client_state(self, IRLAN_IDLE);
 		break;
 	case IRLAN_WATCHDOG_TIMEOUT:
-		IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n");
+		IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb)
@@ -462,7 +461,7 @@
 static int irlan_client_state_data(struct irlan_cb *self, IRLAN_EVENT event, 
 				   struct sk_buff *skb) 
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRLAN_MAGIC, return -1;);
@@ -476,7 +475,7 @@
 		irlan_next_client_state(self, IRLAN_IDLE);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb)
@@ -494,7 +493,7 @@
 static int irlan_client_state_close(struct irlan_cb *self, IRLAN_EVENT event, 
 				    struct sk_buff *skb) 
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	if (skb)
 		dev_kfree_skb(skb);
@@ -511,7 +510,7 @@
 static int irlan_client_state_sync(struct irlan_cb *self, IRLAN_EVENT event, 
 				   struct sk_buff *skb) 
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	
 	if (skb)
 		dev_kfree_skb(skb);
diff -urN linux-2.4.23-pre7/net/irda/irlan/irlan_common.c linux-2.4.23-pre8/net/irda/irlan/irlan_common.c
--- linux-2.4.23-pre7/net/irda/irlan/irlan_common.c	2002-02-25 11:38:14.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/irlan/irlan_common.c	2003-10-23 03:33:18.000000000 -0700
@@ -122,7 +122,7 @@
 	struct irlan_cb *new;
 	__u16 hints;
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 	/* Allocate master structure */
 	irlan = hashbin_new(HB_LOCAL); 
 	if (irlan == NULL) {
@@ -133,7 +133,7 @@
 	create_proc_info_entry("irlan", 0, proc_irda, irlan_proc_read);
 #endif /* CONFIG_PROC_FS */
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	hints = irlmp_service_to_hint(S_LAN);
 
 	/* Register with IrLMP as a client */
@@ -157,7 +157,7 @@
 
 void irlan_cleanup(void) 
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	irlmp_unregister_client(ckey);
 	irlmp_unregister_service(skey);
@@ -181,7 +181,7 @@
 {
 	int i=0;
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	/* Check if we should call the device eth<x> or irlan<x> */
 	if (!eth) {
@@ -192,7 +192,7 @@
 	}
 	
 	if (register_netdev(&self->dev) != 0) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), register_netdev() failed!\n");
+		IRDA_DEBUG(2, "%s(), register_netdev() failed!\n", __FUNCTION__);
 		return -1;
 	}
 	return 0;
@@ -208,7 +208,7 @@
 {
 	struct irlan_cb *self;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	ASSERT(irlan != NULL, return NULL;);
 
 	/* 
@@ -264,7 +264,7 @@
 {
 	struct sk_buff *skb;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -301,7 +301,7 @@
 	struct irlan_cb *self;
 	struct tsap_cb *tsap;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	
 	self = (struct irlan_cb *) instance;
 	tsap = (struct tsap_cb *) sap;
@@ -390,7 +390,7 @@
 	struct irlan_cb *self;
 	struct tsap_cb *tsap;
 
-	IRDA_DEBUG(0, __FUNCTION__ "(), reason=%d\n", reason);
+	IRDA_DEBUG(0, "%s(), reason=%d\n", __FUNCTION__, reason);
 	
 	self = (struct irlan_cb *) instance;
 	tsap = (struct tsap_cb *) sap;
@@ -409,22 +409,22 @@
 	
 	switch (reason) {
 	case LM_USER_REQUEST: /* User request */
-		IRDA_DEBUG(2, __FUNCTION__ "(), User requested\n");
+		IRDA_DEBUG(2, "%s(), User requested\n", __FUNCTION__);
 		break;
 	case LM_LAP_DISCONNECT: /* Unexpected IrLAP disconnect */
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unexpected IrLAP disconnect\n");
+		IRDA_DEBUG(2, "%s(), Unexpected IrLAP disconnect\n", __FUNCTION__);
 		break;
 	case LM_CONNECT_FAILURE: /* Failed to establish IrLAP connection */
-		IRDA_DEBUG(2, __FUNCTION__ "(), IrLAP connect failed\n");
+		IRDA_DEBUG(2, "%s(), IrLAP connect failed\n", __FUNCTION__);
 		break;
 	case LM_LAP_RESET:  /* IrLAP reset */
-		IRDA_DEBUG(2, __FUNCTION__ "(), IrLAP reset\n");
+		IRDA_DEBUG(2, "%s(), IrLAP reset\n", __FUNCTION__);
 		break;
 	case LM_INIT_DISCONNECT:
-		IRDA_DEBUG(2, __FUNCTION__ "(), IrLMP connect failed\n");
+		IRDA_DEBUG(2, "%s(), IrLMP connect failed\n", __FUNCTION__);
 		break;
 	default:
-		ERROR(__FUNCTION__ "(), Unknown disconnect reason\n");
+		ERROR("%s(), Unknown disconnect reason\n", __FUNCTION__);
 		break;
 	}
 	
@@ -446,7 +446,7 @@
 	struct tsap_cb *tsap;
 	notify_t notify;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -468,7 +468,7 @@
 
 	tsap = irttp_open_tsap(LSAP_ANY, DEFAULT_INITIAL_CREDIT, &notify);
 	if (!tsap) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), Got no tsap!\n");
+		IRDA_DEBUG(2, "%s(), Got no tsap!\n", __FUNCTION__);
 		return;
 	}
 	self->tsap_data = tsap;
@@ -482,7 +482,7 @@
 
 void irlan_close_tsaps(struct irlan_cb *self)
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -572,7 +572,7 @@
 {
 	struct sk_buff *skb;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	if (irda_lock(&self->client.tx_busy) == FALSE)
 		return -EBUSY;
@@ -591,7 +591,7 @@
 		dev_kfree_skb(skb);
 		return -1;
 	}
-	IRDA_DEBUG(2, __FUNCTION__ "(), sending ...\n");
+	IRDA_DEBUG(2, "%s(), sending ...\n", __FUNCTION__);
 
 	return irttp_data_request(self->client.tsap_ctrl, skb);
 }
@@ -604,7 +604,7 @@
  */
 void irlan_ctrl_data_request(struct irlan_cb *self, struct sk_buff *skb)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	/* Queue command */
 	skb_queue_tail(&self->client.txq, skb);
@@ -624,7 +624,7 @@
 	struct sk_buff *skb;
 	__u8 *frame;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -656,7 +656,7 @@
 	struct sk_buff *skb;
 	__u8 *frame;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -688,7 +688,7 @@
 	struct sk_buff *skb;
 	__u8 *frame;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -727,7 +727,7 @@
 	struct sk_buff *skb;
 	__u8 *frame;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);	
@@ -765,7 +765,7 @@
 	struct sk_buff *skb;
 	__u8 *frame;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -804,7 +804,7 @@
 	struct sk_buff *skb;
 	__u8 *frame;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -844,7 +844,7 @@
 	struct sk_buff *skb;
 	__u8 *frame;
 		
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -879,7 +879,7 @@
 	struct sk_buff *skb;
 	__u8 *frame;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -964,7 +964,7 @@
 	int n=0;
 	
 	if (skb == NULL) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), Got NULL skb\n");
+		IRDA_DEBUG(2, "%s(), Got NULL skb\n", __FUNCTION__);
 		return 0;
 	}	
 
@@ -981,7 +981,7 @@
 		ASSERT(value_len > 0, return 0;);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown parameter type!\n");
+		IRDA_DEBUG(2, "%s(), Unknown parameter type!\n", __FUNCTION__);
 		return 0;
 		break;
 	}
@@ -991,7 +991,7 @@
 
 	/* Make space for data */
 	if (skb_tailroom(skb) < (param_len+value_len+3)) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), No more space at end of skb\n");
+		IRDA_DEBUG(2, "%s(), No more space at end of skb\n", __FUNCTION__);
 		return 0;
 	}	
 	skb_put(skb, param_len+value_len+3);
@@ -1038,13 +1038,13 @@
 	__u16 val_len;
 	int n=0;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	/* get length of parameter name (1 byte) */
 	name_len = buf[n++];
 	
 	if (name_len > 254) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), name_len > 254\n");
+		IRDA_DEBUG(2, "%s(), name_len > 254\n", __FUNCTION__);
 		return -RSP_INVALID_COMMAND_FORMAT;
 	}
 	
@@ -1061,7 +1061,7 @@
 	le16_to_cpus(&val_len); n+=2;
 	
 	if (val_len > 1016) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), parameter length to long\n");
+		IRDA_DEBUG(2, "%s(), parameter length to long\n", __FUNCTION__);
 		return -RSP_INVALID_COMMAND_FORMAT;
 	}
 	*len = val_len;
diff -urN linux-2.4.23-pre7/net/irda/irlan/irlan_eth.c linux-2.4.23-pre8/net/irda/irlan/irlan_eth.c
--- linux-2.4.23-pre7/net/irda/irlan/irlan_eth.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/irlan/irlan_eth.c	2003-10-23 03:33:18.000000000 -0700
@@ -51,7 +51,7 @@
 {
 	struct irlan_cb *self;
 
-	IRDA_DEBUG(2, __FUNCTION__"()\n");
+	IRDA_DEBUG(2,"%s()\n", __FUNCTION__);
 
 	ASSERT(dev != NULL, return -1;);
        
@@ -109,7 +109,7 @@
 {
 	struct irlan_cb *self;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(dev != NULL, return -1;);
 
@@ -143,7 +143,7 @@
 	struct irlan_cb *self = (struct irlan_cb *) dev->priv;
 	struct sk_buff *skb;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	
 	/* Stop device */
 	netif_stop_queue(dev);
@@ -354,14 +354,14 @@
 
  	self = dev->priv; 
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
  	ASSERT(self != NULL, return;); 
  	ASSERT(self->magic == IRLAN_MAGIC, return;);
 
 	/* Check if data channel has been connected yet */
 	if (self->client.state != IRLAN_DATA) {
-		IRDA_DEBUG(1, __FUNCTION__ "(), delaying!\n");
+		IRDA_DEBUG(1, "%s(), delaying!\n", __FUNCTION__);
 		return;
 	}
 
@@ -371,20 +371,20 @@
 	} 
 	else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > HW_MAX_ADDRS) {
 		/* Disable promiscuous mode, use normal mode. */
-		IRDA_DEBUG(4, __FUNCTION__ "(), Setting multicast filter\n");
+		IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __FUNCTION__);
 		/* hardware_set_filter(NULL); */
 
 		irlan_set_multicast_filter(self, TRUE);
 	}
 	else if (dev->mc_count) {
-		IRDA_DEBUG(4, __FUNCTION__ "(), Setting multicast filter\n");
+		IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __FUNCTION__);
 		/* Walk the address list, and load the filter */
 		/* hardware_set_filter(dev->mc_list); */
 
 		irlan_set_multicast_filter(self, TRUE);
 	}
 	else {
-		IRDA_DEBUG(4, __FUNCTION__ "(), Clearing multicast filter\n");
+		IRDA_DEBUG(4, "%s(), Clearing multicast filter\n", __FUNCTION__);
 		irlan_set_multicast_filter(self, FALSE);
 	}
 
diff -urN linux-2.4.23-pre7/net/irda/irlan/irlan_event.c linux-2.4.23-pre8/net/irda/irlan/irlan_event.c
--- linux-2.4.23-pre7/net/irda/irlan/irlan_event.c	1999-11-02 17:07:55.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/irlan/irlan_event.c	2003-10-23 03:33:18.000000000 -0700
@@ -40,7 +40,7 @@
 
 void irlan_next_client_state(struct irlan_cb *self, IRLAN_STATE state) 
 {
-	IRDA_DEBUG(2, __FUNCTION__"(), %s\n", irlan_state[state]);
+	IRDA_DEBUG(2, "%s(), %s\n", __FUNCTION__, irlan_state[state]);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -50,7 +50,7 @@
 
 void irlan_next_provider_state(struct irlan_cb *self, IRLAN_STATE state) 
 {
-	IRDA_DEBUG(2, __FUNCTION__"(), %s\n", irlan_state[state]);
+	IRDA_DEBUG(2, "%s(), %s\n", __FUNCTION__, irlan_state[state]);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
diff -urN linux-2.4.23-pre7/net/irda/irlan/irlan_filter.c linux-2.4.23-pre8/net/irda/irlan/irlan_filter.c
--- linux-2.4.23-pre7/net/irda/irlan/irlan_filter.c	1999-11-02 17:07:55.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/irlan/irlan_filter.c	2003-10-23 03:33:18.000000000 -0700
@@ -143,7 +143,7 @@
 {
 	__u8 *bytes;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	bytes = value;
 
@@ -156,7 +156,7 @@
 	 *  This is experimental!! DB.
 	 */
 	 if (strcmp(param, "MODE") == 0) {
-		IRDA_DEBUG(0, __FUNCTION__ "()\n");
+		IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 		self->use_udata = TRUE;
 		return;
 	}
diff -urN linux-2.4.23-pre7/net/irda/irlan/irlan_provider.c linux-2.4.23-pre8/net/irda/irlan/irlan_provider.c
--- linux-2.4.23-pre7/net/irda/irlan/irlan_provider.c	2001-03-02 11:12:12.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/irlan/irlan_provider.c	2003-10-23 03:33:18.000000000 -0700
@@ -70,7 +70,7 @@
 	struct irlan_cb *self;
 	__u8 code;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	self = (struct irlan_cb *) instance;
 
@@ -99,15 +99,15 @@
 		irlan_do_provider_event(self, IRLAN_FILTER_CONFIG_CMD, skb);
 		break;
 	case CMD_RECONNECT_DATA_CHAN:
-		IRDA_DEBUG(2, __FUNCTION__"(), Got RECONNECT_DATA_CHAN command\n");
-		IRDA_DEBUG(2, __FUNCTION__"(), NOT IMPLEMENTED\n");
+		IRDA_DEBUG(2, "%s(), Got RECONNECT_DATA_CHAN command\n", __FUNCTION__);
+		IRDA_DEBUG(2, "%s(), NOT IMPLEMENTED\n", __FUNCTION__);
 		break;
 	case CMD_CLOSE_DATA_CHAN:
 		IRDA_DEBUG(2, "Got CLOSE_DATA_CHAN command!\n");
-		IRDA_DEBUG(2, __FUNCTION__"(), NOT IMPLEMENTED\n");
+		IRDA_DEBUG(2, "%s(), NOT IMPLEMENTED\n", __FUNCTION__);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown command!\n");
+		IRDA_DEBUG(2, "%s(), Unknown command!\n", __FUNCTION__);
 		break;
 	}
 	return 0;
@@ -129,7 +129,7 @@
 	struct tsap_cb *tsap;
 	__u32 saddr, daddr;
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 	
 	self = (struct irlan_cb *) instance;
 	tsap = (struct tsap_cb *) sap;
@@ -182,7 +182,7 @@
 	struct irlan_cb *self;
 	struct tsap_cb *tsap;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), reason=%d\n", reason);
+	IRDA_DEBUG(4, "%s(), reason=%d\n", __FUNCTION__, reason);
 	
 	self = (struct irlan_cb *) instance;
 	tsap = (struct tsap_cb *) sap;
@@ -236,7 +236,7 @@
 	
 	ASSERT(skb != NULL, return -RSP_PROTOCOL_ERROR;);
 	
-	IRDA_DEBUG(4, __FUNCTION__ "(), skb->len=%d\n", (int)skb->len);
+	IRDA_DEBUG(4, "%s(), skb->len=%d\n", __FUNCTION__, (int)skb->len);
 
 	ASSERT(self != NULL, return -RSP_PROTOCOL_ERROR;);
 	ASSERT(self->magic == IRLAN_MAGIC, return -RSP_PROTOCOL_ERROR;);
@@ -266,7 +266,7 @@
  	for (i=0; i<count;i++) {
 		ret = irlan_extract_param(ptr, name, value, &val_len);
 		if (ret < 0) {
-			IRDA_DEBUG(2, __FUNCTION__ "(), IrLAN, Error!\n");
+			IRDA_DEBUG(2, "%s(), IrLAN, Error!\n", __FUNCTION__);
 			break;
 		}
 		ptr+=ret;
@@ -291,7 +291,7 @@
 {
 	struct sk_buff *skb;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -316,7 +316,7 @@
 			irlan_insert_string_param(skb, "MEDIA", "802.5");
 			break;
 		default:
-			IRDA_DEBUG(2, __FUNCTION__ "(), unknown media type!\n");
+			IRDA_DEBUG(2, "%s(), unknown media type!\n", __FUNCTION__);
 			break;
 		}
 		irlan_insert_short_param(skb, "IRLAN_VER", 0x0101);
@@ -340,7 +340,7 @@
 			irlan_insert_string_param(skb, "ACCESS_TYPE", "HOSTED");
 			break;
 		default:
-			IRDA_DEBUG(2, __FUNCTION__ "(), Unknown access type\n");
+			IRDA_DEBUG(2, "%s(), Unknown access type\n", __FUNCTION__);
 			break;
 		}
 		irlan_insert_short_param(skb, "MAX_FRAME", 0x05ee);
@@ -361,7 +361,7 @@
 		handle_filter_request(self, skb);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown command!\n");
+		IRDA_DEBUG(2, "%s(), Unknown command!\n", __FUNCTION__);
 		break;
 	}
 
@@ -379,7 +379,7 @@
 	struct tsap_cb *tsap;
 	notify_t notify;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRLAN_MAGIC, return -1;);
@@ -400,7 +400,7 @@
 
 	tsap = irttp_open_tsap(LSAP_ANY, 1, &notify);
 	if (!tsap) {
-		IRDA_DEBUG(2, __FUNCTION__ "(), Got no tsap!\n");
+		IRDA_DEBUG(2, "%s(), Got no tsap!\n", __FUNCTION__);
 		return -1;
 	}
 	self->provider.tsap_ctrl = tsap;
diff -urN linux-2.4.23-pre7/net/irda/irlan/irlan_provider_event.c linux-2.4.23-pre8/net/irda/irlan/irlan_provider_event.c
--- linux-2.4.23-pre7/net/irda/irlan/irlan_provider_event.c	1999-11-02 17:07:55.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/irlan/irlan_provider_event.c	2003-10-23 03:33:18.000000000 -0700
@@ -72,7 +72,7 @@
 static int irlan_provider_state_idle(struct irlan_cb *self, IRLAN_EVENT event,
 				     struct sk_buff *skb)
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return -1;);
 	
@@ -82,7 +82,7 @@
 	     irlan_next_provider_state( self, IRLAN_INFO);
 	     break;
 	default:
-		IRDA_DEBUG(4, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG(4, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb)
@@ -101,7 +101,7 @@
 {
 	int ret;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return -1;);
 
@@ -147,7 +147,7 @@
 		irlan_next_provider_state(self, IRLAN_IDLE);
 		break;
 	default:
-		IRDA_DEBUG( 0, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG( 0, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb)
@@ -166,7 +166,7 @@
 static int irlan_provider_state_open(struct irlan_cb *self, IRLAN_EVENT event, 
 				     struct sk_buff *skb)
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 
@@ -186,7 +186,7 @@
 		irlan_next_provider_state(self, IRLAN_IDLE);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb)
@@ -205,7 +205,7 @@
 static int irlan_provider_state_data(struct irlan_cb *self, IRLAN_EVENT event, 
 				     struct sk_buff *skb) 
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRLAN_MAGIC, return -1;);
@@ -221,7 +221,7 @@
 		irlan_next_provider_state(self, IRLAN_IDLE);
 		break;
 	default:
-		IRDA_DEBUG( 0, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG( 0, "%s(), Unknown event %d\n", __FUNCTION__, event);
 		break;
 	}
 	if (skb)
diff -urN linux-2.4.23-pre7/net/irda/irlap_event.c linux-2.4.23-pre8/net/irda/irlap_event.c
--- linux-2.4.23-pre7/net/irda/irlap_event.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/irlap_event.c	2003-10-23 03:33:18.000000000 -0700
@@ -217,7 +217,7 @@
 	} else
 		self->fast_RR = FALSE;
 
-	IRDA_DEBUG(3, __FUNCTION__ "(), timeout=%d (%ld)\n", timeout, jiffies);
+	IRDA_DEBUG(3, "%s(), timeout=%d (%ld)\n", __FUNCTION__, timeout, jiffies);
 #endif /* CONFIG_IRDA_FAST_RR */
 
 	if (timeout == 0)
@@ -241,7 +241,7 @@
 	if (!self || self->magic != LAP_MAGIC)
 		return;
 
-  	IRDA_DEBUG(3, __FUNCTION__ "(), event = %s, state = %s\n", 
+  	IRDA_DEBUG(3, "%s(), event = %s, state = %s\n", __FUNCTION__,
 		   irlap_event[event], irlap_state[self->state]); 
 	
 	ret = (*state[self->state])(self, event, skb, info);
@@ -259,7 +259,7 @@
 		 * try to disconnect link if we send any data frames, since
 		 * that will change the state away form XMIT
 		 */
-		IRDA_DEBUG(2, __FUNCTION__ "() : queue len = %d\n",
+		IRDA_DEBUG(2, "%s() : queue len = %d\n", __FUNCTION__,
 			   skb_queue_len(&self->txq));
 
 		if (skb_queue_len(&self->txq)) {
@@ -353,8 +353,7 @@
 			/* Note : this will never happen, because we test
 			 * media busy in irlap_connect_request() and
 			 * postpone the event... - Jean II */
-			IRDA_DEBUG(0, __FUNCTION__
-				   "(), CONNECT_REQUEST: media busy!\n");
+			IRDA_DEBUG(0, "%s(), CONNECT_REQUEST: media busy!\n", __FUNCTION__);
 			
 			/* Always switch state before calling upper layers */
 			irlap_next_state(self, LAP_NDM);
@@ -380,15 +379,15 @@
 
 			irlap_connect_indication(self, skb);
 		} else {
-			IRDA_DEBUG(0, __FUNCTION__ "(), SNRM frame does not "
-				   "contain an I field!\n");
+			IRDA_DEBUG(0, "%s(), SNRM frame does not "
+				   "contain an I field!\n", __FUNCTION__);
 		}
 		break;
 	case DISCOVERY_REQUEST:		
 		ASSERT(info != NULL, return -1;);
 
 	 	if (self->media_busy) {
- 			IRDA_DEBUG(0, __FUNCTION__ "(), media busy!\n"); 
+ 			IRDA_DEBUG(0, "%s(), media busy!\n", __FUNCTION__); 
 			/* irlap->log.condition = MEDIA_BUSY; */
 						
 			/* This will make IrLMP try again */
@@ -450,7 +449,7 @@
 		 * log (and post an event).
 		 * Jean II
 		 */
-			IRDA_DEBUG(1, __FUNCTION__ "(), Receiving final discovery request, missed the discovery slots :-(\n");
+			IRDA_DEBUG(1, "%s(), Receiving final discovery request, missed the discovery slots :-(\n", __FUNCTION__);
 
 			/* Last discovery request -> in the log */
 			irlap_discovery_indication(self, info->discovery); 
@@ -526,8 +525,7 @@
 	case RECV_UI_FRAME:
 		/* Only accept broadcast frames in NDM mode */
 		if (info->caddr != CBROADCAST) {
-			IRDA_DEBUG(0, __FUNCTION__ 
-				   "(), not a broadcast frame!\n");
+			IRDA_DEBUG(0, "%s(), not a broadcast frame!\n", __FUNCTION__);
 		} else
 			irlap_unitdata_indication(self, skb);
 		break;
@@ -543,10 +541,10 @@
 		irlap_send_test_frame(self, CBROADCAST, info->daddr, skb);
 		break;
 	case RECV_TEST_RSP:
-		IRDA_DEBUG(0, __FUNCTION__ "() not implemented!\n");
+		IRDA_DEBUG(0, "%s() not implemented!\n", __FUNCTION__);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(2, "%s(), Unknown event %s\n", __FUNCTION__,
 			   irlap_event[event]);
 		
 		ret = -1;
@@ -574,13 +572,13 @@
 		ASSERT(info != NULL, return -1;);
 		ASSERT(info->discovery != NULL, return -1;);
 
-		IRDA_DEBUG(4, __FUNCTION__ "(), daddr=%08x\n", 
+		IRDA_DEBUG(4, "%s(), daddr=%08x\n", __FUNCTION__,
 			   info->discovery->daddr);
 
 		if (!self->discovery_log) {
-			WARNING(__FUNCTION__ "(), discovery log is gone! "
+			WARNING("%s(), discovery log is gone! "
 				"maybe the discovery timeout has been set to "
-				"short?\n");
+				"short?\n", __FUNCTION__);
 			break;
 		}
 		hashbin_insert(self->discovery_log, 
@@ -605,7 +603,7 @@
 
 		ASSERT(info != NULL, return -1;);
 
-		IRDA_DEBUG(1, __FUNCTION__ "(), Receiving discovery request (s = %d) while performing discovery :-(\n", info->s);
+		IRDA_DEBUG(1, "%s(), Receiving discovery request (s = %d) while performing discovery :-(\n", __FUNCTION__, info->s);
 
 		/* Last discovery request ? */
 		if (info->s == 0xff)
@@ -619,9 +617,8 @@
 		 * timing requirements.
 		 */
 		if (irda_device_is_receiving(self->netdev) && !self->add_wait) {
-			IRDA_DEBUG(2, __FUNCTION__ 
-				   "(), device is slow to answer, "
-				   "waiting some more!\n");
+			IRDA_DEBUG(2, "%s(), device is slow to answer, "
+				   "waiting some more!\n", __FUNCTION__);
 			irlap_start_slot_timer(self, MSECS_TO_JIFFIES(10));
 			self->add_wait = TRUE;
 			return ret;
@@ -657,7 +654,7 @@
 		}
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(2, "%s(), Unknown event %s\n", __FUNCTION__,
 			   irlap_event[event]);
 
 		ret = -1;
@@ -679,14 +676,14 @@
 	discovery_t *discovery_rsp;
 	int ret=0;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LAP_MAGIC, return -1;);
 
 	switch (event) {
 	case QUERY_TIMER_EXPIRED:
-		IRDA_DEBUG(2, __FUNCTION__ "(), QUERY_TIMER_EXPIRED <%ld>\n",
+		IRDA_DEBUG(2, "%s(), QUERY_TIMER_EXPIRED <%ld>\n", __FUNCTION__,
 		      jiffies);
 		irlap_next_state(self, LAP_NDM);
 		break;
@@ -715,7 +712,7 @@
 		}
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, %s\n", event,
+		IRDA_DEBUG(1, "%s(), Unknown event %d, %s\n", __FUNCTION__, event,
 			   irlap_event[event]);
 
 		ret = -1;
@@ -736,7 +733,7 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), event=%s\n", irlap_event[ event]);
+	IRDA_DEBUG(4, "%s(), event=%s\n", __FUNCTION__, irlap_event[ event]);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LAP_MAGIC, return -1;);
@@ -796,19 +793,18 @@
 
 		break;
 	case RECV_DISCOVERY_XID_CMD:
-		IRDA_DEBUG(3, __FUNCTION__ 
-			   "(), event RECV_DISCOVER_XID_CMD!\n");
+		IRDA_DEBUG(3, "%s(), event RECV_DISCOVER_XID_CMD!\n", __FUNCTION__);
 		irlap_next_state(self, LAP_NDM);
 
 		break;		
 	case DISCONNECT_REQUEST:
-		IRDA_DEBUG(0, __FUNCTION__ "(), Disconnect request!\n");
+		IRDA_DEBUG(0, "%s(), Disconnect request!\n", __FUNCTION__);
 		irlap_send_dm_frame(self);
 		irlap_next_state( self, LAP_NDM);
 		irlap_disconnect_indication(self, LAP_DISC_INDICATION);
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, %s\n", event,
+		IRDA_DEBUG(1, "%s(), Unknown event %d, %s\n", __FUNCTION__, event,
 			   irlap_event[event]);
 		
 		ret = -1;
@@ -830,7 +826,7 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LAP_MAGIC, return -1;);
@@ -859,7 +855,7 @@
 		self->retry_count++;
 		break;
 	case RECV_SNRM_CMD:
-		IRDA_DEBUG(4, __FUNCTION__ "(), SNRM battle!\n");
+		IRDA_DEBUG(4, "%s(), SNRM battle!\n", __FUNCTION__);
 
 		ASSERT(skb != NULL, return 0;);
 		ASSERT(info != NULL, return 0;);
@@ -940,7 +936,7 @@
 		irlap_disconnect_indication(self, LAP_DISC_INDICATION);
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, %s\n", event,
+		IRDA_DEBUG(1, "%s(), Unknown event %d, %s\n", __FUNCTION__, event,
 			   irlap_event[event]);		
 
 		ret = -1;
@@ -958,7 +954,7 @@
 static int irlap_state_offline(struct irlap_cb *self, IRLAP_EVENT event, 
 			       struct sk_buff *skb, struct irlap_info *info) 
 {
-	IRDA_DEBUG( 0, __FUNCTION__ "(), Unknown event\n");
+	IRDA_DEBUG( 0, "%s(), Unknown event\n", __FUNCTION__);
 
 	return -1;
 }
@@ -989,9 +985,8 @@
 			 *  speed and turn-around-time.
 			 */
 			if (skb->len > self->bytes_left) {
-				IRDA_DEBUG(4, __FUNCTION__ 
-					   "(), Not allowed to transmit more "
-					   "bytes!\n");
+				IRDA_DEBUG(4, "%s(), Not allowed to transmit more "
+					   "bytes!\n", __FUNCTION__);
 				skb_queue_head(&self->txq, skb_get(skb));
 				/*
 				 *  We should switch state to LAP_NRM_P, but
@@ -1029,8 +1024,7 @@
 			self->fast_RR = FALSE;
 #endif /* CONFIG_IRDA_FAST_RR */
 		} else {
-			IRDA_DEBUG(4, __FUNCTION__ 
-				   "(), Unable to send! remote busy?\n");
+			IRDA_DEBUG(4, "%s(), Unable to send! remote busy?\n", __FUNCTION__);
 			skb_queue_head(&self->txq, skb_get(skb));
 
 			/*
@@ -1041,7 +1035,7 @@
 		}
 		break;
 	case POLL_TIMER_EXPIRED:
-		IRDA_DEBUG(3, __FUNCTION__ "(), POLL_TIMER_EXPIRED (%ld)\n",
+		IRDA_DEBUG(3, "%s(), POLL_TIMER_EXPIRED (%ld)\n", __FUNCTION__,
 			   jiffies);
 		irlap_send_rr_frame(self, CMD_FRAME);
 		/* Return to NRM properly - Jean II  */
@@ -1067,7 +1061,7 @@
 		 * when we return... - Jean II */
 		break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(0, "%s(), Unknown event %s\n", __FUNCTION__,
 			   irlap_event[event]);
 
 		ret = -EINVAL;
@@ -1086,7 +1080,7 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(1, __FUNCTION__ "()\n");
+	IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LAP_MAGIC, return -1;);	
@@ -1121,7 +1115,7 @@
 		}
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d\n", event);
+		IRDA_DEBUG(1, "%s(), Unknown event %d\n", __FUNCTION__, event);
 
 		ret = -1;
 		break;	
@@ -1234,8 +1228,7 @@
 				/* Keep state */
 				irlap_next_state(self, LAP_NRM_P);
 			} else {
-				IRDA_DEBUG(4, __FUNCTION__
-				       "(), missing or duplicate frame!\n");
+				IRDA_DEBUG(4, "%s(), missing or duplicate frame!\n", __FUNCTION__);
 				
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
@@ -1299,8 +1292,7 @@
 		if ((ns_status == NS_UNEXPECTED) && 
 		    (nr_status == NR_UNEXPECTED)) 
 		{
-			IRDA_DEBUG(4, __FUNCTION__ 
-				   "(), unexpected nr and ns!\n");
+			IRDA_DEBUG(4, "%s(), unexpected nr and ns!\n", __FUNCTION__);
 			if (info->pf) {
 				/* Resend rejected frames */
 				irlap_resend_rejected_frames(self, CMD_FRAME);
@@ -1339,9 +1331,8 @@
 			}
 			break;
 		}
-		IRDA_DEBUG(1, __FUNCTION__ "(), Not implemented!\n");
-		IRDA_DEBUG(1, __FUNCTION__ 
-		      "(), event=%s, ns_status=%d, nr_status=%d\n", 
+		IRDA_DEBUG(1, "%s(), Not implemented!\n", __FUNCTION__);
+		IRDA_DEBUG(1, "%s(), event=%s, ns_status=%d, nr_status=%d\n", __FUNCTION__,
 		      irlap_event[ event], ns_status, nr_status);
 		break;
 	case RECV_UI_FRAME:
@@ -1353,7 +1344,7 @@
 			del_timer(&self->final_timer);
 			irlap_data_indication(self, skb, TRUE);
 			irlap_next_state(self, LAP_XMIT_P);
-			printk(__FUNCTION__ "(): RECV_UI_FRAME: next state %s\n", irlap_state[self->state]);
+			printk("%s(): RECV_UI_FRAME: next state %s\n", __FUNCTION__, irlap_state[self->state]);
 			irlap_start_poll_timer(self, self->poll_timeout);
 		}
 		break;
@@ -1406,8 +1397,8 @@
 			
 			irlap_next_state(self, LAP_NRM_P);
 		} else if (ret == NR_INVALID) {
-			IRDA_DEBUG(1, __FUNCTION__ "(), Received RR with "
-				   "invalid nr !\n");
+			IRDA_DEBUG(1, "%s(), Received RR with "
+				   "invalid nr !\n", __FUNCTION__);
 			del_timer(&self->final_timer);
 
 			irlap_next_state(self, LAP_RESET_WAIT);
@@ -1507,7 +1498,7 @@
 		irlap_start_final_timer(self, self->final_timeout);
 		break;
 	case RECV_RD_RSP:
-		IRDA_DEBUG(1, __FUNCTION__ "(), RECV_RD_RSP\n");
+		IRDA_DEBUG(1, "%s(), RECV_RD_RSP\n", __FUNCTION__);
 
 		irlap_flush_all_queues(self);
 		irlap_next_state(self, LAP_XMIT_P);
@@ -1515,7 +1506,7 @@
 		irlap_disconnect_request(self);
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(1, "%s(), Unknown event %s\n", __FUNCTION__,
 			   irlap_event[event]);
 
 		ret = -1;
@@ -1536,7 +1527,7 @@
 {
 	int ret = 0;
 	
-	IRDA_DEBUG(3, __FUNCTION__ "(), event = %s\n", irlap_event[event]);
+	IRDA_DEBUG(3, "%s(), event = %s\n", __FUNCTION__, irlap_event[event]);
 	
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LAP_MAGIC, return -1;);
@@ -1562,7 +1553,7 @@
 		irlap_next_state( self, LAP_PCLOSE);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(2, "%s(), Unknown event %s\n", __FUNCTION__,
 			   irlap_event[event]);
 
 		ret = -1;
@@ -1583,7 +1574,7 @@
 {
 	int ret = 0;
 	
-	IRDA_DEBUG(3, __FUNCTION__ "(), event = %s\n", irlap_event[event]);
+	IRDA_DEBUG(3, "%s(), event = %s\n", __FUNCTION__, irlap_event[event]);
 	
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LAP_MAGIC, return -1;);
@@ -1641,7 +1632,7 @@
 		 * state
 		 */
 		if (!info) {
-			IRDA_DEBUG(3, __FUNCTION__ "(), RECV_SNRM_CMD\n");
+			IRDA_DEBUG(3, "%s(), RECV_SNRM_CMD\n", __FUNCTION__);
 			irlap_initiate_connection_state(self);
 			irlap_wait_min_turn_around(self, &self->qos_tx);
 			irlap_send_ua_response_frame(self, &self->qos_rx);
@@ -1649,12 +1640,11 @@
 			irlap_start_wd_timer(self, self->wd_timeout);
 			irlap_next_state(self, LAP_NDM);
 		} else {
-			IRDA_DEBUG(0, __FUNCTION__ 
-				   "(), SNRM frame contained an I field!\n");
+			IRDA_DEBUG(0, "%s(), SNRM frame contained an I field!\n", __FUNCTION__);
 		}
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(1, "%s(), Unknown event %s\n", __FUNCTION__,
 			   irlap_event[event]);	
 
 		ret = -1;
@@ -1675,7 +1665,7 @@
 {
 	int ret = 0;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "(), event=%s\n", irlap_event[event]); 
+	IRDA_DEBUG(4, "%s(), event=%s\n", __FUNCTION__, irlap_event[event]); 
 
 	ASSERT(self != NULL, return -ENODEV;);
 	ASSERT(self->magic == LAP_MAGIC, return -EBADR;);
@@ -1731,7 +1721,7 @@
 				ret = -EPROTO;
 			}
 		} else {
-			IRDA_DEBUG(2, __FUNCTION__ "(), Unable to send!\n");
+			IRDA_DEBUG(2, "%s(), Unable to send!\n", __FUNCTION__);
 			skb_queue_head(&self->txq, skb_get(skb));
 			ret = -EPROTO;
 		}
@@ -1747,7 +1737,7 @@
 		 * when we return... - Jean II */
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(2, "%s(), Unknown event %s\n", __FUNCTION__,
 			   irlap_event[event]);
 
 		ret = -EINVAL;
@@ -1770,7 +1760,7 @@
 	int nr_status;
 	int ret = 0;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), event=%s\n", irlap_event[ event]);
+	IRDA_DEBUG(4, "%s(), event=%s\n", __FUNCTION__, irlap_event[ event]);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LAP_MAGIC, return -1;);
@@ -1778,8 +1768,8 @@
 	switch (event) {
 	case RECV_I_CMD: /* Optimize for the common case */
 		/* FIXME: must check for remote_busy below */
-		IRDA_DEBUG(4, __FUNCTION__ "(), event=%s nr=%d, vs=%d, ns=%d, "
-			   "vr=%d, pf=%d\n", irlap_event[event], info->nr, 
+		IRDA_DEBUG(4, "%s(), event=%s nr=%d, vs=%d, ns=%d, "
+			   "vr=%d, pf=%d\n", __FUNCTION__, irlap_event[event], info->nr, 
 			   self->vs, info->ns, self->vr, info->pf);
 
 		self->retry_count = 0;
@@ -2011,21 +2001,19 @@
 			/* Keep state */
 			irlap_next_state(self, LAP_NRM_S); 
 		} else {
-			IRDA_DEBUG(1, __FUNCTION__ 
-				   "(), invalid nr not implemented!\n");
+			IRDA_DEBUG(1, "%s(), invalid nr not implemented!\n", __FUNCTION__);
 		} 
 		break;
 	case RECV_SNRM_CMD:
 		/* SNRM frame is not allowed to contain an I-field */
 		if (!info) {
 			del_timer(&self->wd_timer);
-			IRDA_DEBUG(1, __FUNCTION__ "(), received SNRM cmd\n");
+			IRDA_DEBUG(1, "%s(), received SNRM cmd\n", __FUNCTION__);
 			irlap_next_state(self, LAP_RESET_CHECK);
 			
 			irlap_reset_indication(self);
 		} else {
-			IRDA_DEBUG(0, __FUNCTION__ 
-				   "(), SNRM frame contained an I-field!\n");
+			IRDA_DEBUG(0, "%s(), SNRM frame contained an I-field!\n", __FUNCTION__);
 			
 		}
 		break;
@@ -2057,7 +2045,7 @@
 		 *   which explain why we use (self->N2 / 2) here !!!
 		 * Jean II
 		 */
-		IRDA_DEBUG(1, __FUNCTION__ "(), retry_count = %d\n", 
+		IRDA_DEBUG(1, "%s(), retry_count = %d\n", __FUNCTION__,
 			   self->retry_count);
 
 		if (self->retry_count < (self->N2 / 2)) {
@@ -2110,7 +2098,7 @@
 		irlap_send_test_frame(self, self->caddr, info->daddr, skb);
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n", 
+		IRDA_DEBUG(1, "%s(), Unknown event %d, (%s)\n", __FUNCTION__,
 			   event, irlap_event[event]);
 
 		ret = -EINVAL;
@@ -2130,7 +2118,7 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(1, __FUNCTION__ "()\n");
+	IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -ENODEV;);
 	ASSERT(self->magic == LAP_MAGIC, return -EBADR;);
@@ -2168,7 +2156,7 @@
 		irlap_disconnect_indication(self, LAP_DISC_INDICATION);
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n", 
+		IRDA_DEBUG(1, "%s(), Unknown event %d, (%s)\n", __FUNCTION__,
 			   event, irlap_event[event]);
 
 		ret = -EINVAL;
@@ -2184,7 +2172,7 @@
 {
 	int ret = 0;
 
-	IRDA_DEBUG(1, __FUNCTION__ "(), event=%s\n", irlap_event[event]); 
+	IRDA_DEBUG(1, "%s(), event=%s\n", __FUNCTION__, irlap_event[event]); 
 
 	ASSERT(self != NULL, return -ENODEV;);
 	ASSERT(self->magic == LAP_MAGIC, return -EBADR;);
@@ -2205,7 +2193,7 @@
 		irlap_next_state(self, LAP_SCLOSE);
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n", 
+		IRDA_DEBUG(1, "%s(), Unknown event %d, (%s)\n", __FUNCTION__,
 			   event, irlap_event[event]);
 
 		ret = -EINVAL;
diff -urN linux-2.4.23-pre7/net/irda/irlap_frame.c linux-2.4.23-pre8/net/irda/irlap_frame.c
--- linux-2.4.23-pre7/net/irda/irlap_frame.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/irlap_frame.c	2003-10-23 03:33:19.000000000 -0700
@@ -167,8 +167,7 @@
 
 		/* Check if the new connection address is valid */
 		if ((info->caddr == 0x00) || (info->caddr == 0xfe)) {
-			IRDA_DEBUG(3, __FUNCTION__ 
-			      "(), invalid connection address!\n");
+			IRDA_DEBUG(3, "%s(), invalid connection address!\n", __FUNCTION__);
 			return;
 		}
 		
@@ -178,7 +177,7 @@
 		
 		/* Only accept if addressed directly to us */
 		if (info->saddr != self->saddr) {
-			IRDA_DEBUG(2, __FUNCTION__ "(), not addressed to us!\n");
+			IRDA_DEBUG(2, "%s(), not addressed to us!\n", __FUNCTION__);
 			return;
 		}
 		irlap_do_event(self, RECV_SNRM_CMD, skb, info);
@@ -200,7 +199,7 @@
 	struct ua_frame *frame;
 	int ret;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "() <%ld>\n", jiffies);
+	IRDA_DEBUG(2, "%s() <%ld>\n", __FUNCTION__, jiffies);
 	
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
@@ -275,7 +274,7 @@
 	struct sk_buff *skb = NULL;
 	__u8 *frame;
 	
-	IRDA_DEBUG(3, __FUNCTION__ "()\n");
+	IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
@@ -306,7 +305,7 @@
 	__u32 bcast = BROADCAST;
 	__u8 *info;
 
- 	IRDA_DEBUG(4, __FUNCTION__ "(), s=%d, S=%d, command=%d\n", s, S, 
+ 	IRDA_DEBUG(4, "%s(), s=%d, S=%d, command=%d\n", __FUNCTION__, s, S, 
 		   command);
 
 	ASSERT(self != NULL, return;);
@@ -398,7 +397,7 @@
 	__u8 *discovery_info;
 	char *text;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
@@ -410,13 +409,12 @@
 
 	/* Make sure frame is addressed to us */
 	if ((info->saddr != self->saddr) && (info->saddr != BROADCAST)) {
-		IRDA_DEBUG(0, __FUNCTION__ 
-			   "(), frame is not addressed to us!\n");
+		IRDA_DEBUG(0, "%s(), frame is not addressed to us!\n", __FUNCTION__);
 		return;
 	}
 
 	if ((discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) {
-		WARNING(__FUNCTION__ "(), kmalloc failed!\n");
+		WARNING("%s(), kmalloc failed!\n", __FUNCTION__);
 		return;
 	}
 	memset(discovery, 0, sizeof(discovery_t));
@@ -425,7 +423,7 @@
 	discovery->saddr = self->saddr;
 	discovery->timestamp = jiffies;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), daddr=%08x\n", discovery->daddr);
+	IRDA_DEBUG(4, "%s(), daddr=%08x\n", __FUNCTION__, discovery->daddr);
 
 	discovery_info = skb_pull(skb, sizeof(struct xid_frame));
 
@@ -476,8 +474,7 @@
 
 	/* Make sure frame is addressed to us */
 	if ((info->saddr != self->saddr) && (info->saddr != BROADCAST)) {
-		IRDA_DEBUG(0, __FUNCTION__ 
-			   "(), frame is not addressed to us!\n");
+		IRDA_DEBUG(0, "%s(), frame is not addressed to us!\n", __FUNCTION__);
 		return;
 	}
 
@@ -509,7 +506,7 @@
 	if (info->s == 0xff) {
 		/* Check if things are sane at this point... */
 		if((discovery_info == NULL) || (skb->len < 3)) {
-			ERROR(__FUNCTION__ "(), discovery frame to short!\n");
+			ERROR("%s(), discovery frame to short!\n", __FUNCTION__);
 			return;
 		}
 
@@ -518,7 +515,7 @@
 		 */
 		discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC);
 		if (!discovery) {
-			WARNING(__FUNCTION__ "(), unable to malloc!\n");
+			WARNING("%s(), unable to malloc!\n", __FUNCTION__);
 			return;
 		}
 	      
@@ -642,7 +639,7 @@
 
 	frame[2] = 0;
 
-   	IRDA_DEBUG(4, __FUNCTION__ "(), vr=%d, %ld\n",self->vr, jiffies); 
+   	IRDA_DEBUG(4, "%s(), vr=%d, %ld\n", __FUNCTION__, self->vr, jiffies); 
 
 	irlap_queue_xmit(self, skb);
 }
@@ -658,7 +655,7 @@
 {
 	info->nr = skb->data[1] >> 5;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), nr=%d, %ld\n", info->nr, jiffies);
+	IRDA_DEBUG(4, "%s(), nr=%d, %ld\n", __FUNCTION__, info->nr, jiffies);
 
 	if (command)
 		irlap_do_event(self, RECV_RNR_CMD, skb, info);
@@ -669,7 +666,7 @@
 static void irlap_recv_rej_frame(struct irlap_cb *self, struct sk_buff *skb, 
 				 struct irlap_info *info, int command)
 {
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	info->nr = skb->data[1] >> 5;
 	
@@ -683,7 +680,7 @@
 static void irlap_recv_srej_frame(struct irlap_cb *self, struct sk_buff *skb, 
 				  struct irlap_info *info, int command)
 {
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 
 	info->nr = skb->data[1] >> 5;
 	
@@ -697,7 +694,7 @@
 static void irlap_recv_disc_frame(struct irlap_cb *self, struct sk_buff *skb, 
 				  struct irlap_info *info, int command)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	/* Check if this is a command or a response frame */
 	if (command)
@@ -754,7 +751,7 @@
 
 		irlap_send_i_frame( self, tx_skb, CMD_FRAME);
 	} else {
-		IRDA_DEBUG(4, __FUNCTION__ "(), sending unreliable frame\n");
+		IRDA_DEBUG(4, "%s(), sending unreliable frame\n", __FUNCTION__);
 		irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME);
 		self->window -= 1;
 	}
@@ -803,7 +800,7 @@
 
 		irlap_send_i_frame(self, tx_skb, CMD_FRAME);
 	} else {
-		IRDA_DEBUG(4, __FUNCTION__ "(), sending unreliable frame\n");
+		IRDA_DEBUG(4, "%s(), sending unreliable frame\n", __FUNCTION__);
 
 		if (self->ack_required) {
 			irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME);
@@ -952,7 +949,7 @@
 		/* tx_skb = skb_clone( skb, GFP_ATOMIC); */
 		tx_skb = skb_copy(skb, GFP_ATOMIC);
 		if (!tx_skb) {
-			IRDA_DEBUG(0, __FUNCTION__ "(), unable to copy\n");
+			IRDA_DEBUG(0, "%s(), unable to copy\n", __FUNCTION__);
 			return;
 		}
 		/* Unlink tx_skb from list */
@@ -987,7 +984,7 @@
 	 */
 	while (skb_queue_len( &self->txq) > 0) {
 		
-		IRDA_DEBUG(0, __FUNCTION__ "(), sending additional frames!\n");
+		IRDA_DEBUG(0, "%s(), sending additional frames!\n", __FUNCTION__);
 		if ((skb_queue_len( &self->txq) > 0) && 
 		    (self->window > 0)) {
 			skb = skb_dequeue( &self->txq); 
@@ -1032,7 +1029,7 @@
 		/* tx_skb = skb_clone( skb, GFP_ATOMIC); */
 		tx_skb = skb_copy(skb, GFP_ATOMIC);
 		if (!tx_skb) {
-			IRDA_DEBUG(0, __FUNCTION__ "(), unable to copy\n");
+			IRDA_DEBUG(0, "%s(), unable to copy\n", __FUNCTION__);
 			return;	
 		}
 		/* Unlink tx_skb from list */
@@ -1058,7 +1055,7 @@
 void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb, 
 			 __u8 caddr, int command)
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
@@ -1118,7 +1115,7 @@
 static void irlap_recv_ui_frame(struct irlap_cb *self, struct sk_buff *skb, 
 				struct irlap_info *info)
 {
-	IRDA_DEBUG( 4, __FUNCTION__ "()\n");
+	IRDA_DEBUG( 4, "%s()\n", __FUNCTION__);
 
 	info->pf = skb->data[1] & PF_BIT;      /* Final bit */
 
@@ -1137,7 +1134,7 @@
 	__u8 *frame;
 	int w, x, y, z;
 
-	IRDA_DEBUG(0, __FUNCTION__ "()\n");
+	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
 	
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
@@ -1226,15 +1223,14 @@
 {
 	struct test_frame *frame;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 	
 	frame = (struct test_frame *) skb->data;
 		
 	/* Broadcast frames must carry saddr and daddr fields */
 	if (info->caddr == CBROADCAST) {
 		if (skb->len < sizeof(struct test_frame)) {
-			IRDA_DEBUG(0, __FUNCTION__ 
-				   "() test frame to short!\n");
+			IRDA_DEBUG(0, "%s() test frame to short!\n", __FUNCTION__);
 			return;
 		}
 		
@@ -1281,7 +1277,7 @@
 
 	/* Check if frame is large enough for parsing */
 	if (skb->len < 2) {
-		ERROR(__FUNCTION__ "(), frame to short!\n");
+		ERROR("%s(), frame to short!\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 		return -1;
 	}
@@ -1296,7 +1292,7 @@
 
 	/*  First we check if this frame has a valid connection address */
 	if ((info.caddr != self->caddr) && (info.caddr != CBROADCAST)) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), wrong connection address!\n");
+		IRDA_DEBUG(0, "%s(), wrong connection address!\n", __FUNCTION__);
 		goto out;
 	}
 	/*  
@@ -1330,8 +1326,7 @@
 			irlap_recv_srej_frame(self, skb, &info, command);
 			break;
 		default:
-			WARNING(__FUNCTION__ 
-				"() Unknown S-frame %02x received!\n",
+			WARNING("%s() Unknown S-frame %02x received!\n", __FUNCTION__,
 				info.control);
 			break;
 		}
@@ -1369,7 +1364,7 @@
 		irlap_recv_ui_frame(self, skb, &info);
 		break;
 	default:
-		WARNING(__FUNCTION__ "(), Unknown frame %02x received!\n", 
+		WARNING("%s(), Unknown frame %02x received!\n", __FUNCTION__,
 			info.control);
 		break;
 	}
diff -urN linux-2.4.23-pre7/net/irda/irlmp_frame.c linux-2.4.23-pre8/net/irda/irlmp_frame.c
--- linux-2.4.23-pre7/net/irda/irlmp_frame.c	2002-11-28 15:53:16.000000000 -0800
+++ linux-2.4.23-pre8/net/irda/irlmp_frame.c	2003-10-23 03:33:19.000000000 -0700
@@ -45,7 +45,7 @@
 	skb->data[1] = slsap;
 
 	if (expedited) {
-		IRDA_DEBUG(4, __FUNCTION__ "(), sending expedited data\n");
+		IRDA_DEBUG(4, "%s(), sending expedited data\n", __FUNCTION__);
 		irlap_data_request(self->irlap, skb, TRUE);
 	} else
 		irlap_data_request(self->irlap, skb, FALSE);
@@ -61,7 +61,7 @@
 {
 	__u8 *frame;
 	
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LMP_LAP_MAGIC, return;);
@@ -96,7 +96,7 @@
 	__u8   dlsap_sel;   /* Destination LSAP address */
 	__u8   *fp;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LMP_LAP_MAGIC, return;);
@@ -116,9 +116,9 @@
 	 *  it in a different way than other established connections.
 	 */
 	if ((fp[0] & CONTROL_BIT) && (fp[2] == CONNECT_CMD)) {
-		IRDA_DEBUG(3, __FUNCTION__ "(), incoming connection, "
+		IRDA_DEBUG(3, "%s(), incoming connection, "
 			   "source LSAP=%d, dest LSAP=%d\n",
-			   slsap_sel, dlsap_sel);
+			   __FUNCTION__, slsap_sel, dlsap_sel);
 		
 		/* Try to find LSAP among the unconnected LSAPs */
 		lsap = irlmp_find_lsap(self, dlsap_sel, slsap_sel, CONNECT_CMD,
@@ -126,7 +126,7 @@
 		
 		/* Maybe LSAP was already connected, so try one more time */
 		if (!lsap) {
-			IRDA_DEBUG(1, __FUNCTION__ "(), incoming connection for LSAP already connected\n");
+			IRDA_DEBUG(1, "%s(), incoming connection for LSAP already connected\n", __FUNCTION__);
 			lsap = irlmp_find_lsap(self, dlsap_sel, slsap_sel, 0,
 					       self->lsaps);
 		}
@@ -136,14 +136,12 @@
 	
 	if (lsap == NULL) {
 		IRDA_DEBUG(2, "IrLMP, Sorry, no LSAP for received frame!\n");
-		IRDA_DEBUG(2, __FUNCTION__ 
-		      "(), slsap_sel = %02x, dlsap_sel = %02x\n", slsap_sel, 
+		IRDA_DEBUG(2, "%s(), slsap_sel = %02x, dlsap_sel = %02x\n", __FUNCTION__, slsap_sel, 
 		      dlsap_sel);
 		if (fp[0] & CONTROL_BIT) {
-			IRDA_DEBUG(2, __FUNCTION__ 
-			      "(), received control frame %02x\n", fp[2]);
+			IRDA_DEBUG(2, "%s(), received control frame %02x\n", __FUNCTION__, fp[2]);
 		} else {
-			IRDA_DEBUG(2, __FUNCTION__ "(), received data frame\n");
+			IRDA_DEBUG(2, "%s(), received data frame\n", __FUNCTION__);
 		}
 		dev_kfree_skb(skb);
 		return;
@@ -162,8 +160,7 @@
 			irlmp_do_lsap_event(lsap, LM_CONNECT_CONFIRM, skb);
 			break;
 		case DISCONNECT:
-			IRDA_DEBUG(4, __FUNCTION__ 
-				   "(), Disconnect indication!\n");
+			IRDA_DEBUG(4, "%s(), Disconnect indication!\n", __FUNCTION__);
 			irlmp_do_lsap_event(lsap, LM_DISCONNECT_INDICATION, 
 					    skb);
 			break;
@@ -176,8 +173,7 @@
 			dev_kfree_skb(skb);
 			break;
 		default:
-			IRDA_DEBUG(0, __FUNCTION__ 
-				   "(), Unknown control frame %02x\n", fp[2]);
+			IRDA_DEBUG(0, "%s(), Unknown control frame %02x\n", __FUNCTION__, fp[2]);
 			dev_kfree_skb(skb);
 			break;
 		}
@@ -211,7 +207,7 @@
 	__u8   pid;         /* Protocol identifier */
 	__u8   *fp;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LMP_LAP_MAGIC, return;);
@@ -228,7 +224,7 @@
 	pid       = fp[2];
 	
 	if (pid & 0x80) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), extension in PID not supp!\n");
+		IRDA_DEBUG(0, "%s(), extension in PID not supp!\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 
 		return;
@@ -236,7 +232,7 @@
 
 	/* Check if frame is addressed to the connectionless LSAP */
 	if ((slsap_sel != LSAP_CONNLESS) || (dlsap_sel != LSAP_CONNLESS)) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), dropping frame!\n");
+		IRDA_DEBUG(0, "%s(), dropping frame!\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 		
 		return;
@@ -258,7 +254,7 @@
 	if (lsap)
 		irlmp_connless_data_indication(lsap, skb);
 	else {
-		IRDA_DEBUG(0, __FUNCTION__ "(), found no matching LSAP!\n");
+		IRDA_DEBUG(0, "%s(), found no matching LSAP!\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 	}
 }
@@ -275,7 +271,7 @@
 				      LAP_REASON reason, 
 				      struct sk_buff *userdata)
 {
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(lap != NULL, return;);
 	ASSERT(lap->magic == LMP_LAP_MAGIC, return;);
@@ -303,7 +299,7 @@
 				   __u32 daddr, struct qos_info *qos,
 				   struct sk_buff *skb) 
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	/* Copy QoS settings for this session */
 	self->qos = qos;
@@ -324,7 +320,7 @@
 void irlmp_link_connect_confirm(struct lap_cb *self, struct qos_info *qos, 
 				struct sk_buff *userdata)
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LMP_LAP_MAGIC, return;);
@@ -391,7 +387,7 @@
  */
 void irlmp_link_discovery_confirm(struct lap_cb *self, hashbin_t *log)
 {
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LMP_LAP_MAGIC, return;);
diff -urN linux-2.4.23-pre7/net/irda/irnet/irnet.h linux-2.4.23-pre8/net/irda/irnet/irnet.h
--- linux-2.4.23-pre7/net/irda/irnet/irnet.h	2003-06-13 07:51:39.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/irnet/irnet.h	2003-10-23 03:33:19.000000000 -0700
@@ -324,27 +324,27 @@
 /* All error messages (will show up in the normal logs) */
 #define DERROR(dbg, args...) \
 	{if(DEBUG_##dbg) \
-		printk(KERN_INFO "irnet: " __FUNCTION__ "(): " args);}
+		printk(KERN_INFO "irnet: %s(): ", __FUNCTION__); printk(args);}
 
 /* Normal debug message (will show up in /var/log/debug) */
 #define DEBUG(dbg, args...) \
 	{if(DEBUG_##dbg) \
-		printk(KERN_DEBUG "irnet: " __FUNCTION__ "(): " args);}
+		printk(KERN_DEBUG "irnet: %s(): ", __FUNCTION__); printk(args);}
 
 /* Entering a function (trace) */
 #define DENTER(dbg, args...) \
 	{if(DEBUG_##dbg) \
-		printk(KERN_DEBUG "irnet: ->" __FUNCTION__ args);}
+	printk(KERN_DEBUG "irnet: ->%s", __FUNCTION__); printk(args);}
 
 /* Entering and exiting a function in one go (trace) */
 #define DPASS(dbg, args...) \
 	{if(DEBUG_##dbg) \
-		printk(KERN_DEBUG "irnet: <>" __FUNCTION__ args);}
+		printk(KERN_DEBUG "irnet: <>%s", __FUNCTION__); printk(args);}
 
 /* Exiting a function (trace) */
 #define DEXIT(dbg, args...) \
 	{if(DEBUG_##dbg) \
-		printk(KERN_DEBUG "irnet: <-" __FUNCTION__ "()" args);}
+		printk(KERN_DEBUG "irnet: <-%s()", __FUNCTION__); printk(args);}
 
 /* Exit a function with debug */
 #define DRETURN(ret, dbg, args...) \
diff -urN linux-2.4.23-pre7/net/irda/irqueue.c linux-2.4.23-pre8/net/irda/irqueue.c
--- linux-2.4.23-pre7/net/irda/irqueue.c	2001-07-04 11:50:38.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/irqueue.c	2003-10-23 03:33:19.000000000 -0700
@@ -154,7 +154,7 @@
 	unsigned long flags = 0;
 	int bin;
 
-	IRDA_DEBUG( 4, __FUNCTION__"()\n");
+	IRDA_DEBUG( 4,"%s()\n", __FUNCTION__);
 
 	ASSERT( hashbin != NULL, return;);
 	ASSERT( hashbin->magic == HB_MAGIC, return;);
@@ -308,7 +308,7 @@
 	unsigned long flags = 0;
 	irda_queue_t* entry;
 
-	IRDA_DEBUG( 4, __FUNCTION__ "()\n");
+	IRDA_DEBUG( 4, "%s()\n", __FUNCTION__);
 
 	ASSERT( hashbin != NULL, return NULL;);
 	ASSERT( hashbin->magic == HB_MAGIC, return NULL;);
@@ -407,7 +407,7 @@
 	int	bin;
 	__u32	hashv;
 
-	IRDA_DEBUG( 4, __FUNCTION__ "()\n");
+	IRDA_DEBUG( 4, "%s()\n", __FUNCTION__);
 
 	ASSERT( hashbin != NULL, return NULL;);
 	ASSERT( hashbin->magic == HB_MAGIC, return NULL;);
@@ -553,7 +553,7 @@
  */
 static void __enqueue_last( irda_queue_t **queue, irda_queue_t* element)
 {
-	IRDA_DEBUG( 4, __FUNCTION__ "()\n");
+	IRDA_DEBUG( 4, "%s()\n", __FUNCTION__);
 
 	/*
 	 * Check if queue is empty.
@@ -596,7 +596,7 @@
 void enqueue_first(irda_queue_t **queue, irda_queue_t* element)
 {
 	
-	IRDA_DEBUG( 4, __FUNCTION__ "()\n");
+	IRDA_DEBUG( 4, "%s()\n", __FUNCTION__);
 
 	/*
 	 * Check if queue is empty.
diff -urN linux-2.4.23-pre7/net/irda/irttp.c linux-2.4.23-pre8/net/irda/irttp.c
--- linux-2.4.23-pre7/net/irda/irttp.c	2003-06-13 07:51:39.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/irttp.c	2003-10-23 03:33:19.000000000 -0700
@@ -94,7 +94,7 @@
 
 	irttp->tsaps = hashbin_new(HB_LOCAL);
 	if (!irttp->tsaps) {
-		ERROR(__FUNCTION__ "(), can't allocate IrTTP hashbin!\n");
+		ERROR("%s(), can't allocate IrTTP hashbin!\n", __FUNCTION__);
 		return -ENOMEM;
 	}
 	
@@ -165,7 +165,7 @@
 	if (!self || self->magic != TTP_TSAP_MAGIC)
 		return;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "(instance=%p)\n", self);
+	IRDA_DEBUG(4, "%s(instance=%p)\n", __FUNCTION__, self);
 
 	/* Try to make some progress, especially on Tx side - Jean II */
 	irttp_run_rx_queue(self);
@@ -206,7 +206,7 @@
 {
 	struct sk_buff* skb;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
@@ -239,7 +239,7 @@
       	ASSERT(self != NULL, return NULL;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return NULL;);
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), self->rx_sdu_size=%d\n", 
+	IRDA_DEBUG(2, "%s(), self->rx_sdu_size=%d\n", __FUNCTION__,
 		   self->rx_sdu_size);
 
 	skb = dev_alloc_skb(TTP_HEADER + self->rx_sdu_size);
@@ -262,9 +262,9 @@
 		
 		dev_kfree_skb(frag);
 	}
-	IRDA_DEBUG(2, __FUNCTION__ "(), frame len=%d\n", n);
+	IRDA_DEBUG(2, "%s(), frame len=%d\n", __FUNCTION__, n);
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), rx_sdu_size=%d\n", self->rx_sdu_size);
+	IRDA_DEBUG(2, "%s(), rx_sdu_size=%d\n", __FUNCTION__, self->rx_sdu_size);
 	ASSERT(n <= self->rx_sdu_size, return NULL;);
 
 	/* Set the new length */
@@ -287,7 +287,7 @@
 	struct sk_buff *frag;
 	__u8 *frame;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
@@ -297,7 +297,7 @@
 	 *  Split frame into a number of segments
 	 */
 	while (skb->len > self->max_seg_size) {
-		IRDA_DEBUG(2, __FUNCTION__  "(), fragmenting ...\n");
+		IRDA_DEBUG(2, "%s(), fragmenting ...\n", __FUNCTION__);
 
 		/* Make new segment */
 		frag = dev_alloc_skb(self->max_seg_size+self->max_header_size);
@@ -321,7 +321,7 @@
 		skb_queue_tail(&self->tx_queue, frag);
 	}
 	/* Queue what is left of the original skb */
-	IRDA_DEBUG(2, __FUNCTION__  "(), queuing last segment\n");
+	IRDA_DEBUG(2, "%s(), queuing last segment\n", __FUNCTION__);
 	
 	frame = skb_push(skb, TTP_HEADER);
 	frame[0] = 0x00; /* Clear more bit */
@@ -352,7 +352,7 @@
 	else
 		self->tx_max_sdu_size = param->pv.i;
 
-	IRDA_DEBUG(1, __FUNCTION__ "(), MaxSduSize=%d\n", param->pv.i);
+	IRDA_DEBUG(1, "%s(), MaxSduSize=%d\n", __FUNCTION__, param->pv.i);
 	
 	return 0;
 }
@@ -380,13 +380,13 @@
 	 * JeanII */
 	if((stsap_sel != LSAP_ANY) &&
 	   ((stsap_sel < 0x01) || (stsap_sel >= 0x70))) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), invalid tsap!\n");
+		IRDA_DEBUG(0, "%s(), invalid tsap!\n", __FUNCTION__);
 		return NULL;
 	}
 
 	self = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC);
 	if (self == NULL) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), unable to kmalloc!\n");
+		IRDA_DEBUG(0, "%s(), unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 	memset(self, 0, sizeof(struct tsap_cb));
@@ -421,7 +421,7 @@
 	 */
 	lsap = irlmp_open_lsap(stsap_sel, &ttp_notify, 0);
 	if (lsap == NULL) {
-		WARNING(__FUNCTION__ "(), unable to allocate LSAP!!\n");
+		WARNING("%s(), unable to allocate LSAP!!\n", __FUNCTION__);
 		return NULL;
 	}
 	
@@ -431,7 +431,7 @@
 	 *  the stsap_sel we have might not be valid anymore
 	 */
 	self->stsap_sel = lsap->slsap_sel;
-	IRDA_DEBUG(4, __FUNCTION__ "(), stsap_sel=%02x\n", self->stsap_sel);
+	IRDA_DEBUG(4, "%s(), stsap_sel=%02x\n", __FUNCTION__, self->stsap_sel);
 
 	self->notify = *notify;
 	self->lsap = lsap;
@@ -488,7 +488,7 @@
 {
 	struct tsap_cb *tsap;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
@@ -497,7 +497,7 @@
 	if (self->connected) {
 		/* Check if disconnect is not pending */
 		if (!test_bit(0, &self->disconnect_pend)) {
-			WARNING(__FUNCTION__ "(), TSAP still connected!\n");
+			WARNING("%s(), TSAP still connected!\n", __FUNCTION__);
 			irttp_disconnect_request(self, NULL, P_NORMAL);
 		}
 		self->close_pend = TRUE;
@@ -533,16 +533,16 @@
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
 	ASSERT(skb != NULL, return -1;);
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	/* Check that nothing bad happens */
 	if ((skb->len == 0) || (!self->connected)) {
-		IRDA_DEBUG(1, __FUNCTION__ "(), No data, or not connected\n");
+		IRDA_DEBUG(1, "%s(), No data, or not connected\n", __FUNCTION__);
 		return -1;
 	}
 	
 	if (skb->len > self->max_seg_size) {
-		IRDA_DEBUG(1, __FUNCTION__ "(), UData is to large for IrLAP!\n");
+		IRDA_DEBUG(1, "%s(), UData is to large for IrLAP!\n", __FUNCTION__);
 		return -1;
 	}
 		    
@@ -566,12 +566,12 @@
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
 	ASSERT(skb != NULL, return -1;);
 
-	IRDA_DEBUG(2, __FUNCTION__ " : queue len = %d\n",
+	IRDA_DEBUG(2, "%s : queue len = %d\n", __FUNCTION__,
 		   skb_queue_len(&self->tx_queue));
 
 	/* Check that nothing bad happens */
 	if ((skb->len == 0) || (!self->connected)) {
-		WARNING(__FUNCTION__ "(), No data, or not connected\n");
+		WARNING("%s(), No data, or not connected\n", __FUNCTION__);
 		return -ENOTCONN;
 	}
 
@@ -580,8 +580,7 @@
 	 *  inside an IrLAP frame
 	 */
 	if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) {
-		ERROR(__FUNCTION__ 
-		      "(), SAR disabled, and data is to large for IrLAP!\n");
+		ERROR("%s(), SAR disabled, and data is to large for IrLAP!\n", __FUNCTION__);
 		return -EMSGSIZE;
 	}
 
@@ -593,8 +592,8 @@
 	    (self->tx_max_sdu_size != TTP_SAR_UNBOUND) && 
 	    (skb->len > self->tx_max_sdu_size))
 	{
-		ERROR(__FUNCTION__ "(), SAR enabled, "
-		      "but data is larger than TxMaxSduSize!\n");
+		ERROR("%s(), SAR enabled, "
+		      "but data is larger than TxMaxSduSize!\n", __FUNCTION__);
 		return -EMSGSIZE;
 	}
 	/* 
@@ -665,7 +664,7 @@
 	unsigned long flags;
 	int n;
 
-	IRDA_DEBUG(2, __FUNCTION__ "() : send_credit = %d, queue_len = %d\n",
+	IRDA_DEBUG(2, "%s() : send_credit = %d, queue_len = %d\n", __FUNCTION__,
 		   self->send_credit, skb_queue_len(&self->tx_queue));
 
 	/* Get exclusive access to the tx queue, otherwise don't touch it */
@@ -773,7 +772,7 @@
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);	
 
-	IRDA_DEBUG(4, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n", 
+	IRDA_DEBUG(4, "%s() send=%d,avail=%d,remote=%d\n", __FUNCTION__,
 		   self->send_credit, self->avail_credit, self->remote_credit);
 
 	/* Give credit to peer */
@@ -821,7 +820,7 @@
 {
 	struct tsap_cb *self;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	self = (struct tsap_cb *) instance;
 
@@ -933,7 +932,7 @@
 {
 	struct tsap_cb *self;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	self = (struct tsap_cb *) instance;
 	
@@ -947,7 +946,7 @@
 		self->notify.status_indication(self->notify.instance, 
 					       link, lock);
 	else
-		IRDA_DEBUG(2, __FUNCTION__ "(), no handler\n");
+		IRDA_DEBUG(2, "%s(), no handler\n", __FUNCTION__);
 }
 
 /*
@@ -965,7 +964,7 @@
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
 	
-	IRDA_DEBUG(4, __FUNCTION__ "(instance=%p)\n", self);
+	IRDA_DEBUG(4, "%s(instance=%p)\n", __FUNCTION__, self);
 
 	/* We are "polled" directly from LAP, and the LAP want to fill
 	 * its Tx window. We want to do our best to send it data, so that
@@ -1003,18 +1002,18 @@
  */
 void irttp_flow_request(struct tsap_cb *self, LOCAL_FLOW flow)
 {
-	IRDA_DEBUG(1, __FUNCTION__ "()\n");
+	IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
 
 	switch (flow) {
 	case FLOW_STOP:
-		IRDA_DEBUG(1, __FUNCTION__ "(), flow stop\n");
+		IRDA_DEBUG(1, "%s(), flow stop\n", __FUNCTION__);
 		self->rx_sdu_busy = TRUE;
 		break;
 	case FLOW_START:
-		IRDA_DEBUG(1, __FUNCTION__ "(), flow start\n");
+		IRDA_DEBUG(1, "%s(), flow start\n", __FUNCTION__);
 		self->rx_sdu_busy = FALSE;
 		
 		/* Client say he can accept more data, try to free our
@@ -1023,7 +1022,7 @@
 
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown flow command!\n");
+		IRDA_DEBUG(1, "%s(), Unknown flow command!\n", __FUNCTION__);
 	}
 }
 	
@@ -1042,7 +1041,7 @@
 	__u8 *frame;
 	__u8 n;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "(), max_sdu_size=%d\n", max_sdu_size); 
+	IRDA_DEBUG(4, "%s(), max_sdu_size=%d\n", __FUNCTION__, max_sdu_size); 
 	
 	ASSERT(self != NULL, return -EBADR;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return -EBADR;);
@@ -1134,7 +1133,7 @@
 	__u8 plen;
 	__u8 n;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	self = (struct tsap_cb *) instance;
 
@@ -1158,7 +1157,7 @@
 
 	n = skb->data[0] & 0x7f;
 	
-	IRDA_DEBUG(4, __FUNCTION__ "(), Initial send_credit=%d\n", n);
+	IRDA_DEBUG(4, "%s(), Initial send_credit=%d\n", __FUNCTION__, n);
 	
 	self->send_credit = n;
 	self->tx_max_sdu_size = 0;
@@ -1178,8 +1177,7 @@
 
 		/* Any errors in the parameter list? */
 		if (ret < 0) {
-			WARNING(__FUNCTION__ 
-				"(), error extracting parameters\n");
+			WARNING("%s(), error extracting parameters\n", __FUNCTION__);
 			dev_kfree_skb(skb);
 
 			/* Do not accept this connection attempt */
@@ -1189,10 +1187,10 @@
 		skb_pull(skb, IRDA_MIN(skb->len, plen+1));
 	}
 	
-	IRDA_DEBUG(4, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n", 
+	IRDA_DEBUG(4, "%s() send=%d,avail=%d,remote=%d\n", __FUNCTION__,
 	      self->send_credit, self->avail_credit, self->remote_credit);
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), MaxSduSize=%d\n", self->tx_max_sdu_size);
+	IRDA_DEBUG(2, "%s(), MaxSduSize=%d\n", __FUNCTION__, self->tx_max_sdu_size);
 
 	if (self->notify.connect_confirm) {
 		self->notify.connect_confirm(self->notify.instance, self, qos,
@@ -1229,7 +1227,7 @@
 	self->max_seg_size = max_seg_size - TTP_HEADER;;
 	self->max_header_size = max_header_size+TTP_HEADER;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), TSAP sel=%02x\n", self->stsap_sel);
+	IRDA_DEBUG(4, "%s(), TSAP sel=%02x\n", __FUNCTION__, self->stsap_sel);
 
 	/* Need to update dtsap_sel if its equal to LSAP_ANY */
 	self->dtsap_sel = lsap->dlsap_sel;
@@ -1253,8 +1251,7 @@
 
 		/* Any errors in the parameter list? */
 		if (ret < 0) {
-			WARNING(__FUNCTION__ 
-				"(), error extracting parameters\n");
+			WARNING("%s(), error extracting parameters\n", __FUNCTION__);
 			dev_kfree_skb(skb);
 			
 			/* Do not accept this connection attempt */
@@ -1291,7 +1288,7 @@
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), Source TSAP selector=%02x\n", 
+	IRDA_DEBUG(4, "%s(), Source TSAP selector=%02x\n", __FUNCTION__,
 		   self->stsap_sel);
 	
 	/* Any userdata supplied? */
@@ -1369,15 +1366,15 @@
 {
 	struct tsap_cb *new;
 
-	IRDA_DEBUG(1, __FUNCTION__ "()\n");
+	IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
 
 	if (!hashbin_find(irttp->tsaps, (int) orig, NULL)) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), unable to find TSAP\n");
+		IRDA_DEBUG(0, "%s(), unable to find TSAP\n", __FUNCTION__);
 		return NULL;
 	}
 	new = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC);
 	if (!new) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), unable to kmalloc\n");
+		IRDA_DEBUG(0, "%s(), unable to kmalloc\n", __FUNCTION__);
 		return NULL;
 	}
 	/* Dup */
@@ -1415,7 +1412,7 @@
 
 	/* Already disconnected? */
 	if (!self->connected) {
-		IRDA_DEBUG(4, __FUNCTION__ "(), already disconnected!\n");
+		IRDA_DEBUG(4, "%s(), already disconnected!\n", __FUNCTION__);
 		if (userdata)
 			dev_kfree_skb(userdata);
 		return -1;
@@ -1427,7 +1424,7 @@
 	 * for following a disconnect_indication() (i.e. net_bh).
 	 * Jean II */
 	if(test_and_set_bit(0, &self->disconnect_pend)) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), disconnect already pending\n");
+		IRDA_DEBUG(0, "%s(), disconnect already pending\n", __FUNCTION__);
 		if (userdata)
 			dev_kfree_skb(userdata);
 
@@ -1446,7 +1443,7 @@
 			 *  disconnecting right now since the data will
 			 *  not have any usable connection to be sent on
 			 */
-			IRDA_DEBUG(1, __FUNCTION__  "High priority!!()\n" );
+			IRDA_DEBUG(1, "%s High priority!!()\n", __FUNCTION__);
 			irttp_flush_queues(self);
 		} else if (priority == P_NORMAL) {
 			/* 
@@ -1467,7 +1464,7 @@
 	 * be sent at the LMP level (so even if the peer has its Tx queue
 	 * full of data). - Jean II */
 
-	IRDA_DEBUG(1, __FUNCTION__ "(), Disconnecting ...\n");
+	IRDA_DEBUG(1, "%s(), Disconnecting ...\n", __FUNCTION__);
 	self->connected = FALSE;
 
 	if (!userdata) {
@@ -1501,7 +1498,7 @@
 {
 	struct tsap_cb *self;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
 	self = (struct tsap_cb *) instance;
 	
@@ -1561,7 +1558,7 @@
 	 * give an error back 
 	 */
 	if (err == -ENOMEM) {
-		IRDA_DEBUG(0, __FUNCTION__ "() requeueing skb!\n");
+		IRDA_DEBUG(0, "%s() requeueing skb!\n", __FUNCTION__);
 
 		/* Make sure we take a break */
 		self->rx_sdu_busy = TRUE;
@@ -1586,7 +1583,7 @@
 	struct sk_buff *skb;
 	int more = 0;
 
-	IRDA_DEBUG(2, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n", 
+	IRDA_DEBUG(2, "%s() send=%d,avail=%d,remote=%d\n", __FUNCTION__,
 		   self->send_credit, self->avail_credit, self->remote_credit);
 
 	/* Get exclusive access to the rx queue, otherwise don't touch it */
@@ -1626,7 +1623,7 @@
 			 *  limits of the maximum size of the rx_sdu
 			 */
 			if (self->rx_sdu_size <= self->rx_max_sdu_size) {
-				IRDA_DEBUG(4, __FUNCTION__ "(), queueing frag\n");
+				IRDA_DEBUG(4, "%s(), queueing frag\n", __FUNCTION__);
 				skb_queue_tail(&self->rx_fragments, skb);
 			} else {
 				/* Free the part of the SDU that is too big */
@@ -1656,7 +1653,7 @@
 			/* Now we can deliver the reassembled skb */
 			irttp_do_data_indication(self, skb);
 		} else {
-			IRDA_DEBUG(1, __FUNCTION__ "(), Truncated frame\n");
+			IRDA_DEBUG(1, "%s(), Truncated frame\n", __FUNCTION__);
 			
 			/* Free the part of the SDU that is too big */
 			dev_kfree_skb(skb);
diff -urN linux-2.4.23-pre7/net/irda/parameters.c linux-2.4.23-pre8/net/irda/parameters.c
--- linux-2.4.23-pre7/net/irda/parameters.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/parameters.c	2003-10-23 03:33:19.000000000 -0700
@@ -150,22 +150,22 @@
 	 */
 	if (p.pl == 0) {
 		if (p.pv.i < 0xff) {
-			IRDA_DEBUG(2, __FUNCTION__ "(), using 1 byte\n");
+			IRDA_DEBUG(2, "%s(), using 1 byte\n", __FUNCTION__);
 			p.pl = 1;
 		} else if (p.pv.i < 0xffff) {
-			IRDA_DEBUG(2, __FUNCTION__ "(), using 2 bytes\n");
+			IRDA_DEBUG(2, "%s(), using 2 bytes\n", __FUNCTION__);
 			p.pl = 2;
 		} else {
-			IRDA_DEBUG(2, __FUNCTION__ "(), using 4 bytes\n");
+			IRDA_DEBUG(2, "%s(), using 4 bytes\n", __FUNCTION__);
 			p.pl = 4; /* Default length */
 		}
 	}
 	/* Check if buffer is long enough for insertion */
 	if (len < (2+p.pl)) {
-		WARNING(__FUNCTION__ "(), buffer to short for insertion!\n");
+		WARNING("%s(), buffer to short for insertion!\n", __FUNCTION__);
 		return -1;
 	}
-	IRDA_DEBUG(2, __FUNCTION__ "(), pi=%#x, pl=%d, pi=%d\n", p.pi, p.pl, p.pv.i);
+	IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __FUNCTION__, p.pi, p.pl, p.pv.i);
 	switch (p.pl) {
 	case 1:
 		n += irda_param_pack(buf, "bbb", p.pi, p.pl, (__u8) p.pv.i);
@@ -186,7 +186,7 @@
 
 		break;
 	default:
-		WARNING(__FUNCTION__ "() length %d not supported\n", p.pl);
+		WARNING("%s() length %d not supported\n", __FUNCTION__, p.pl);
 		/* Skip parameter */ 
 		return -1;
 	}
@@ -215,8 +215,8 @@
 
 	/* Check if buffer is long enough for parsing */
 	if (len < (2+p.pl)) {
-		WARNING(__FUNCTION__ "(), buffer to short for parsing! "
-			"Need %d bytes, but len is only %d\n", p.pl, len);
+		WARNING("%s(), buffer to short for parsing! "
+			"Need %d bytes, but len is only %d\n", __FUNCTION__, p.pl, len);
 		return -1;
 	}
 
@@ -226,9 +226,9 @@
 	 * PV_INTEGER means that the handler is flexible.
 	 */
 	if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) {
-		ERROR(__FUNCTION__ "(), invalid parameter length! "
+		ERROR("%s(), invalid parameter length! "
 		      "Expected %d bytes, but value had %d bytes!\n",
-		      type & PV_MASK, p.pl);
+		      __FUNCTION__, type & PV_MASK, p.pl);
 		
 		/* Most parameters are bit/byte fields or little endian,
 		 * so it's ok to only extract a subset of it (the subset
@@ -265,13 +265,13 @@
 			le32_to_cpus(&p.pv.i);
 		break;
 	default:
-		WARNING(__FUNCTION__ "() length %d not supported\n", p.pl);
+		WARNING("%s() length %d not supported\n", __FUNCTION__, p.pl);
 
 		/* Skip parameter */ 
 		return p.pl+2;
 	}
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), pi=%#x, pl=%d, pi=%d\n", p.pi, p.pl, p.pv.i);
+	IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __FUNCTION__, p.pi, p.pl, p.pv.i);
 	/* Call handler for this parameter */
 	err = (*func)(self, &p, PV_PUT);
 	if (err < 0)
@@ -293,17 +293,17 @@
 	irda_param_t p;
 	int err;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	p.pi = pi;     /* In case handler needs to know */
 	p.pl = buf[1]; /* Extract lenght of value */
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), pi=%#x, pl=%d\n", p.pi, p.pl);
+	IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d\n", __FUNCTION__, p.pi, p.pl);
 
 	/* Check if buffer is long enough for parsing */
 	if (len < (2+p.pl)) {
-		WARNING(__FUNCTION__ "(), buffer to short for parsing! "
-			"Need %d bytes, but len is only %d\n", p.pl, len);
+		WARNING("%s(), buffer to short for parsing! "
+			"Need %d bytes, but len is only %d\n", __FUNCTION__, p.pl, len);
 		return -1;
 	}
 
@@ -311,7 +311,7 @@
 	 * checked that the buffer is long enough */
 	strncpy(str, buf+2, p.pl);
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), str=0x%02x 0x%02x\n", (__u8) str[0], 
+	IRDA_DEBUG(2, "%s(), str=0x%02x 0x%02x\n", __FUNCTION__, (__u8) str[0], 
 	      (__u8) str[1]);
 	
 	/* Null terminate string */
@@ -343,12 +343,12 @@
 
 	/* Check if buffer is long enough for parsing */
 	if (len < (2+p.pl)) {
-		WARNING(__FUNCTION__ "(), buffer to short for parsing! "
-			"Need %d bytes, but len is only %d\n", p.pl, len);
+		WARNING("%s(), buffer to short for parsing! "
+			"Need %d bytes, but len is only %d\n", __FUNCTION__, p.pl, len);
 		return -1;
 	}
 
-	IRDA_DEBUG(0, __FUNCTION__ "(), not impl\n");
+	IRDA_DEBUG(0, "%s(), not impl\n", __FUNCTION__);
 	
 	return p.pl+2; /* Extracted pl+2 bytes */
 }
@@ -474,8 +474,7 @@
 	if ((pi_major > info->len-1) || 
 	    (pi_minor > info->tables[pi_major].len-1))
 	{
-		IRDA_DEBUG(0, __FUNCTION__ 
-		      "(), no handler for parameter=0x%02x\n", pi);
+		IRDA_DEBUG(0, "%s(), no handler for parameter=0x%02x\n", __FUNCTION__, pi);
 		
 		/* Skip this parameter */
 		return -1;
@@ -489,7 +488,7 @@
 
 	/*  Check if handler has been implemented */
 	if (!pi_minor_info->func) {
-		MESSAGE(__FUNCTION__"(), no handler for pi=%#x\n", pi);
+		MESSAGE("%s(), no handler for pi=%#x\n", __FUNCTION__, pi);
 		/* Skip this parameter */
 		return -1;
 	}
@@ -526,7 +525,7 @@
 	if ((pi_major > info->len-1) || 
 	    (pi_minor > info->tables[pi_major].len-1))
 	{
-		IRDA_DEBUG(0, __FUNCTION__ "(), no handler for parameter=0x%02x\n",
+		IRDA_DEBUG(0, "%s(), no handler for parameter=0x%02x\n", __FUNCTION__,
 		      buf[0]);
 		
 		/* Skip this parameter */
@@ -539,12 +538,12 @@
 	/* Find expected data type for this parameter identifier (pi)*/
 	type = pi_minor_info->type;
 	
-	IRDA_DEBUG(3, __FUNCTION__ "(), pi=[%d,%d], type=%d\n",
+	IRDA_DEBUG(3, "%s(), pi=[%d,%d], type=%d\n", __FUNCTION__,
 	      pi_major, pi_minor, type);
 	
 	/*  Check if handler has been implemented */
 	if (!pi_minor_info->func) {
-		MESSAGE(__FUNCTION__"(), no handler for pi=%#x\n", buf[n]);
+		MESSAGE("%s(), no handler for pi=%#x\n", __FUNCTION__, buf[n]);
 		/* Skip this parameter */
 		return 2 + buf[n + 1]; /* Continue */
 	}
diff -urN linux-2.4.23-pre7/net/irda/qos.c linux-2.4.23-pre8/net/irda/qos.c
--- linux-2.4.23-pre7/net/irda/qos.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/qos.c	2003-10-23 03:33:19.000000000 -0700
@@ -348,7 +348,7 @@
 	__u32 line_capacity;
 	int index;
 
-	IRDA_DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	/*
 	 * Make sure the mintt is sensible.
@@ -374,8 +374,7 @@
 	if ((qos->baud_rate.value < 115200) && 
 	    (qos->max_turn_time.value < 500))
 	{
-		IRDA_DEBUG(0, __FUNCTION__ 
-			   "(), adjusting max turn time from %d to 500 ms\n",
+		IRDA_DEBUG(0, "%s(), adjusting max turn time from %d to 500 ms\n", __FUNCTION__,
 			   qos->max_turn_time.value);
 		qos->max_turn_time.value = 500;
 	}
@@ -391,8 +390,7 @@
 #ifdef CONFIG_IRDA_DYNAMIC_WINDOW
 	while ((qos->data_size.value > line_capacity) && (index > 0)) {
 		qos->data_size.value = data_sizes[index--];
-		IRDA_DEBUG(2, __FUNCTION__ 
-			   "(), reducing data size to %d\n",
+		IRDA_DEBUG(2, "%s(), reducing data size to %d\n", __FUNCTION__,
 			   qos->data_size.value);
 	}
 #else /* Use method described in section 6.6.11 of IrLAP */
@@ -402,16 +400,14 @@
 		/* Must be able to send at least one frame */
 		if (qos->window_size.value > 1) {
 			qos->window_size.value--;
-			IRDA_DEBUG(2, __FUNCTION__ 
-				   "(), reducing window size to %d\n",
+			IRDA_DEBUG(2, "%s(), reducing window size to %d\n", __FUNCTION__,
 				   qos->window_size.value);
 		} else if (index > 1) {
 			qos->data_size.value = data_sizes[index--];
-			IRDA_DEBUG(2, __FUNCTION__ 
-				   "(), reducing data size to %d\n",
+			IRDA_DEBUG(2, "%s(), reducing data size to %d\n", __FUNCTION__,
 				   qos->data_size.value);
 		} else {
-			WARNING(__FUNCTION__ "(), nothing more we can do!\n");
+			WARNING("%s(), nothing more we can do!\n", __FUNCTION__);
 		}
 	}
 #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */
@@ -545,7 +541,7 @@
 
 	if (get) {
 		param->pv.i = self->qos_rx.baud_rate.bits;
-		IRDA_DEBUG(2, __FUNCTION__ "(), baud rate = 0x%02x\n", 
+		IRDA_DEBUG(2, "%s(), baud rate = 0x%02x\n", __FUNCTION__,
 			   param->pv.i);		
 	} else {
 		/* 
@@ -718,7 +714,7 @@
 	__u32 line_capacity;
 	int i,j;
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), speed=%d, max_turn_time=%d\n",
+	IRDA_DEBUG(2, "%s(), speed=%d, max_turn_time=%d\n", __FUNCTION__,
 		   speed, max_turn_time);
 
 	i = value_index(speed, baud_rates, 10);
@@ -729,7 +725,7 @@
 
 	line_capacity = max_line_capacities[i][j];
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), line capacity=%d bytes\n", 
+	IRDA_DEBUG(2, "%s(), line capacity=%d bytes\n", __FUNCTION__,
 		   line_capacity);
 	
 	return line_capacity;
@@ -743,7 +739,7 @@
 		irlap_min_turn_time_in_bytes(qos->baud_rate.value, 
 					     qos->min_turn_time.value);
 	
-	IRDA_DEBUG(2, __FUNCTION__ "(), requested line capacity=%d\n",
+	IRDA_DEBUG(2, "%s(), requested line capacity=%d\n", __FUNCTION__,
 		   line_capacity);
 	
 	return line_capacity;			       		  
diff -urN linux-2.4.23-pre7/net/irda/wrapper.c linux-2.4.23-pre8/net/irda/wrapper.c
--- linux-2.4.23-pre7/net/irda/wrapper.c	2001-04-30 16:26:09.000000000 -0700
+++ linux-2.4.23-pre8/net/irda/wrapper.c	2003-10-23 03:33:19.000000000 -0700
@@ -93,16 +93,16 @@
 		 * Nothing to worry about, but we set the default number of 
 		 * BOF's
 		 */
-		IRDA_DEBUG(1, __FUNCTION__ "(), wrong magic in skb!\n");
+		IRDA_DEBUG(1, "%s(), wrong magic in skb!\n", __FUNCTION__);
 		xbofs = 10;
 	} else
 		xbofs = cb->xbofs + cb->xbofs_delay;
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), xbofs=%d\n", xbofs);
+	IRDA_DEBUG(4, "%s(), xbofs=%d\n", __FUNCTION__, xbofs);
 
 	/* Check that we never use more than 115 + 48 xbofs */
 	if (xbofs > 163) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), too many xbofs (%d)\n", xbofs);
+		IRDA_DEBUG(0, "%s(), too many xbofs (%d)\n", __FUNCTION__, xbofs);
 		xbofs = 163;
 	}
 
@@ -265,7 +265,7 @@
 	case EOF:
 		/* Abort frame */
 		rx_buff->state = OUTSIDE_FRAME;
-		IRDA_DEBUG(1, __FUNCTION__ "(), abort frame\n");
+		IRDA_DEBUG(1, "%s(), abort frame\n", __FUNCTION__);
 		stats->rx_errors++;
 		stats->rx_frame_errors++;
 		break;
@@ -289,13 +289,12 @@
 {
 	switch (byte) {
 	case BOF: /* New frame? */
-		IRDA_DEBUG(1, __FUNCTION__ 
-			   "(), Discarding incomplete frame\n");
+		IRDA_DEBUG(1, "%s(), Discarding incomplete frame\n", __FUNCTION__);
 		rx_buff->state = BEGIN_FRAME;
 		irda_device_set_media_busy(dev, TRUE);
 		break;
 	case CE:
-		WARNING(__FUNCTION__ "(), state not defined\n");
+		WARNING("%s(), state not defined\n", __FUNCTION__);
 		break;
 	case EOF: /* Abort frame */
 		rx_buff->state = OUTSIDE_FRAME;
@@ -311,7 +310,7 @@
 			rx_buff->fcs = irda_fcs(rx_buff->fcs, byte);
 			rx_buff->state = INSIDE_FRAME;
 		} else {
-			IRDA_DEBUG(1, __FUNCTION__ "(), rx buffer overflow\n");
+			IRDA_DEBUG(1, "%s(), rx buffer overflow\n", __FUNCTION__);
 			rx_buff->state = OUTSIDE_FRAME;
 		}
 		break;
@@ -332,8 +331,7 @@
 
 	switch (byte) {
 	case BOF: /* New frame? */
-		IRDA_DEBUG(1, __FUNCTION__ 
-			   "(), Discarding incomplete frame\n");
+		IRDA_DEBUG(1, "%s(), Discarding incomplete frame\n", __FUNCTION__);
 		rx_buff->state = BEGIN_FRAME;
 		irda_device_set_media_busy(dev, TRUE);
 		break;
@@ -354,7 +352,7 @@
 			/* Wrong CRC, discard frame!  */
 			irda_device_set_media_busy(dev, TRUE); 
 
-			IRDA_DEBUG(1, __FUNCTION__ "(), crc error\n");
+			IRDA_DEBUG(1, "%s(), crc error\n", __FUNCTION__);
 			stats->rx_errors++;
 			stats->rx_crc_errors++;
 		}			
@@ -364,8 +362,7 @@
 			rx_buff->data[rx_buff->len++] = byte;
 			rx_buff->fcs = irda_fcs(rx_buff->fcs, byte);
 		} else {
-			IRDA_DEBUG(1, __FUNCTION__ 
-			      "(), Rx buffer overflow, aborting\n");
+			IRDA_DEBUG(1, "%s(), Rx buffer overflow, aborting\n", __FUNCTION__);
 			rx_buff->state = OUTSIDE_FRAME;
 		}
 		break;
diff -urN linux-2.4.23-pre7/net/sunrpc/clnt.c linux-2.4.23-pre8/net/sunrpc/clnt.c
--- linux-2.4.23-pre7/net/sunrpc/clnt.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/sunrpc/clnt.c	2003-10-23 03:33:19.000000000 -0700
@@ -921,6 +921,24 @@
 	switch ((n = ntohl(*p++))) {
 	case RPC_SUCCESS:
 		return p;
+	case RPC_PROG_UNAVAIL:
+		printk(KERN_WARNING "RPC: call_verify: program %u is unsupported by server %s\n",
+				(unsigned int)task->tk_client->cl_prog,
+				task->tk_client->cl_server);
+		goto out_eio;
+	case RPC_PROG_MISMATCH:
+		printk(KERN_WARNING "RPC: call_verify: program %u, version %u unsupported by server %s\n",
+				(unsigned int)task->tk_client->cl_prog,
+				(unsigned int)task->tk_client->cl_vers,
+				task->tk_client->cl_server);
+		goto out_eio;
+	case RPC_PROC_UNAVAIL:
+		printk(KERN_WARNING "RPC: call_verify: proc %u unsupported by program %u, version %u on server %s\n",
+				(unsigned int)task->tk_msg.rpc_proc,
+				(unsigned int)task->tk_client->cl_prog,
+				(unsigned int)task->tk_client->cl_vers,
+				task->tk_client->cl_server);
+		goto out_eio;
 	case RPC_GARBAGE_ARGS:
 		break;			/* retry */
 	default:
@@ -938,6 +956,7 @@
 		return NULL;
 	}
 	printk(KERN_WARNING "RPC: garbage, exit EIO\n");
+out_eio:
 	rpc_exit(task, -EIO);
 	return NULL;
 }
diff -urN linux-2.4.23-pre7/net/sunrpc/timer.c linux-2.4.23-pre8/net/sunrpc/timer.c
--- linux-2.4.23-pre7/net/sunrpc/timer.c	2002-11-28 15:53:16.000000000 -0800
+++ linux-2.4.23-pre8/net/sunrpc/timer.c	2003-10-23 03:33:19.000000000 -0700
@@ -8,7 +8,7 @@
 
 #define RPC_RTO_MAX (60*HZ)
 #define RPC_RTO_INIT (HZ/5)
-#define RPC_RTO_MIN (2)
+#define RPC_RTO_MIN (HZ/10)
 
 void
 rpc_init_rtt(struct rpc_rtt *rt, long timeo)
@@ -22,7 +22,7 @@
 		rt->srtt[i] = t;
 		rt->sdrtt[i] = RPC_RTO_INIT;
 	}
-	atomic_set(&rt->ntimeouts, 0);
+	memset(rt->ntimeouts, 0, sizeof(rt->ntimeouts));
 }
 
 void
diff -urN linux-2.4.23-pre7/net/sunrpc/xprt.c linux-2.4.23-pre8/net/sunrpc/xprt.c
--- linux-2.4.23-pre7/net/sunrpc/xprt.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre8/net/sunrpc/xprt.c	2003-10-23 03:33:19.000000000 -0700
@@ -138,18 +138,21 @@
 static int
 __xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
 {
+	struct rpc_rqst *req = task->tk_rqstp;
 	if (!xprt->snd_task) {
 		if (xprt->nocong || __xprt_get_cong(xprt, task)) {
 			xprt->snd_task = task;
-			if (task->tk_rqstp)
-				task->tk_rqstp->rq_bytes_sent = 0;
+			if (req) {
+				req->rq_bytes_sent = 0;
+				req->rq_ntrans++;
+			}
 		}
 	}
 	if (xprt->snd_task != task) {
 		dprintk("RPC: %4d TCP write queue full\n", task->tk_pid);
 		task->tk_timeout = 0;
 		task->tk_status = -EAGAIN;
-		if (task->tk_rqstp && task->tk_rqstp->rq_nresend)
+		if (req && req->rq_ntrans)
 			rpc_sleep_on(&xprt->resend, task, NULL, NULL);
 		else
 			rpc_sleep_on(&xprt->sending, task, NULL, NULL);
@@ -183,9 +186,12 @@
 			return;
 	}
 	if (xprt->nocong || __xprt_get_cong(xprt, task)) {
+		struct rpc_rqst *req = task->tk_rqstp;
 		xprt->snd_task = task;
-		if (task->tk_rqstp)
-			task->tk_rqstp->rq_bytes_sent = 0;
+		if (req) {
+			req->rq_bytes_sent = 0;
+			req->rq_ntrans++;
+		}
 	}
 }
 
@@ -590,14 +596,14 @@
 
 	/* Adjust congestion window */
 	if (!xprt->nocong) {
+		int timer = rpcproc_timer(clnt, task->tk_msg.rpc_proc);
 		xprt_adjust_cwnd(xprt, copied);
 		__xprt_put_cong(xprt, req);
-	       	if (!req->rq_nresend) {
-			int timer = rpcproc_timer(clnt, task->tk_msg.rpc_proc);
+	       	if (req->rq_ntrans == 1) {
 			if (timer)
 				rpc_update_rtt(&clnt->cl_rtt, timer, (long)jiffies - req->rq_xtime);
 		}
-		rpc_clear_timeo(&clnt->cl_rtt);
+		rpc_set_timeo(&clnt->cl_rtt, timer, req->rq_ntrans - 1);
 	}
 
 #ifdef RPC_PROFILE
@@ -1063,7 +1069,7 @@
 		goto out;
 
 	xprt_adjust_cwnd(req->rq_xprt, -ETIMEDOUT);
-	req->rq_nresend++;
+	__xprt_put_cong(xprt, req);
 
 	dprintk("RPC: %4d xprt_timer (%s request)\n",
 		task->tk_pid, req ? "pending" : "backlogged");
@@ -1217,8 +1223,9 @@
 	spin_lock_bh(&xprt->sock_lock);
 	/* Set the task's receive timeout value */
 	if (!xprt->nocong) {
-		task->tk_timeout = rpc_calc_rto(&clnt->cl_rtt,
-				rpcproc_timer(clnt, task->tk_msg.rpc_proc));
+		int timer = rpcproc_timer(clnt, task->tk_msg.rpc_proc);
+		task->tk_timeout = rpc_calc_rto(&clnt->cl_rtt, timer);
+		task->tk_timeout <<= rpc_ntimeo(&clnt->cl_rtt, timer);
 		task->tk_timeout <<= clnt->cl_timeout.to_retries
 			- req->rq_timeout.to_retries;
 		if (task->tk_timeout > req->rq_timeout.to_maxval)
