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

diff -urN linux-2.5.72-bk3/Makefile linux-2.5.72-bk4/Makefile
--- linux-2.5.72-bk3/Makefile	2003-06-23 04:46:23.000000000 -0700
+++ linux-2.5.72-bk4/Makefile	2003-06-23 04:46:27.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 5
 SUBLEVEL = 72
-EXTRAVERSION = -bk3
+EXTRAVERSION = -bk4
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
diff -urN linux-2.5.72-bk3/arch/i386/kernel/acpi/Makefile linux-2.5.72-bk4/arch/i386/kernel/acpi/Makefile
--- linux-2.5.72-bk3/arch/i386/kernel/acpi/Makefile	2003-06-16 21:20:01.000000000 -0700
+++ linux-2.5.72-bk4/arch/i386/kernel/acpi/Makefile	2003-06-23 04:46:27.000000000 -0700
@@ -1,3 +1,4 @@
+obj-$(CONFIG_ACPI_HT_ONLY)	:= acpitable.o
 obj-$(CONFIG_ACPI_BOOT)		:= boot.o
 obj-$(CONFIG_ACPI_SLEEP)	+= sleep.o wakeup.o
 
diff -urN linux-2.5.72-bk3/arch/i386/kernel/acpi/acpitable.c linux-2.5.72-bk4/arch/i386/kernel/acpi/acpitable.c
--- linux-2.5.72-bk3/arch/i386/kernel/acpi/acpitable.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.72-bk4/arch/i386/kernel/acpi/acpitable.c	2003-06-23 04:46:27.000000000 -0700
@@ -0,0 +1,553 @@
+/*
+ *  acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1)
+ *
+ *  Copyright (C) 1999 Andrew Henroid
+ *  Copyright (C) 2001 Richard Schaal
+ *  Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
+ *  Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
+ *  Copyright (C) 2001 Arjan van de Ven <arjanv@redhat.com>
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * $Id: acpitable.c,v 1.7 2001/11/04 12:21:18 fenrus Exp $
+ */
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/stddef.h>
+#include <linux/slab.h>
+#include <linux/pci.h>
+#include <asm/mpspec.h>
+#include <asm/io.h>
+#include <asm/apic.h>
+#include <asm/apicdef.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+
+#include "acpitable.h"
+
+static acpi_table_handler acpi_boot_ops[ACPI_TABLE_COUNT];
+
+int acpi_lapic;
+
+static unsigned char __init
+acpi_checksum(void *buffer, int length)
+{
+	int i;
+	unsigned char *bytebuffer;
+	unsigned char sum = 0;
+
+	if (!buffer || length <= 0)
+		return 0;
+
+	bytebuffer = (unsigned char *) buffer;
+
+	for (i = 0; i < length; i++)
+		sum += *(bytebuffer++);
+
+	return sum;
+}
+
+static void __init
+acpi_print_table_header(acpi_table_header * header)
+{
+	if (!header)
+		return;
+
+	printk(KERN_INFO "ACPI table found: %.4s v%d [%.6s %.8s %d.%d]\n",
+	       header->signature, header->revision, header->oem_id,
+	       header->oem_table_id, header->oem_revision >> 16,
+	       header->oem_revision & 0xffff);
+
+	return;
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_tb_scan_memory_for_rsdp
+ *
+ * PARAMETERS:  address       - Starting pointer for search
+ *              length        - Maximum length to search
+ *
+ * RETURN:      Pointer to the RSDP if found and valid, otherwise NULL.
+ *
+ * DESCRIPTION: Search a block of memory for the RSDP signature
+ *
+ ******************************************************************************/
+
+static void *__init
+acpi_tb_scan_memory_for_rsdp(void *address, int length)
+{
+	u32 offset;
+
+	if (length <= 0)
+		return NULL;
+
+	/* Search from given start addr for the requested length  */
+
+	offset = 0;
+
+	while (offset < length) {
+		/* The signature must match and the checksum must be correct */
+		if (strncmp(address, RSDP_SIG, sizeof(RSDP_SIG) - 1) == 0 &&
+		    acpi_checksum(address, RSDP_CHECKSUM_LENGTH) == 0) {
+			/* If so, we have found the RSDP */
+			printk(KERN_INFO "ACPI: RSDP located at physical address %p\n",
+			       address);
+			return address;
+		}
+		offset += RSDP_SCAN_STEP;
+		address += RSDP_SCAN_STEP;
+	}
+
+	/* Searched entire block, no RSDP was found */
+	printk(KERN_INFO "ACPI: Searched entire block, no RSDP was found.\n");
+	return NULL;
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_find_root_pointer
+ *
+ * PARAMETERS:  none
+ *
+ * RETURN:      physical address of the RSDP 
+ *
+ * DESCRIPTION: Search lower 1_mbyte of memory for the root system descriptor
+ *              pointer structure.  If it is found, set *RSDP to point to it.
+ *
+ *              NOTE: The RSDP must be either in the first 1_k of the Extended
+ *              BIOS Data Area or between E0000 and FFFFF (ACPI 1.0 section
+ *              5.2.2; assertion #421).
+ *
+ ******************************************************************************/
+
+static struct acpi_table_rsdp * __init
+acpi_find_root_pointer(void)
+{
+	struct acpi_table_rsdp * rsdp;
+
+	/*
+	 * Physical address is given
+	 */
+	/*
+	 * Region 1) Search EBDA (low memory) paragraphs
+	 */
+	rsdp = acpi_tb_scan_memory_for_rsdp(__va(LO_RSDP_WINDOW_BASE),
+					 LO_RSDP_WINDOW_SIZE);
+
+	if (rsdp)
+		return rsdp;
+
+	/*
+	 * Region 2) Search upper memory: 16-byte boundaries in E0000h-F0000h
+	 */
+	rsdp = acpi_tb_scan_memory_for_rsdp(__va(HI_RSDP_WINDOW_BASE),
+					       HI_RSDP_WINDOW_SIZE);
+
+	
+					     
+	if (rsdp)
+		return rsdp;
+
+	printk(KERN_ERR "ACPI: System description tables not found\n");
+	return NULL;
+}
+
+
+/*
+ * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END,
+ * to map the target physical address. The problem is that set_fixmap()
+ * provides a single page, and it is possible that the page is not
+ * sufficient.
+ * By using this area, we can map up to MAX_IO_APICS pages temporarily,
+ * i.e. until the next __va_range() call.
+ *
+ * Important Safety Note:  The fixed I/O APIC page numbers are *subtracted*
+ * from the fixed base.  That's why we start at FIX_IO_APIC_BASE_END and
+ * count idx down while incrementing the phys address.
+ */
+static __init char *
+__va_range(unsigned long phys, unsigned long size)
+{
+	unsigned long base, offset, mapped_size;
+	int idx;
+
+	offset = phys & (PAGE_SIZE - 1);
+	mapped_size = PAGE_SIZE - offset;
+	set_fixmap(FIX_IO_APIC_BASE_END, phys);
+	base = fix_to_virt(FIX_IO_APIC_BASE_END);
+	dprintk("__va_range(0x%lx, 0x%lx): idx=%d mapped at %lx\n", phys, size,
+		FIX_IO_APIC_BASE_END, base);
+
+	/*
+	 * Most cases can be covered by the below.
+	 */
+	idx = FIX_IO_APIC_BASE_END;
+	while (mapped_size < size) {
+		if (--idx < FIX_IO_APIC_BASE_0)
+			return 0;	/* cannot handle this */
+		phys += PAGE_SIZE;
+		set_fixmap(idx, phys);
+		mapped_size += PAGE_SIZE;
+	}
+
+	return ((unsigned char *) base + offset);
+}
+
+static int __init acpi_tables_init(void)
+{
+	int result = -ENODEV;
+	acpi_table_header *header = NULL;
+	struct acpi_table_rsdp *rsdp = NULL;
+	struct acpi_table_rsdt *rsdt = NULL;
+	struct acpi_table_rsdt saved_rsdt;
+	int tables = 0;
+	int type = 0;
+	int i = 0;
+
+
+	rsdp = (struct acpi_table_rsdp *) acpi_find_root_pointer();
+
+	if (!rsdp)
+		return -ENODEV;
+		
+	printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision,
+	       rsdp->oem_id);
+	       
+	if (strncmp(rsdp->signature, RSDP_SIG,strlen(RSDP_SIG))) {
+		printk(KERN_WARNING "RSDP table signature incorrect\n");
+		return -EINVAL;
+	}
+
+	rsdt = (struct acpi_table_rsdt *)
+	    __va_range(rsdp->rsdt_address, sizeof(struct acpi_table_rsdt));
+
+	if (!rsdt) {
+		printk(KERN_WARNING "ACPI: Invalid root system description tables (RSDT)\n");
+		return -ENODEV;
+	}
+	
+	header = & rsdt->header;
+	acpi_print_table_header(header);
+	
+	if (strncmp(header->signature, RSDT_SIG, strlen(RSDT_SIG))) {
+		printk(KERN_WARNING "ACPI: RSDT signature incorrect\n");
+		return -ENODEV;
+	}
+		
+	/* 
+	 * The number of tables is computed by taking the 
+	 * size of all entries (header size minus total 
+	 * size of RSDT) divided by the size of each entry
+	 * (4-byte table pointers).
+	 */
+	tables = (header->length - sizeof(acpi_table_header)) / 4;
+		    
+	memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt));
+
+	if (saved_rsdt.header.length > sizeof(saved_rsdt)) {
+		printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n", saved_rsdt.header.length);
+		return -ENODEV;
+	}
+
+	for (i = 0; i < tables; i++) {
+		/* Map in header, then map in full table length. */
+		header = (acpi_table_header *)
+			    __va_range(saved_rsdt.entry[i],
+				       sizeof(acpi_table_header));
+		if (!header)
+			break;
+		header = (acpi_table_header *)
+			    __va_range(saved_rsdt.entry[i], header->length);
+		if (!header)
+			break;
+
+		acpi_print_table_header(header);
+		
+		if (acpi_checksum(header,header->length)) {
+			printk(KERN_WARNING "ACPI %s has invalid checksum\n", 
+				acpi_table_signatures[i]);
+			continue;
+		}
+		
+		for (type = 0; type < ACPI_TABLE_COUNT; type++)
+			if (!strncmp((char *) &header->signature,
+			     acpi_table_signatures[type],strlen(acpi_table_signatures[type])))
+				break;
+
+		if (type >= ACPI_TABLE_COUNT) {
+			printk(KERN_WARNING "ACPI: Unsupported table %.4s\n",
+			       header->signature);
+			continue;
+		}
+
+
+		if (!acpi_boot_ops[type])
+			continue;
+			
+		result = acpi_boot_ops[type] (header,
+						 (unsigned long) saved_rsdt.
+						 entry[i]);
+	}
+
+	return result;
+}
+
+static int total_cpus __initdata = 0;
+int have_acpi_tables;
+
+extern void __init MP_processor_info(struct mpc_config_processor *);
+
+static void __init
+acpi_parse_lapic(struct acpi_table_lapic *local_apic)
+{
+	struct mpc_config_processor proc_entry;
+	int ix = 0;
+
+	if (!local_apic)
+		return;
+
+	printk(KERN_INFO "LAPIC (acpi_id[0x%04x] id[0x%x] enabled[%d])\n",
+		local_apic->acpi_id, local_apic->id, local_apic->flags.enabled);
+
+	printk(KERN_INFO "CPU %d (0x%02x00)", total_cpus, local_apic->id);
+
+	if (local_apic->flags.enabled) {
+		printk(" enabled");
+		ix = local_apic->id;
+		if (ix >= MAX_APICS) {
+			printk(KERN_WARNING
+			       "Processor #%d INVALID - (Max ID: %d).\n", ix,
+			       MAX_APICS);
+			return;
+		}
+		/* 
+		 * Fill in the info we want to save.  Not concerned about 
+		 * the processor ID.  Processor features aren't present in 
+		 * the table.
+		 */
+		proc_entry.mpc_type = MP_PROCESSOR;
+		proc_entry.mpc_apicid = local_apic->id;
+		proc_entry.mpc_cpuflag = CPU_ENABLED;
+		if (proc_entry.mpc_apicid == boot_cpu_physical_apicid) {
+			printk(" (BSP)");
+			proc_entry.mpc_cpuflag |= CPU_BOOTPROCESSOR;
+		}
+		proc_entry.mpc_cpufeature =
+		    (boot_cpu_data.x86 << 8) | 
+		    (boot_cpu_data.x86_model << 4) | 
+		     boot_cpu_data.x86_mask;
+		proc_entry.mpc_featureflag = boot_cpu_data.x86_capability[0];
+		proc_entry.mpc_reserved[0] = 0;
+		proc_entry.mpc_reserved[1] = 0;
+		proc_entry.mpc_apicver = 0x10;	/* integrated APIC */
+		MP_processor_info(&proc_entry);
+	} else {
+		printk(" disabled");
+	}
+	printk("\n");
+
+	total_cpus++;
+	return;
+}
+
+static void __init
+acpi_parse_ioapic(struct acpi_table_ioapic *ioapic)
+{
+
+	if (!ioapic)
+		return;
+
+	printk(KERN_INFO
+	       "IOAPIC (id[0x%x] address[0x%x] global_irq_base[0x%x])\n",
+	       ioapic->id, ioapic->address, ioapic->global_irq_base);
+
+	if (nr_ioapics >= MAX_IO_APICS) {
+		printk(KERN_WARNING
+		       "Max # of I/O APICs (%d) exceeded (found %d).\n",
+		       MAX_IO_APICS, nr_ioapics);
+/*		panic("Recompile kernel with bigger MAX_IO_APICS!\n");   */
+	}
+}
+
+
+/* Interrupt source overrides inform the machine about exceptions
+   to the normal "PIC" mode interrupt routing */
+   
+static void __init
+acpi_parse_int_src_ovr(struct acpi_table_int_src_ovr *intsrc)
+{
+	if (!intsrc)
+		return;
+
+	printk(KERN_INFO
+	       "INT_SRC_OVR (bus[%d] irq[0x%x] global_irq[0x%x] polarity[0x%x] trigger[0x%x])\n",
+	       intsrc->bus, intsrc->bus_irq, intsrc->global_irq,
+	       intsrc->flags.polarity, intsrc->flags.trigger);
+}
+
+/*
+ * At this point, we look at the interrupt assignment entries in the MPS
+ * table.
+ */ 
+ 
+static void __init acpi_parse_nmi_src(struct acpi_table_nmi_src *nmisrc)
+{
+	if (!nmisrc)
+		return;
+
+	printk(KERN_INFO
+	       "NMI_SRC (polarity[0x%x] trigger[0x%x] global_irq[0x%x])\n",
+	       nmisrc->flags.polarity, nmisrc->flags.trigger,
+	       nmisrc->global_irq);
+
+}
+static void __init
+acpi_parse_lapic_nmi(struct acpi_table_lapic_nmi *localnmi)
+{
+	if (!localnmi)
+		return;
+
+	printk(KERN_INFO
+	       "LAPIC_NMI (acpi_id[0x%04x] polarity[0x%x] trigger[0x%x] lint[0x%x])\n",
+	       localnmi->acpi_id, localnmi->flags.polarity,
+	       localnmi->flags.trigger, localnmi->lint);
+}
+static void __init
+acpi_parse_lapic_addr_ovr(struct acpi_table_lapic_addr_ovr *lapic_addr_ovr)
+{
+	if (!lapic_addr_ovr)
+		return;
+
+	printk(KERN_INFO "LAPIC_ADDR_OVR (address[0x%lx])\n",
+	       (unsigned long) lapic_addr_ovr->address);
+
+}
+
+static void __init
+acpi_parse_plat_int_src(struct acpi_table_plat_int_src *plintsrc)
+{
+	if (!plintsrc)
+		return;
+
+	printk(KERN_INFO
+	       "PLAT_INT_SRC (polarity[0x%x] trigger[0x%x] type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
+	       plintsrc->flags.polarity, plintsrc->flags.trigger,
+	       plintsrc->type, plintsrc->id, plintsrc->eid,
+	       plintsrc->iosapic_vector, plintsrc->global_irq);
+}
+static int __init
+acpi_parse_madt(acpi_table_header * header, unsigned long phys)
+{
+
+	struct acpi_table_madt *madt;	    
+	acpi_madt_entry_header *entry_header;
+	int table_size;
+	
+	madt = (struct acpi_table_madt *) __va_range(phys, header->length);
+
+	if (!madt)
+		return -EINVAL;
+
+	table_size = (int) (header->length - sizeof(*madt));
+	entry_header =
+	    (acpi_madt_entry_header *) ((void *) madt + sizeof(*madt));
+
+	while (entry_header && (table_size > 0)) {
+		switch (entry_header->type) {
+		case ACPI_MADT_LAPIC:
+			acpi_parse_lapic((struct acpi_table_lapic *)
+					 entry_header);
+			break;
+		case ACPI_MADT_IOAPIC:
+			acpi_parse_ioapic((struct acpi_table_ioapic *)
+					  entry_header);
+			break;
+		case ACPI_MADT_INT_SRC_OVR:
+			acpi_parse_int_src_ovr((struct acpi_table_int_src_ovr *)
+					       entry_header);
+			break;
+		case ACPI_MADT_NMI_SRC:
+			acpi_parse_nmi_src((struct acpi_table_nmi_src *)
+					   entry_header);
+			break;
+		case ACPI_MADT_LAPIC_NMI:
+			acpi_parse_lapic_nmi((struct acpi_table_lapic_nmi *)
+					     entry_header);
+			break;
+		case ACPI_MADT_LAPIC_ADDR_OVR:
+			acpi_parse_lapic_addr_ovr((struct
+						   acpi_table_lapic_addr_ovr *)
+						  entry_header);
+			break;
+		case ACPI_MADT_PLAT_INT_SRC:
+			acpi_parse_plat_int_src((struct acpi_table_plat_int_src
+						 *) entry_header);
+			break;
+		default:
+			printk(KERN_WARNING
+			       "Unsupported MADT entry type 0x%x\n",
+			       entry_header->type);
+			break;
+		}
+		table_size -= entry_header->length;
+		entry_header =
+		    (acpi_madt_entry_header *) ((void *) entry_header +
+						entry_header->length);
+	}
+
+	if (!total_cpus) {
+		printk("ACPI: No Processors found in the APCI table.\n");
+		return -EINVAL;
+	}
+
+	printk(KERN_INFO "%d CPUs total\n", total_cpus);
+
+	if (madt->lapic_address)
+		mp_lapic_addr = madt->lapic_address;
+	else
+		mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
+
+	printk(KERN_INFO "Local APIC address %x\n", madt->lapic_address);
+
+	return 0;
+}
+
+
+/*
+ * Configure the processor info using MADT in the ACPI tables. If we fail to
+ * configure that, then we use the MPS tables.
+ */
+void __init
+acpi_boot_init(void)
+{
+
+	memset(&acpi_boot_ops, 0, sizeof(acpi_boot_ops));
+	acpi_boot_ops[ACPI_APIC] = acpi_parse_madt;
+
+	/*
+	 * Only do this when requested, either because of CPU/Bios type or from the command line
+	 */
+
+	if (!acpi_tables_init())
+		acpi_lapic = 1;
+}
+
diff -urN linux-2.5.72-bk3/arch/i386/kernel/acpi/acpitable.h linux-2.5.72-bk4/arch/i386/kernel/acpi/acpitable.h
--- linux-2.5.72-bk3/arch/i386/kernel/acpi/acpitable.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.72-bk4/arch/i386/kernel/acpi/acpitable.h	2003-06-23 04:46:27.000000000 -0700
@@ -0,0 +1,260 @@
+/*
+ *  acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1)
+ *
+ *  Copyright (C) 1999 Andrew Henroid
+ *  Copyright (C) 2001 Richard Schaal
+ *  Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
+ *  Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
+ *  Copyright (C) 2001 Arjan van de Ven <arjanv@redhat.com>
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * $Id: acpitable.h,v 1.3 2001/11/03 22:41:34 fenrus Exp $
+ */
+
+/*
+ * The following codes are cut&pasted from drivers/acpi. Part of the code
+ * there can be not updated or delivered yet.
+ * To avoid conflicts when CONFIG_ACPI is defined, the following codes are
+ * modified so that they are self-contained in this file.
+ * -- jun
+ */
+ 
+#ifndef _HEADER_ACPITABLE_H_
+#define _HEADER_ACPITABLE_H_
+
+#define dprintk printk
+typedef unsigned int ACPI_TBLPTR;
+
+typedef struct {		/* ACPI common table header */
+	char signature[4];	/* identifies type of table */
+	u32 length;		/* length of table,
+				   in bytes, * including header */
+	u8 revision;		/* 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 */
+} acpi_table_header __attribute__ ((packed));;
+
+enum {
+	ACPI_APIC = 0,
+	ACPI_BOOT,
+	ACPI_DBGP,
+	ACPI_DSDT,
+	ACPI_ECDT,
+	ACPI_ETDT,
+	ACPI_FACP,
+	ACPI_FACS,
+	ACPI_OEMX,
+	ACPI_PSDT,
+	ACPI_SBST,
+	ACPI_SLIT,
+	ACPI_SPCR,
+	ACPI_SRAT,
+	ACPI_SSDT,
+	ACPI_SPMI,
+	ACPI_XSDT,
+	ACPI_TABLE_COUNT
+};
+
+static char *acpi_table_signatures[ACPI_TABLE_COUNT] = {
+	"APIC",
+	"BOOT",
+	"DBGP",
+	"DSDT",
+	"ECDT",
+	"ETDT",
+	"FACP",
+	"FACS",
+	"OEM",
+	"PSDT",
+	"SBST",
+	"SLIT",
+	"SPCR",
+	"SRAT",
+	"SSDT",
+	"SPMI",
+	"XSDT"
+};
+
+struct acpi_table_madt {
+	acpi_table_header header;
+	u32 lapic_address;
+	struct {
+		u32 pcat_compat:1;
+		u32 reserved:31;
+	} flags __attribute__ ((packed));
+} __attribute__ ((packed));;
+
+enum {
+	ACPI_MADT_LAPIC = 0,
+	ACPI_MADT_IOAPIC,
+	ACPI_MADT_INT_SRC_OVR,
+	ACPI_MADT_NMI_SRC,
+	ACPI_MADT_LAPIC_NMI,
+	ACPI_MADT_LAPIC_ADDR_OVR,
+	ACPI_MADT_IOSAPIC,
+	ACPI_MADT_LSAPIC,
+	ACPI_MADT_PLAT_INT_SRC,
+	ACPI_MADT_ENTRY_COUNT
+};
+
+#define RSDP_SIG			"RSD PTR "
+#define RSDT_SIG 			"RSDT"
+
+#define ACPI_DEBUG_PRINT(pl)
+
+#define ACPI_MEMORY_MODE                0x01
+#define ACPI_LOGICAL_ADDRESSING         0x00
+#define ACPI_PHYSICAL_ADDRESSING        0x01
+
+#define LO_RSDP_WINDOW_BASE         	0	/* Physical Address */
+#define HI_RSDP_WINDOW_BASE         	0xE0000	/* Physical Address */
+#define LO_RSDP_WINDOW_SIZE         	0x400
+#define HI_RSDP_WINDOW_SIZE         	0x20000
+#define RSDP_SCAN_STEP			16
+#define RSDP_CHECKSUM_LENGTH		20
+
+typedef int (*acpi_table_handler) (acpi_table_header * header, unsigned long);
+
+struct acpi_table_rsdp {
+	char signature[8];
+	u8 checksum;
+	char oem_id[6];
+	u8 revision;
+	u32 rsdt_address;
+} __attribute__ ((packed));
+
+struct acpi_table_rsdt {
+	acpi_table_header header;
+	u32 entry[ACPI_TABLE_COUNT];
+} __attribute__ ((packed));
+
+typedef struct {
+	u8 type;
+	u8 length;
+} acpi_madt_entry_header __attribute__ ((packed));
+
+typedef struct {
+	u16 polarity:2;
+	u16 trigger:2;
+	u16 reserved:12;
+} acpi_madt_int_flags __attribute__ ((packed));
+
+struct acpi_table_lapic {
+	acpi_madt_entry_header header;
+	u8 acpi_id;
+	u8 id;
+	struct {
+		u32 enabled:1;
+		u32 reserved:31;
+	} flags __attribute__ ((packed));
+} __attribute__ ((packed));
+
+struct acpi_table_ioapic {
+	acpi_madt_entry_header header;
+	u8 id;
+	u8 reserved;
+	u32 address;
+	u32 global_irq_base;
+} __attribute__ ((packed));
+
+struct acpi_table_int_src_ovr {
+	acpi_madt_entry_header header;
+	u8 bus;
+	u8 bus_irq;
+	u32 global_irq;
+	acpi_madt_int_flags flags;
+} __attribute__ ((packed));
+
+struct acpi_table_nmi_src {
+	acpi_madt_entry_header header;
+	acpi_madt_int_flags flags;
+	u32 global_irq;
+} __attribute__ ((packed));
+
+struct acpi_table_lapic_nmi {
+	acpi_madt_entry_header header;
+	u8 acpi_id;
+	acpi_madt_int_flags flags;
+	u8 lint;
+} __attribute__ ((packed));
+
+struct acpi_table_lapic_addr_ovr {
+	acpi_madt_entry_header header;
+	u8 reserved[2];
+	u64 address;
+} __attribute__ ((packed));
+
+struct acpi_table_iosapic {
+	acpi_madt_entry_header header;
+	u8 id;
+	u8 reserved;
+	u32 global_irq_base;
+	u64 address;
+} __attribute__ ((packed));
+
+struct acpi_table_lsapic {
+	acpi_madt_entry_header header;
+	u8 acpi_id;
+	u8 id;
+	u8 eid;
+	u8 reserved[3];
+	struct {
+		u32 enabled:1;
+		u32 reserved:31;
+	} flags;
+} __attribute__ ((packed));
+
+struct acpi_table_plat_int_src {
+	acpi_madt_entry_header header;
+	acpi_madt_int_flags flags;
+	u8 type;
+	u8 id;
+	u8 eid;
+	u8 iosapic_vector;
+	u32 global_irq;
+	u32 reserved;
+} __attribute__ ((packed));
+
+/*
+ * ACPI Table Descriptor.  One per ACPI table
+ */
+typedef struct acpi_table_desc {
+	struct acpi_table_desc *prev;
+	struct acpi_table_desc *next;
+	struct acpi_table_desc *installed_desc;
+	acpi_table_header *pointer;
+	void *base_pointer;
+	u8 *aml_pointer;
+	u64 physical_address;
+	u32 aml_length;
+	u32 length;
+	u32 count;
+	u16 table_id;
+	u8 type;
+	u8 allocation;
+	u8 loaded_into_namespace;
+
+} acpi_table_desc __attribute__ ((packed));;
+
+#endif
diff -urN linux-2.5.72-bk3/arch/i386/kernel/setup.c linux-2.5.72-bk4/arch/i386/kernel/setup.c
--- linux-2.5.72-bk3/arch/i386/kernel/setup.c	2003-06-23 04:46:23.000000000 -0700
+++ linux-2.5.72-bk4/arch/i386/kernel/setup.c	2003-06-23 04:46:27.000000000 -0700
@@ -61,7 +61,12 @@
 unsigned long mmu_cr4_features;
 EXPORT_SYMBOL_GPL(mmu_cr4_features);
 
-int acpi_disabled __initdata = 0;
+#ifdef CONFIG_ACPI_HT_ONLY
+int acpi_disabled = 1;
+#else
+int acpi_disabled = 0;
+#endif
+EXPORT_SYMBOL(acpi_disabled);
 
 int MCA_bus;
 /* for MCA, but anyone else can use it if they want */
@@ -514,6 +519,10 @@
 		if (c == ' ' && !memcmp(from, "acpi=off", 8))
 			acpi_disabled = 1;
 
+		/* "acpismp=force" turns on ACPI again */
+		else if (!memcmp(from, "acpismp=force", 14))
+			acpi_disabled = 0;
+
 		/*
 		 * highmem=size forces highmem to be exactly 'size' bytes.
 		 * This works even on boxes that have no highmem otherwise.
diff -urN linux-2.5.72-bk3/arch/sparc64/defconfig linux-2.5.72-bk4/arch/sparc64/defconfig
--- linux-2.5.72-bk3/arch/sparc64/defconfig	2003-06-16 21:19:47.000000000 -0700
+++ linux-2.5.72-bk4/arch/sparc64/defconfig	2003-06-23 04:46:28.000000000 -0700
@@ -90,6 +90,11 @@
 CONFIG_WATCHDOG_RIO=m
 
 #
+# Generic Driver Options
+#
+CONFIG_FW_LOADER=m
+
+#
 # Graphics support
 #
 CONFIG_FB=y
@@ -266,39 +271,72 @@
 CONFIG_SCSI=y
 
 #
-# SCSI support type (disk, tape, CDrom)
+# SCSI support type (disk, tape, CD-ROM)
 #
 CONFIG_BLK_DEV_SD=y
-CONFIG_SD_EXTRA_DEVS=40
 CONFIG_CHR_DEV_ST=m
 CONFIG_CHR_DEV_OSST=m
 CONFIG_BLK_DEV_SR=m
 CONFIG_BLK_DEV_SR_VENDOR=y
-CONFIG_SR_EXTRA_DEVS=2
 CONFIG_CHR_DEV_SG=m
 
 #
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_REPORT_LUNS=y
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
 #
 # SCSI low-level drivers
 #
-CONFIG_SCSI_SUNESP=y
-CONFIG_SCSI_QLOGICPTI=m
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+# CONFIG_AIC79XX_BUILD_FIRMWARE is not set
+# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
+# CONFIG_AIC79XX_DEBUG_ENABLE is not set
+CONFIG_AIC79XX_DEBUG_MASK=0
+# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_CPQFCTS is not set
+CONFIG_SCSI_DMX3191D=m
+# CONFIG_SCSI_EATA is not set
+CONFIG_SCSI_EATA_PIO=m
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_INITIO is not set
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_PPA=m
+CONFIG_SCSI_IMM=m
+# CONFIG_SCSI_IZIP_EPP16 is not set
+# CONFIG_SCSI_IZIP_SLOW_CTR is not set
 CONFIG_SCSI_SYM53C8XX_2=y
 CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_PCI2000 is not set
+# CONFIG_SCSI_PCI2220I is not set
 CONFIG_SCSI_QLOGIC_ISP=m
 CONFIG_SCSI_QLOGIC_FC=y
 CONFIG_SCSI_QLOGIC_FC_FIRMWARE=y
+# CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLOGICPTI=m
+CONFIG_SCSI_DC395x=m
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+CONFIG_SCSI_DEBUG=m
+CONFIG_SCSI_SUNESP=y
 
 #
 # Fibre Channel support
@@ -966,17 +1004,19 @@
 #
 # Miscellaneous filesystems
 #
-# CONFIG_ADFS_FS is not set
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
 CONFIG_AFFS_FS=m
-# CONFIG_HFS_FS is not set
+CONFIG_HFS_FS=m
 CONFIG_BEFS_FS=m
 # CONFIG_BEFS_DEBUG is not set
 CONFIG_BFS_FS=m
 CONFIG_EFS_FS=m
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
+CONFIG_CRAMFS=m
+CONFIG_VXFS_FS=m
 CONFIG_HPFS_FS=m
-# CONFIG_QNX4FS_FS is not set
+CONFIG_QNX4FS_FS=m
+# CONFIG_QNX4FS_RW is not set
 CONFIG_SYSV_FS=m
 CONFIG_UFS_FS=m
 CONFIG_UFS_FS_WRITE=y
@@ -997,12 +1037,22 @@
 CONFIG_SUNRPC=m
 CONFIG_SUNRPC_GSS=m
 CONFIG_RPCSEC_GSS_KRB5=m
-# CONFIG_SMB_FS is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
 CONFIG_CIFS=m
-# CONFIG_NCP_FS is not set
+CONFIG_NCP_FS=m
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
 CONFIG_CODA_FS=m
 # CONFIG_INTERMEZZO_FS is not set
-# CONFIG_AFS_FS is not set
+CONFIG_AFS_FS=m
+CONFIG_RXRPC=m
 
 #
 # Partition Types
@@ -1010,6 +1060,7 @@
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
 CONFIG_SUN_PARTITION=y
+CONFIG_SMB_NLS=y
 CONFIG_NLS=y
 
 #
@@ -1210,6 +1261,7 @@
 #
 # USB Network adaptors
 #
+CONFIG_USB_AX8817X=m
 CONFIG_USB_CATC=m
 CONFIG_USB_KAWETH=m
 CONFIG_USB_PEGASUS=m
diff -urN linux-2.5.72-bk3/drivers/acpi/Kconfig linux-2.5.72-bk4/drivers/acpi/Kconfig
--- linux-2.5.72-bk3/drivers/acpi/Kconfig	2003-06-16 21:20:27.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/Kconfig	2003-06-23 04:46:28.000000000 -0700
@@ -49,12 +49,12 @@
 	  Full ACPI support (CONFIG_ACPI) is preferred.  Use this option 
 	  only if you wish to limit ACPI's role to processor enumeration.
 
-	  There is no command-line option to disable this, but the kernel
-	  will fall back to the MPS table if the MADT is not present.
+	  In this configuration, ACPI defaults to off. It must be enabled
+	  on the command-line with the "acpismp=force" option.
 
 config ACPI_BOOT
 	bool
-	depends on IA64 && (!IA64_HP_SIM || IA64_SGI_SN) || X86 && ACPI && !ACPI_HT_ONLY || X86 && ACPI
+	depends on IA64 && (!IA64_HP_SIM || IA64_SGI_SN) || X86 && ACPI && !ACPI_HT_ONLY
 	default y
 
 config ACPI_SLEEP
@@ -135,6 +135,31 @@
 	bool "NUMA support" if NUMA && (IA64 && !IA64_HP_SIM || X86 && ACPI && !ACPI_HT_ONLY && !X86_64)
 	default y if IA64 && IA64_SGI_SN
 
+config ACPI_ASUS
+        tristate "ASUS/Medion Laptop Extras"
+        depends on X86 && ACPI && !ACPI_HT_ONLY
+        ---help---
+          This driver provides support for extra features of ACPI-compatible
+          ASUS laptops. As some of Medion laptops are made by ASUS, it may also
+          support some Medion laptops (such as 9675 for example).  It makes all
+          the extra buttons generate standard ACPI events that go through
+          /proc/acpi/events, and (on some models) adds support for changing the
+          display brightness and output, switching the LCD backlight on and off,
+          and most importantly, allows you to blink those fancy LEDs intended
+          for reporting mail and wireless status.
+          
+          All settings are changed via /proc/acpi/asus directory entries. Owner
+          and group for these entries can be set with asus_uid and asus_gid
+          parameters.
+          
+          More information and a userspace daemon for handling the extra buttons
+          at <http://sourceforge.net/projects/acpi4asus/>.
+          
+          If you have an ACPI-compatible ASUS laptop, say Y or M here. This
+          driver is still under development, so if your laptop is unsupported or
+          something works not quite as expected, please use the mailing list
+          available on the above page (acpi4asus-user@lists.sourceforge.net)
+          
 config ACPI_TOSHIBA
 	tristate "Toshiba Laptop Extras"
 	depends on X86 && ACPI && !ACPI_HT_ONLY
diff -urN linux-2.5.72-bk3/drivers/acpi/Makefile linux-2.5.72-bk4/drivers/acpi/Makefile
--- linux-2.5.72-bk3/drivers/acpi/Makefile	2003-06-16 21:20:24.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/Makefile	2003-06-23 04:46:28.000000000 -0700
@@ -44,5 +44,6 @@
 obj-$(CONFIG_ACPI_SYSTEM)	+= system.o event.o
 obj-$(CONFIG_ACPI_DEBUG)	+= debug.o
 obj-$(CONFIG_ACPI_NUMA)		+= numa.o
+obj-$(CONFIG_ACPI_ASUS)		+= asus_acpi.o
 obj-$(CONFIG_ACPI_TOSHIBA)	+= toshiba_acpi.o
 obj-$(CONFIG_ACPI_BUS)		+= scan.o 
diff -urN linux-2.5.72-bk3/drivers/acpi/asus_acpi.c linux-2.5.72-bk4/drivers/acpi/asus_acpi.c
--- linux-2.5.72-bk3/drivers/acpi/asus_acpi.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.72-bk4/drivers/acpi/asus_acpi.c	2003-06-23 04:46:28.000000000 -0700
@@ -0,0 +1,951 @@
+/*
+ *  asus_acpi.c - Asus Laptop ACPI Extras
+ *
+ *
+ *  Copyright (C) 2002, 2003 Julien Lerouge, Karol Kozimor
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ *
+ *  The development page for this driver is located at
+ *  http://sourceforge.net/projects/acpi4asus/
+ *
+ *  Credits:
+ *  Johann Wiesner - Small compile fixes
+ *  John Belmonte  - ACPI code for Toshiba laptop was a good starting point.
+ *
+ *  TODO
+ *  add Fn key status
+ *  Add mode selection on module loading (parameter) -> still necessary ?
+ *  Complete display switching -- may require dirty hacks?
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/proc_fs.h>
+#include <acpi/acpi_drivers.h>
+#include <acpi/acpi_bus.h>
+
+#define ASUS_ACPI_VERSION "0.24a"
+
+#define PROC_ASUS       "asus"	//the directory
+#define PROC_MLED       "mled"
+#define PROC_WLED       "wled"
+#define PROC_INFOS      "info"
+#define PROC_LCD        "lcd"
+#define PROC_BRN        "brn"
+#define PROC_DISP       "disp"
+
+#define ACPI_HOTK_NAME          "Asus Laptop ACPI Extras Driver"
+#define ACPI_HOTK_CLASS         "hotkey"
+#define ACPI_HOTK_DEVICE_NAME   "Hotkey"
+#define ACPI_HOTK_HID           "ATK0100"
+
+/*
+ * Some events we use, same for all Asus
+ */
+#define BR_UP       0x10      		
+#define BR_DOWN     0x20
+
+/*
+ * Flags for hotk status
+ */
+#define MLED_ON     0x01	//is MLED ON ?
+#define WLED_ON     0x02
+
+MODULE_AUTHOR("Julien Lerouge, Karol Kozimor");
+MODULE_DESCRIPTION(ACPI_HOTK_NAME);
+MODULE_LICENSE("GPL");
+
+
+static uid_t asus_uid = 0;
+static gid_t asus_gid = 0;
+MODULE_PARM(asus_uid, "i");
+MODULE_PARM_DESC(uid, "UID for entries in /proc/acpi/asus.\n");
+MODULE_PARM(asus_gid, "i");
+MODULE_PARM_DESC(gid, "GID for entries in /proc/acpi/asus.\n");
+
+
+/* For each model, all features implemented */
+struct model_data {
+	char *name;		//name of the laptop
+	char *mt_mled;		//method to handle mled
+	char *mled_status;	//node to handle mled reading
+	char *mt_wled;		//method to handle wled
+	char *wled_status;	//node to handle wled reading
+	char *mt_lcd_switch;	//method to turn LCD ON/OFF
+	char *lcd_status;	//node to read LCD panel state
+	char *brightness_up;	//method to set brightness up
+	char *brightness_down;	//guess what ?
+	char *brightness_set;	//method to set absolute brightness
+	char *brightness_get;	//method to get absolute brightness
+	char *brightness_status;//node to get brightness
+	char *display_set;	//method to set video output
+	char *display_get;	//method to get video output
+};
+
+/*
+ * This is the main structure, we can use it to store anything interesting
+ * about the hotk device
+ */
+struct asus_hotk {
+	struct acpi_device *device;	//the device we are in
+	acpi_handle handle;		//the handle of the hotk device
+	char status;			//status of the hotk, for LEDs, ...
+	struct model_data *methods;	//methods available on the laptop
+	u8 brightness;			//brighness level
+	enum {
+		L2X = 0,	//L200D -> TODO check Q11 (Fn+F8)
+				//	   Calling this method simply hang the
+				//	   computer, ISMI method hangs the laptop.
+		L3X,		//L3C
+		L3D,		//L3400D
+		M2X,		//M2400E
+		S1X,		//S1300A -> TODO special keys do not work ?
+		D1X,		//D1
+		L1X,		//L1400B
+		A1X, 		//A1340D, A1300F
+		J1X,		//S200 (J1)
+				//TODO  A1370D does not seems to have a ATK device 
+				//	L8400 model doesn't have ATK
+		END_MODEL,
+	} model;		//Models currently supported
+	u16 event_count[128];	//count for each event TODO make this better
+};
+
+/* Here we go */
+#define L3X_PREFIX "\\_SB.PCI0.PX40.ECD0."
+#define S1X_PREFIX "\\_SB.PCI0.PX40."
+#define L1X_PREFIX S1X_PREFIX
+#define A1X_PREFIX "\\_SB.PCI0.ISA.EC0."
+#define J1X_PREFIX A1X_PREFIX
+
+static struct model_data model_conf[END_MODEL] = {
+        /*
+	 * name|  mled |mled read|  wled |wled read| lcd sw |lcd read | 
+	 * br up|br down | br set | br read | br status|set disp | get disp
+	 *
+	 * br set and read shall be in hotk device !
+	 * same for set disp
+	 *
+	 * TODO I have seen a SWBX and AIBX method on some models, like L1400B,
+	 * it seems to be a kind of switch, but what for ?
+	 *
+	 */
+	{"L2X", "MLED", "\\SGP6", "WLED", "\\RCP3", "\\Q10", "\\SGP0", 
+	 "\\Q0E", "\\Q0F", NULL, NULL, NULL, "SDSP", "\\INFB"},
+
+	{"L3X", "MLED", NULL, "WLED", NULL, L3X_PREFIX "_Q10", "\\GL32", 
+	 L3X_PREFIX "_Q0F", L3X_PREFIX "_Q0E", "SPLV", "GPLV", "\\BLVL", "SDSP", 
+	 "\\_SB.PCI0.PCI1.VGAC.NMAP"},
+
+	{"L3D", "MLED", "\\MALD", "WLED", NULL, "\\Q10", "\\BKLG",
+	 "\\Q0E", "\\Q0F", "SPLV", "GPLV", "\\BLVL", "SDSP", "\\INFB"},
+
+	{"M2X", "MLED", NULL, "WLED", NULL, "\\Q10", "\\GP06", 
+	 "\\Q0E","\\Q0F", "SPLV", "GPLV", NULL, "SDSP", "\\INFB"},
+	
+	{"S1X", "MLED", "\\EMLE", "WLED", NULL, S1X_PREFIX "Q10", "\\PNOF", 
+	 S1X_PREFIX "Q0F", S1X_PREFIX "Q0E", "SPLV", "GPLV", "\\BRIT", NULL, NULL},
+	
+	{"D1X", "MLED", NULL, NULL, NULL, "\\Q0D", "\\GP11", 
+	 "\\Q0C", "\\Q0B", NULL, NULL, "\\BLVL", "SDSP","\\INFB"},
+
+	{"L1X", "MLED", NULL, "WLED", NULL, L1X_PREFIX "Q10", "\\PNOF", 
+	 L1X_PREFIX "Q0F", L1X_PREFIX "Q0E", "SPLV", "GPLV", "\\BRIT", NULL, NULL},
+
+	{"A1X", "MLED", "\\MAIL", NULL, NULL, A1X_PREFIX "_Q10", "\\BKLI",
+	 A1X_PREFIX "_Q0E", A1X_PREFIX "_Q0F", NULL, NULL, NULL, NULL, NULL},
+
+	{"J1X", "MLED", "\\MAIL", NULL, NULL, J1X_PREFIX "_Q10", "\\BKLI",
+	 J1X_PREFIX "_Q0B", J1X_PREFIX "_Q0A", NULL, NULL, NULL, NULL, NULL}
+};
+
+/* procdir we use */
+static struct proc_dir_entry *asus_proc_dir = NULL;
+
+/*
+ * This header is made available to allow proper configuration given model,
+ * revision number , ... this info cannot go in struct asus_hotk because it is
+ * available before the hotk
+ */
+static struct acpi_table_header *asus_info = NULL;
+
+/*
+ * The hotkey driver declaration
+ */
+static int asus_hotk_add(struct acpi_device *device);
+static int asus_hotk_remove(struct acpi_device *device, int type);
+static struct acpi_driver asus_hotk_driver = {
+	.name = 	ACPI_HOTK_NAME,
+	.class = 	ACPI_HOTK_CLASS,
+	.ids = 		ACPI_HOTK_HID,
+	.ops = 		{
+				.add = 		asus_hotk_add,
+				.remove = 	asus_hotk_remove,
+			},
+};
+
+/* 
+ * This function evaluates an ACPI method, given an int as parameter, the
+ * method is searched within the scope of the handle, can be NULL. The output
+ * of the method is written is output, which can also be NULL
+ *
+ * returns 1 if write is successful, 0 else. 
+ */
+static int write_acpi_int(acpi_handle handle, const char *method, int val,
+			  struct acpi_buffer *output)
+{
+	struct acpi_object_list params;	//list of input parameters (an int here)
+	union acpi_object in_obj;	//the only param we use
+	acpi_status status;
+
+	params.count = 1;
+	params.pointer = &in_obj;
+	in_obj.type = ACPI_TYPE_INTEGER;
+	in_obj.integer.value = val;
+
+	status = acpi_evaluate_object(handle, (char *) method, &params, output);
+	return (status == AE_OK);
+}
+
+
+static int read_acpi_int(acpi_handle handle, const char *method, int *val)
+{
+	struct acpi_buffer output;
+	union acpi_object out_obj;
+	acpi_status status;
+
+	output.length = sizeof(out_obj);
+	output.pointer = &out_obj;
+
+	status = acpi_evaluate_object(handle, (char*) method, NULL, &output);
+	*val = out_obj.integer.value;
+	return (status == AE_OK) && (out_obj.type == ACPI_TYPE_INTEGER);
+}
+
+/*
+ * We write our info in page, we begin at offset off and cannot write more
+ * than count bytes. We set eof to 1 if we handle those 2 values. We return the
+ * number of bytes written in page
+ */
+static int
+proc_read_info(char *page, char **start, off_t off, int count, int *eof,
+		void *data)
+{
+	int len = 0;
+	struct asus_hotk *hotk = (struct asus_hotk *) data;
+	char buf[16];		//enough for all info
+	/*
+	 * We use the easy way, we don't care of off and count, so we don't set eof
+	 * to 1
+	 */
+
+	len += sprintf(page, ACPI_HOTK_NAME " " ASUS_ACPI_VERSION "\n");
+	len +=
+	    sprintf(page + len, "Model reference    : %s\n",
+		    hotk->methods->name);
+	if (asus_info) {
+		snprintf(buf, 5, "%s", asus_info->signature);
+		len += sprintf(page + len, "ACPI signature     : %s\n", buf);
+		snprintf(buf, 16, "%d", asus_info->length);
+		len += sprintf(page + len, "Table length       : %s\n", buf);
+		snprintf(buf, 16, "%d", asus_info->revision);
+		len += sprintf(page + len, "ACPI minor version : %s\n", buf);
+		snprintf(buf, 16, "%d", asus_info->checksum);
+		len += sprintf(page + len, "Checksum           : %s\n", buf);
+		snprintf(buf, 7, "%s", asus_info->oem_id);
+		len += sprintf(page + len, "OEM identification : %s\n", buf);
+		snprintf(buf, 9, "%s", asus_info->oem_table_id);
+		len += sprintf(page + len, "OEM table id       : %s\n", buf);
+		snprintf(buf, 16, "%x", asus_info->oem_revision);
+		len += sprintf(page + len, "OEM rev number     : 0x%s\n", buf);
+		snprintf(buf, 5, "%s", asus_info->asl_compiler_id);
+		len += sprintf(page + len, "ASL comp vendor ID : %s\n", buf);
+		snprintf(buf, 16, "%x", asus_info->asl_compiler_revision);
+		len += sprintf(page + len, "ASL comp rev number: 0x%s\n", buf);
+	}
+
+	return len;
+}
+
+
+/* 
+ * proc file handlers
+ */
+static int
+proc_read_mled(char *page, char **start, off_t off, int count, int *eof,
+	       void *data)
+{
+	int len = 0;
+	struct asus_hotk *hotk = (struct asus_hotk *) data;
+	int led_status = 0;
+	/*
+	 * We use the easy way, we don't care of off and count, so we don't set eof
+	 * to 1
+	 */
+	if (hotk->methods->mled_status) {
+		if (read_acpi_int(NULL, hotk->methods->mled_status, 
+				  &led_status))
+			len =  sprintf(page, "%d\n", led_status);
+		else
+			printk(KERN_NOTICE "Asus ACPI: Error reading MLED "
+			       "status\n");
+	} else {
+		len = sprintf(page, "%d\n", (hotk->status & MLED_ON) ? 1 : 0);
+	}
+
+	return len;
+}
+
+
+static int
+proc_write_mled(struct file *file, const char *buffer,
+		unsigned long count, void *data)
+{
+	int value;
+	int led_out = 0;
+	struct asus_hotk *hotk = (struct asus_hotk *) data;
+
+
+
+	/* scan expression.  Multiple expressions may be delimited with ; */
+	if (sscanf(buffer, "%i", &value) == 1)
+		led_out = ~value & 1;
+
+	hotk->status =
+	    (value) ? (hotk->status | MLED_ON) : (hotk->status & ~MLED_ON);
+
+	/* We don't have to check mt_mled exists if we are here :) */
+	if (!write_acpi_int(hotk->handle, hotk->methods->mt_mled, led_out,
+			    NULL))
+		printk(KERN_NOTICE "Asus ACPI: MLED write failed\n");
+
+
+
+	return count;
+}
+
+/*
+ * We write our info in page, we begin at offset off and cannot write more
+ * than count bytes. We set eof to 1 if we handle those 2 values. We return the
+ * number of bytes written in page
+ */
+static int
+proc_read_wled(char *page, char **start, off_t off, int count, int *eof,
+	       void *data)
+{
+	int len = 0;
+	struct asus_hotk *hotk = (struct asus_hotk *) data;
+	int led_status;
+
+	if (hotk->methods->wled_status) {
+		if (read_acpi_int(NULL, hotk->methods->mled_status, 
+				  &led_status))
+			len = sprintf(page, "%d\n", led_status);
+		else
+			printk(KERN_NOTICE "Asus ACPI: Error reading WLED "
+			       "status\n");
+	} else {
+		len = sprintf(page, "%d\n", (hotk->status & WLED_ON) ? 1 : 0);
+	}
+
+	return len;
+}
+
+static int
+proc_write_wled(struct file *file, const char *buffer,
+		unsigned long count, void *data)
+{
+	int value;
+	int led_out = 0;
+	struct asus_hotk *hotk = (struct asus_hotk *) data;
+
+	/* scan expression.  Multiple expressions may be delimited with ; */
+	if (sscanf(buffer, "%i", &value) == 1)
+		led_out = value & 1;
+
+	hotk->status =
+	    (value) ? (hotk->status | WLED_ON) : (hotk->status & ~WLED_ON);
+
+	/* We don't have to check if mt_wled exists if we are here :) */
+	if (!write_acpi_int(hotk->handle, hotk->methods->mt_wled, led_out,
+			    NULL))
+		printk(KERN_NOTICE "Asus ACPI: WLED write failed\n");
+
+
+	return count;
+}
+
+
+static int get_lcd_state(struct asus_hotk *hotk)
+{
+	int lcd = 0;
+
+	/* We don't have to check anything, if we are here */
+	if (!read_acpi_int(NULL, hotk->methods->lcd_status, &lcd))
+		printk(KERN_NOTICE "Asus ACPI: Error reading LCD status\n");
+	
+	if (hotk->model == L2X)
+		lcd = ~lcd;
+	
+	return (lcd & 1);
+}
+
+
+static int
+proc_read_lcd(char *page, char **start, off_t off, int count, int *eof,
+	      void *data)
+{
+	return sprintf(page, "%d\n", get_lcd_state((struct asus_hotk *) data));
+}
+
+
+static int
+proc_write_lcd(struct file *file, const char *buffer,
+	       unsigned long count, void *data)
+{
+	int value;
+	int lcd = 0;
+	acpi_status status = 0;
+	int lcd_status = 0;
+	struct asus_hotk *hotk = (struct asus_hotk *) data;
+
+	/* scan expression.  Multiple expressions may be delimited with ; */
+	if (sscanf(buffer, "%i", &value) == 1)
+		lcd = value & 1;
+
+	lcd_status = get_lcd_state(hotk);
+
+	if (lcd_status != lcd) {
+		/* switch */
+		status =
+		    acpi_evaluate_object(NULL, hotk->methods->mt_lcd_switch,
+					 NULL, NULL);
+		if (ACPI_FAILURE(status))
+			printk(KERN_NOTICE "Asus ACPI: Error switching LCD\n");
+	}
+
+	return count;
+}
+
+
+/*
+ * Change the brightness level
+ */
+static void set_brightness(int value, struct asus_hotk *hotk)
+{
+	acpi_status status = 0;
+
+	/* ATKD laptop */
+	if(hotk->methods->brightness_set) {
+		if (!write_acpi_int(hotk->handle, hotk->methods->brightness_set, 
+				    value, NULL))
+			printk(KERN_NOTICE "Asus ACPI: Error changing brightness\n");
+		return;
+	}
+
+	/* HOTK laptop if we are here, act as appropriate */
+	value -= hotk->brightness;
+	while (value != 0) {
+		status = acpi_evaluate_object(NULL, (value > 0) ? 
+					      hotk->methods->brightness_up : 
+					      hotk->methods->brightness_down,
+					      NULL, NULL);
+		(value > 0) ? value-- : value++;
+		if (ACPI_FAILURE(status))
+			printk(KERN_NOTICE "Asus ACPI: Error changing brightness\n");
+	}
+	return;
+}
+
+static int read_brightness(struct asus_hotk *hotk)
+{
+	int value;
+	
+	if(hotk->methods->brightness_get) { /* ATKD laptop */
+		if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get, 
+				   &value))
+			printk(KERN_NOTICE "Asus ACPI: Error reading brightness\n");
+	} else if (hotk->methods->brightness_status) { /* For D1 for example */
+		if (!read_acpi_int(NULL, hotk->methods->brightness_status, 
+				   &value))
+			printk(KERN_NOTICE "Asus ACPI: Error reading brightness\n");
+	} else /* HOTK laptop */
+		value = hotk->brightness;
+	return value;
+}
+
+static int
+proc_read_brn(char *page, char **start, off_t off, int count, int *eof,
+	      void *data)
+{
+	struct asus_hotk *hotk = (struct asus_hotk *) data;
+	return sprintf(page, "%d\n", read_brightness(hotk));
+}
+
+static int
+proc_write_brn(struct file *file, const char *buffer,
+	       unsigned long count, void *data)
+{
+	int value;
+	struct asus_hotk *hotk = (struct asus_hotk *) data;
+
+	/* scan expression.  Multiple expressions may be delimited with ; */
+	if (sscanf(buffer, "%d", &value) == 1) {
+		value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
+			/* 0 <= value <= 15 */
+		set_brightness(value, hotk);
+	} else {
+		printk(KERN_NOTICE "Asus ACPI: Error reading user input\n");
+	}
+
+	return count;
+}
+
+static void set_display(int value, struct asus_hotk *hotk)
+{
+	/* no sanity check needed for now */
+	if (!write_acpi_int(hotk->handle, hotk->methods->display_set, 
+			    value, NULL))
+		printk(KERN_NOTICE "Asus ACPI: Error setting display\n");
+	return;
+}
+
+/*
+ * Now, *this* one could be more user-friendly, but so far, no-one has 
+ * complained. The significance of bits is the same as in proc_write_disp()
+ */
+
+static int
+proc_read_disp(char *page, char **start, off_t off, int count, int *eof,
+	      void *data)
+{
+	int value = 0;
+	struct asus_hotk *hotk = (struct asus_hotk *) data;
+	
+	if (!read_acpi_int(hotk->handle, hotk->methods->display_get, &value))
+		printk(KERN_NOTICE "Asus ACPI: Error reading display status\n");
+	return sprintf(page, "%d\n", value);
+}
+
+/*
+ * Preliminary support for display switching. As of now: 0x01 should activate 
+ * the LCD output, 0x02 should do for CRT, and 0x04 for TV-Out. Any combination 
+ * (bitwise) of these will suffice. I never actually tested 3 displays hooked up 
+ * simultaneously, so be warned.
+ */
+
+static int
+proc_write_disp(struct file *file, const char *buffer,
+	       unsigned long count, void *data)
+{
+	int value;
+	struct asus_hotk *hotk = (struct asus_hotk *) data;
+
+	/* scan expression.  Multiple expressions may be delimited with ; */
+	if (sscanf(buffer, "%d", &value) == 1)
+		set_display(value, hotk);
+	else {
+		printk(KERN_NOTICE "Asus ACPI: Error reading user input\n");
+	}
+
+	return count;
+}
+
+static int asus_hotk_add_fs(struct acpi_device *device)
+{
+	struct proc_dir_entry *proc;
+	struct asus_hotk *hotk = acpi_driver_data(device);
+	mode_t mode;
+	
+	/*
+	 * If parameter uid or gid is not changed, keep the default setting for
+	 * our proc entries (-rw-rw-rw-) else, it means we care about security,
+	 * and then set to -rw-rw----
+	 */
+
+	if ((asus_uid == 0) && (asus_gid == 0)){
+		mode = S_IFREG | S_IRUGO | S_IWUGO;
+	}else{
+		mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP;
+	}
+
+	acpi_device_dir(device) = asus_proc_dir;
+	if (!acpi_device_dir(device))
+		return(-ENODEV);
+
+	proc = create_proc_entry(PROC_INFOS, mode, acpi_device_dir(device));
+	if (proc) {
+		proc->read_proc = proc_read_info;
+		proc->data = acpi_driver_data(device);
+		proc->owner = THIS_MODULE;
+		proc->uid = asus_uid;
+		proc->gid = asus_gid;;
+	} else {
+		printk(KERN_NOTICE "  Unable to create " PROC_INFOS
+		       " fs entry\n");
+	}
+
+	if (hotk->methods->mt_wled) {
+		proc = create_proc_entry(PROC_WLED, mode, acpi_device_dir(device));
+		if (proc) {
+			proc->write_proc = proc_write_wled;
+			proc->read_proc = proc_read_wled;
+			proc->data = acpi_driver_data(device);
+			proc->owner = THIS_MODULE;
+			proc->uid = asus_uid;
+			proc->gid = asus_gid;;
+		} else {
+			printk(KERN_NOTICE "  Unable to create " PROC_WLED
+			       " fs entry\n");
+		}
+	}
+
+	if (hotk->methods->mt_mled) {
+		proc = create_proc_entry(PROC_MLED, mode, acpi_device_dir(device));
+		if (proc) {
+			proc->write_proc = proc_write_mled;
+			proc->read_proc = proc_read_mled;
+			proc->data = acpi_driver_data(device);
+			proc->owner = THIS_MODULE;
+			proc->uid = asus_uid;
+			proc->gid = asus_gid;;
+		} else {
+			printk(KERN_NOTICE "  Unable to create " PROC_MLED
+			       " fs entry\n");
+		}
+	}
+
+	/* 
+	 * We need both read node and write method as LCD switch is also accessible
+	 * from keyboard 
+	 */
+	if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status) {
+		proc = create_proc_entry(PROC_LCD, mode, acpi_device_dir(device));
+		if (proc) {
+			proc->write_proc = proc_write_lcd;
+			proc->read_proc = proc_read_lcd;
+			proc->data = acpi_driver_data(device);
+			proc->owner = THIS_MODULE;
+			proc->uid = asus_uid;
+			proc->gid = asus_gid;;
+		} else {
+			printk(KERN_NOTICE "  Unable to create " PROC_LCD
+			       " fs entry\n");
+		}
+	}
+	
+	if ((hotk->methods->brightness_up && hotk->methods->brightness_down) ||
+	    (hotk->methods->brightness_get && hotk->methods->brightness_get)) {
+		proc = create_proc_entry(PROC_BRN, mode, acpi_device_dir(device));
+		if (proc) {
+			proc->write_proc = proc_write_brn;
+			proc->read_proc = proc_read_brn;
+			proc->data = acpi_driver_data(device);
+			proc->owner = THIS_MODULE;
+			proc->uid = asus_uid;
+			proc->gid = asus_gid;;
+		} else {
+			printk(KERN_NOTICE "  Unable to create " PROC_BRN
+			       " fs entry\n");
+		}
+	}
+
+	if (hotk->methods->display_set) {
+		proc = create_proc_entry(PROC_DISP, mode, acpi_device_dir(device));
+		if (proc) {
+			proc->write_proc = proc_write_disp;
+			proc->read_proc = proc_read_disp;
+			proc->data = acpi_driver_data(device);
+			proc->owner = THIS_MODULE;
+			proc->uid = asus_uid;
+			proc->gid = asus_gid;;
+		} else {
+			printk(KERN_NOTICE "  Unable to create " PROC_DISP
+			       " fs entry\n");
+		}
+	}
+
+	return (AE_OK);
+}
+
+
+static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
+{
+	/* TODO Find a better way to handle events count. Here, in data, we receive
+	 * the hotk, so we can make anything !!
+	 */
+	struct asus_hotk *hotk = (struct asus_hotk *) data;
+
+	if (!hotk)
+		return;
+
+	if ((event & ~((u32) BR_UP)) < 16) {
+		hotk->brightness = (event & ~((u32) BR_UP));
+	} else if ((event & ~((u32) BR_DOWN)) < 16 ) {
+		hotk->brightness = (event & ~((u32) BR_DOWN));
+	}
+
+	acpi_bus_generate_event(hotk->device, event,
+				hotk->event_count[event % 128]++);
+
+	return;
+}
+
+/*
+ * This function is used to initialize the hotk with right values. In this
+ * method, we can make all the detection we want, and modify the hotk struct
+ */
+static int asus_hotk_get_info(struct asus_hotk *hotk)
+{
+	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+	union acpi_object *model = NULL;
+
+	/* 
+	 * We have to write 0 on init this far for all ASUS models
+	 */
+	if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {
+		printk(KERN_NOTICE "  Hotkey initialization failed\n");
+		return -ENODEV;
+	}
+
+	/*
+	 * Here, we also use asus_info to make decision. For example, on INIT
+	 * method, S1X and L1X models both reports to be L84F, but they don't
+	 * have the same methods (L1X has WLED, S1X don't)
+	 */
+	model = (union acpi_object *) buffer.pointer;
+	if (model->type == ACPI_TYPE_STRING) {
+		printk(KERN_NOTICE "  %s model detected, ", model->string.pointer);
+	}
+
+	hotk->model = END_MODEL;
+	if (strncmp(model->string.pointer, "L3D", 3) == 0)
+		hotk->model = L3D;
+		/*
+		 * L2B has same settings that L3X, except for GL32, but as
+		 * there is no node to get the LCD status, and as GL32 is never
+		 * used anywhere else, I assume it's safe, even if lcd get is
+		 * broken for this model (TODO fix it ?)
+		 */
+	else if (strncmp(model->string.pointer, "L3", 2) == 0 ||
+		 strncmp(model->string.pointer, "L2B", 3) == 0)
+		hotk->model = L3X;
+	else if (strncmp(model->string.pointer, "M2", 2) == 0)
+		hotk->model = M2X;
+	else if (strncmp(model->string.pointer, "L2", 2) == 0)
+		hotk->model = L2X;
+	else if (strncmp(model->string.pointer, "L8", 2) == 0)
+		/* S1300A reports L84F, but L1400B too */
+		if (strncmp(asus_info->oem_table_id, "L1", 2) == 0)
+			hotk->model = L1X;
+		else
+			hotk->model = S1X;
+	else if (strncmp(model->string.pointer, "D1", 2) == 0)
+		hotk->model = D1X;
+	else if (strncmp(model->string.pointer, "A1", 2) == 0)
+		hotk->model = A1X;
+	else if (strncmp(model->string.pointer, "J1", 2) == 0)
+		hotk->model = J1X;
+
+
+	if (hotk->model == END_MODEL) {
+		/* By default use the same values, as I don't know others */
+		printk("unsupported, trying default values, contact the "
+		       "developers\n");
+		hotk->model = L2X;
+	} else {
+		printk("supported\n");
+	}
+
+	hotk->methods = &model_conf[hotk->model];
+
+	acpi_os_free(model);
+
+	return AE_OK;
+}
+
+
+
+static int asus_hotk_check(struct asus_hotk *hotk)
+{
+	int result = 0;
+
+	if (!hotk)
+		return(-EINVAL);
+
+	result = acpi_bus_get_status(hotk->device);
+	if (result)
+		return(result);
+
+	if (hotk->device->status.present) {
+		result = asus_hotk_get_info(hotk);
+	} else {
+		printk(KERN_NOTICE "  Hotkey device not present, aborting\n");
+		return(-EINVAL);
+	}
+
+	return(result);
+}
+
+
+
+static int asus_hotk_add(struct acpi_device *device)
+{
+	struct asus_hotk *hotk = NULL;
+	acpi_status status = AE_OK;
+	int result;
+
+	if (!device)
+		return(-EINVAL);
+
+	hotk =
+	    (struct asus_hotk *) kmalloc(sizeof(struct asus_hotk), GFP_KERNEL);
+	if (!hotk)
+		return(-ENOMEM);
+	memset(hotk, 0, sizeof(struct asus_hotk));
+
+	hotk->handle = device->handle;
+	sprintf(acpi_device_name(device), "%s", ACPI_HOTK_DEVICE_NAME);
+	sprintf(acpi_device_class(device), "%s", ACPI_HOTK_CLASS);
+	acpi_driver_data(device) = hotk;
+	hotk->device = device;
+
+
+	result = asus_hotk_check(hotk);
+	if (result)
+		goto end;
+
+	result = asus_hotk_add_fs(device);
+	if (result)
+		goto end;
+
+	/*
+	 * We install the handler, it will receive the hotk in parameter, so, we
+	 * could add other data to the hotk struct
+	 */
+	status = acpi_install_notify_handler(hotk->handle, ACPI_SYSTEM_NOTIFY,
+					     asus_hotk_notify, hotk);
+	if (ACPI_FAILURE(status)) {
+		printk(KERN_NOTICE
+		       "  Error installing notify handler\n");
+	} else {
+		printk(KERN_DEBUG
+		       "  Notify Handler installed successfully\n");
+	}
+
+	/* For HOTK laptops: init the hotk->brightness value */
+	if ((!hotk->methods->brightness_get) && (!hotk->methods->brightness_status) &&
+	    (hotk->methods->brightness_up && hotk->methods->brightness_down)) {
+		status = acpi_evaluate_object(NULL, hotk->methods->brightness_down,
+					      NULL, NULL);
+		if (ACPI_FAILURE(status))
+			printk(KERN_NOTICE "  Error changing brightness\n");
+		status = acpi_evaluate_object(NULL, hotk->methods->brightness_up,
+					      NULL, NULL);
+		if (ACPI_FAILURE(status))
+			printk(KERN_NOTICE "  Error changing brightness\n");
+	}
+
+      end:
+	if (result) {
+		kfree(hotk);
+	}
+
+	return(result);
+}
+
+
+
+
+static int asus_hotk_remove(struct acpi_device *device, int type)
+{
+	acpi_status status = 0;
+	struct asus_hotk *hotk = NULL;
+
+	if (!device || !acpi_driver_data(device))
+		return(-EINVAL);
+
+	hotk = (struct asus_hotk *) acpi_driver_data(device);
+
+	status = acpi_remove_notify_handler(hotk->handle, ACPI_SYSTEM_NOTIFY,
+					    asus_hotk_notify);
+	if (ACPI_FAILURE(status))
+		printk(KERN_NOTICE "Error removing notify handler\n");
+
+	kfree(hotk);
+
+	return(0);
+}
+
+
+
+
+static int __init asus_acpi_init(void)
+{
+	int result = 0;
+	acpi_status status = 0;
+	struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL };
+
+	printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n",
+	       ASUS_ACPI_VERSION);
+	/*
+	 * Here is the code to know the model we are running on. We need to
+	 * know this before calling the acpi_bus_register_driver function, in
+	 * case the HID for the laptop we are running on is different from
+	 * ACPI_HOTK_HID, which I have never seen yet :)
+	 * 
+	 * This information is then available in the global var asus_info
+	 */
+	status = acpi_get_table(ACPI_TABLE_DSDT, 1, &dsdt);
+	if (ACPI_FAILURE(status)) {
+		printk(KERN_NOTICE "  Couldn't get the DSDT table header\n");
+	} else {
+		asus_info = (struct acpi_table_header *) dsdt.pointer;
+	}
+
+	asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir);
+	if (!asus_proc_dir)
+		return(-ENODEV);
+	asus_proc_dir->owner = THIS_MODULE;
+
+	result = acpi_bus_register_driver(&asus_hotk_driver);
+	if (result < 0) {
+		printk(KERN_NOTICE "  Error registering " ACPI_HOTK_NAME " \n");
+		remove_proc_entry(PROC_ASUS, acpi_root_dir);
+		return(-ENODEV);
+	}
+
+	return(0);
+}
+
+
+
+static void __exit asus_acpi_exit(void)
+{
+	acpi_bus_unregister_driver(&asus_hotk_driver);
+	remove_proc_entry(PROC_ASUS, acpi_root_dir);
+
+	acpi_os_free(asus_info);
+
+	return;
+}
+
+module_init(asus_acpi_init);
+module_exit(asus_acpi_exit);
diff -urN linux-2.5.72-bk3/drivers/acpi/dispatcher/dsmthdat.c linux-2.5.72-bk4/drivers/acpi/dispatcher/dsmthdat.c
--- linux-2.5.72-bk3/drivers/acpi/dispatcher/dsmthdat.c	2003-06-16 21:19:59.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/dispatcher/dsmthdat.c	2003-06-23 04:46:28.000000000 -0700
@@ -306,7 +306,6 @@
 {
 	acpi_status                     status;
 	struct acpi_namespace_node      *node;
-	union acpi_operand_object       *new_desc = object;
 
 
 	ACPI_FUNCTION_TRACE ("ds_method_data_set_value");
@@ -325,28 +324,16 @@
 	}
 
 	/*
-	 * If the object has just been created and is not attached to anything,
-	 * (the reference count is 1), then we can just store it directly into
-	 * the arg/local.  Otherwise, we must copy it.
+	 * Increment ref count so object can't be deleted while installed.
+	 * NOTE: We do not copy the object in order to preserve the call by
+	 * reference semantics of ACPI Control Method invocation.
+	 * (See ACPI specification 2.0_c)
 	 */
-	if (object->common.reference_count > 1) {
-		status = acpi_ut_copy_iobject_to_iobject (object, &new_desc, walk_state);
-		if (ACPI_FAILURE (status)) {
-			return_ACPI_STATUS (status);
-		}
-
-	   ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object Copied %p, new %p\n",
-		   object, new_desc));
-	}
-	else {
-		/* Increment ref count so object can't be deleted while installed */
-
-		acpi_ut_add_reference (new_desc);
-	}
+	acpi_ut_add_reference (object);
 
 	/* Install the object */
 
-	node->object = new_desc;
+	node->object = object;
 	return_ACPI_STATUS (status);
 }
 
diff -urN linux-2.5.72-bk3/drivers/acpi/events/evgpe.c linux-2.5.72-bk4/drivers/acpi/events/evgpe.c
--- linux-2.5.72-bk3/drivers/acpi/events/evgpe.c	2003-06-16 21:20:05.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/events/evgpe.c	2003-06-23 04:46:28.000000000 -0700
@@ -186,11 +186,13 @@
 			}
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
-				"GPE block at %8.8X%8.8X - Values: Enable %02X Status %02X\n",
+				"GPE pair: Status %8.8X%8.8X = %02X, Enable %8.8X%8.8X = %02X\n",
+				ACPI_HIDWORD (gpe_register_info->status_address.address),
+				ACPI_LODWORD (gpe_register_info->status_address.address),
+				gpe_register_info->status,
 				ACPI_HIDWORD (gpe_register_info->enable_address.address),
 				ACPI_LODWORD (gpe_register_info->enable_address.address),
-				gpe_register_info->enable,
-				gpe_register_info->status));
+				gpe_register_info->enable));
 
 			/* First check if there is anything active at all in this register */
 
diff -urN linux-2.5.72-bk3/drivers/acpi/events/evgpeblk.c linux-2.5.72-bk4/drivers/acpi/events/evgpeblk.c
--- linux-2.5.72-bk3/drivers/acpi/events/evgpeblk.c	2003-06-16 21:20:02.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/events/evgpeblk.c	2003-06-23 04:46:28.000000000 -0700
@@ -76,9 +76,14 @@
 
 	/* No need for spin lock since we are not changing any list elements */
 
+	/* Walk the GPE interrupt levels */
+
 	gpe_xrupt_block = acpi_gbl_gpe_xrupt_list_head;
 	while (gpe_xrupt_block) {
 		gpe_block = gpe_xrupt_block->gpe_block_list_head;
+
+		/* Walk the GPE blocks on this interrupt level */
+
 		while (gpe_block) {
 			if ((&gpe_block->event_info[0] <= gpe_event_info) &&
 				(&gpe_block->event_info[((acpi_size) gpe_block->register_count) * 8] > gpe_event_info)) {
@@ -155,7 +160,7 @@
  *
  * PARAMETERS:  Callback from walk_namespace
  *
- * RETURN:      None
+ * RETURN:      Status
  *
  * DESCRIPTION: Called from acpi_walk_namespace. Expects each object to be a
  *              control method under the _GPE portion of the namespace.
@@ -164,10 +169,10 @@
  *
  *              The name of each GPE control method is of the form:
  *                  "_Lnn" or "_Enn"
- *              Where:
- *                  L      - means that the GPE is level triggered
- *                  E      - means that the GPE is edge triggered
- *                  nn     - is the GPE number [in HEX]
+ *                  Where:
+ *                      L      - means that the GPE is level triggered
+ *                      E      - means that the GPE is edge triggered
+ *                      nn     - is the GPE number [in HEX]
  *
  ******************************************************************************/
 
@@ -196,7 +201,8 @@
 	name[ACPI_NAME_SIZE] = 0;
 
 	/*
-	 * Edge/Level determination is based on the 2nd character of the method name
+	 * Edge/Level determination is based on the 2nd character
+	 * of the method name
 	 */
 	switch (name[1]) {
 	case 'L':
@@ -249,15 +255,14 @@
 	gpe_event_info->flags    = type;
 	gpe_event_info->method_node = (struct acpi_namespace_node *) obj_handle;
 
-	/*
-	 * Enable the GPE (SCIs should be disabled at this point)
-	 */
+	/* Enable the GPE (SCIs should be disabled at this point) */
+
 	status = acpi_hw_enable_gpe (gpe_event_info);
 	if (ACPI_FAILURE (status)) {
 		return_ACPI_STATUS (status);
 	}
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+	ACPI_DEBUG_PRINT ((ACPI_DB_LOAD,
 		"Registered GPE method %s as GPE number 0x%.2X\n",
 		name, gpe_number));
 	return_ACPI_STATUS (AE_OK);
@@ -867,8 +872,8 @@
 			}
 
 			/*
-			 * GPE0 and GPE1 do not have to be contiguous in the GPE number space,
-			 * But, GPE0 always starts at zero.
+			 * GPE0 and GPE1 do not have to be contiguous in the GPE number
+			 * space. However, GPE0 always starts at GPE number zero.
 			 */
 			gpe_number_max = acpi_gbl_FADT->gpe1_base +
 					   ((register_count1 * ACPI_GPE_REGISTER_WIDTH) - 1);
diff -urN linux-2.5.72-bk3/drivers/acpi/executer/exoparg1.c linux-2.5.72-bk4/drivers/acpi/executer/exoparg1.c
--- linux-2.5.72-bk3/drivers/acpi/executer/exoparg1.c	2003-06-16 21:20:22.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/executer/exoparg1.c	2003-06-23 04:46:28.000000000 -0700
@@ -222,7 +222,7 @@
 	union acpi_operand_object       *return_desc2 = NULL;
 	u32                             temp32;
 	u32                             i;
-	u32                             j;
+	u32                             power_of_ten;
 	acpi_integer                    digit;
 
 
@@ -291,61 +291,70 @@
 		case AML_FROM_BCD_OP:           /* from_bcd (BCDValue, Result) */
 
 			/*
-			 * The 64-bit ACPI integer can hold 16 4-bit BCD integers
+			 * The 64-bit ACPI integer can hold 16 4-bit BCD characters
+			 * (if table is 32-bit, integer can hold 8 BCD characters)
+			 * Convert each 4-bit BCD value
 			 */
+			power_of_ten = 1;
 			return_desc->integer.value = 0;
-			for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) {
-				/* Get one BCD digit */
+			digit = operand[0]->integer.value;
 
-				digit = (acpi_integer) ((operand[0]->integer.value >> (i * 4)) & 0xF);
+			/* Convert each BCD digit (each is one nybble wide) */
+
+			for (i = 0; (i < acpi_gbl_integer_nybble_width) && (digit > 0); i++) {
+				/* Get the least significant 4-bit BCD digit */
+
+				temp32 = ((u32) digit) & 0xF;
 
 				/* Check the range of the digit */
 
-				if (digit > 9) {
-					ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD digit too large: %d\n",
-						(u32) digit));
+				if (temp32 > 9) {
+					ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+						"BCD digit too large (not decimal): 0x%X\n",
+						temp32));
+
 					status = AE_AML_NUMERIC_OVERFLOW;
 					goto cleanup;
 				}
 
-				if (digit > 0) {
-					/* Sum into the result with the appropriate power of 10 */
+				/* Sum the digit into the result with the current power of 10 */
 
-					for (j = 0; j < i; j++) {
-						digit *= 10;
-					}
+				return_desc->integer.value += (((acpi_integer) temp32) * power_of_ten);
 
-					return_desc->integer.value += digit;
-				}
+				/* Shift to next BCD digit */
+
+				digit >>= 4;
+
+				/* Next power of 10 */
+
+				power_of_ten *= 10;
 			}
 			break;
 
 
 		case AML_TO_BCD_OP:             /* to_bcd (Operand, Result) */
 
-			if (operand[0]->integer.value > ACPI_MAX_BCD_VALUE) {
-				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD overflow: %8.8X%8.8X\n",
-					ACPI_HIDWORD(operand[0]->integer.value),
-					ACPI_LODWORD(operand[0]->integer.value)));
-				status = AE_AML_NUMERIC_OVERFLOW;
-				goto cleanup;
-			}
-
 			return_desc->integer.value = 0;
-			for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) {
-				/* Divide by nth factor of 10 */
+			digit = operand[0]->integer.value;
 
-				temp32 = 0;
-				digit = operand[0]->integer.value;
-				for (j = 0; j < i; j++) {
-					(void) acpi_ut_short_divide (&digit, 10, &digit, &temp32);
-				}
+			/* Each BCD digit is one nybble wide */
 
-				/* Create the BCD digit from the remainder above */
+			for (i = 0; (i < acpi_gbl_integer_nybble_width) && (digit > 0); i++) {
+				(void) acpi_ut_short_divide (&digit, 10, &digit, &temp32);
 
-				if (digit > 0) {
-					return_desc->integer.value += ((acpi_integer) temp32 << (i * 4));
-				}
+				/* Insert the BCD digit that resides in the remainder from above */
+
+				return_desc->integer.value |= (((acpi_integer) temp32) << (i * 4));
+			}
+
+			/* Overflow if there is any data left in Digit */
+
+			if (digit > 0) {
+				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Integer too large to convert to BCD: %8.8X%8.8X\n",
+					ACPI_HIDWORD(operand[0]->integer.value),
+					ACPI_LODWORD(operand[0]->integer.value)));
+				status = AE_AML_NUMERIC_OVERFLOW;
+				goto cleanup;
 			}
 			break;
 
diff -urN linux-2.5.72-bk3/drivers/acpi/executer/exstore.c linux-2.5.72-bk4/drivers/acpi/executer/exstore.c
--- linux-2.5.72-bk3/drivers/acpi/executer/exstore.c	2003-06-16 21:20:00.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/executer/exstore.c	2003-06-23 04:46:28.000000000 -0700
@@ -190,8 +190,8 @@
 		case ACPI_TYPE_INTEGER:
 
 			ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%8.8X%8.8X\n",
-					ACPI_HIWORD (source_desc->integer.value),
-					ACPI_LOWORD (source_desc->integer.value)));
+					ACPI_HIDWORD (source_desc->integer.value),
+					ACPI_LODWORD (source_desc->integer.value)));
 			break;
 
 
diff -urN linux-2.5.72-bk3/drivers/acpi/executer/exsystem.c linux-2.5.72-bk4/drivers/acpi/executer/exsystem.c
--- linux-2.5.72-bk3/drivers/acpi/executer/exsystem.c	2003-06-16 21:20:07.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/executer/exsystem.c	2003-06-23 04:46:28.000000000 -0700
@@ -134,7 +134,7 @@
 
 		acpi_ex_exit_interpreter ();
 
-		acpi_os_stall (how_long);
+		acpi_os_sleep (0, (how_long / 1000) + 1);
 
 		/* And now we must get the interpreter again */
 
@@ -142,7 +142,7 @@
 	}
 
 	else {
-		acpi_os_sleep (0, (how_long / 1000) + 1);
+		acpi_os_stall (how_long);
 	}
 
 	return (status);
diff -urN linux-2.5.72-bk3/drivers/acpi/executer/exutils.c linux-2.5.72-bk4/drivers/acpi/executer/exutils.c
--- linux-2.5.72-bk3/drivers/acpi/executer/exutils.c	2003-06-16 21:19:42.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/executer/exutils.c	2003-06-23 04:46:28.000000000 -0700
@@ -289,7 +289,10 @@
 	/*
 	 * acpi_integer is unsigned, so we don't worry about a '-'
 	 */
-	current_value = value;
+	if ((current_value = value) == 0) {
+	    return_VALUE (1);
+	}
+
 	num_digits = 0;
 
 	while (current_value) {
diff -urN linux-2.5.72-bk3/drivers/acpi/hardware/hwregs.c linux-2.5.72-bk4/drivers/acpi/hardware/hwregs.c
--- linux-2.5.72-bk3/drivers/acpi/hardware/hwregs.c	2003-06-16 21:20:21.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/hardware/hwregs.c	2003-06-23 04:46:28.000000000 -0700
@@ -56,7 +56,7 @@
  *
  * FUNCTION:    acpi_hw_clear_acpi_status
  *
- * PARAMETERS:  none
+ * PARAMETERS:  Flags           - Lock the hardware or not
  *
  * RETURN:      none
  *
@@ -65,7 +65,8 @@
  ******************************************************************************/
 
 acpi_status
-acpi_hw_clear_acpi_status (void)
+acpi_hw_clear_acpi_status (
+	u32                             flags)
 {
 	acpi_status                     status;
 
@@ -77,10 +78,11 @@
 		ACPI_BITMASK_ALL_FIXED_STATUS,
 		(u16) acpi_gbl_FADT->xpm1a_evt_blk.address));
 
-
-	status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
+	if (flags & ACPI_MTX_LOCK) {
+		status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 	}
 
 	status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS,
@@ -104,7 +106,9 @@
 	status = acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block);
 
 unlock_and_exit:
-	(void) acpi_ut_release_mutex (ACPI_MTX_HARDWARE);
+	if (flags & ACPI_MTX_LOCK) {
+		(void) acpi_ut_release_mutex (ACPI_MTX_HARDWARE);
+	}
 	return_ACPI_STATUS (status);
 }
 
@@ -237,8 +241,9 @@
  *
  * FUNCTION:    acpi_get_register
  *
- * PARAMETERS:  register_id         - Index of ACPI Register to access
- *              use_lock            - Lock the hardware
+ * PARAMETERS:  register_id     - ID of ACPI bit_register to access
+ *              return_value    - Value that was read from the register
+ *              Flags           - Lock the hardware or not
  *
  * RETURN:      Value is read from specified Register.  Value returned is
  *              normalized to bit0 (is shifted all the way right)
@@ -290,7 +295,8 @@
 
 		*return_value = register_value;
 
-		ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read value %X\n", register_value));
+		ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read value %8.8X register %X\n",
+				register_value, bit_reg_info->parent_register));
 	}
 
 	return_ACPI_STATUS (status);
@@ -443,7 +449,8 @@
 
 	ACPI_DEBUG_EXEC (register_value = ((register_value & bit_reg_info->access_bit_mask) >> bit_reg_info->bit_position));
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_IO, "ACPI Register Write actual %X\n", register_value));
+	ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Set bits: %8.8X actual %8.8X register %X\n",
+			value, register_value, bit_reg_info->parent_register));
 	return_ACPI_STATUS (status);
 }
 
@@ -751,10 +758,15 @@
 	default:
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 			"Unsupported address space: %X\n", reg->address_space_id));
-		status = AE_BAD_PARAMETER;
-		break;
+		return (AE_BAD_PARAMETER);
 	}
 
+	ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read:  %8.8X width %2d from %8.8X%8.8X (%s)\n",
+			*value, width,
+			ACPI_HIDWORD (reg->address),
+			ACPI_LODWORD (reg->address),
+			acpi_ut_get_region_name (reg->address_space_id)));
+
 	return (status);
 }
 
@@ -832,9 +844,14 @@
 	default:
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 			"Unsupported address space: %X\n", reg->address_space_id));
-		status = AE_BAD_PARAMETER;
-		break;
+		return (AE_BAD_PARAMETER);
 	}
 
+	ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Wrote: %8.8X width %2d   to %8.8X%8.8X (%s)\n",
+			value, width,
+			ACPI_HIDWORD (reg->address),
+			ACPI_LODWORD (reg->address),
+			acpi_ut_get_region_name (reg->address_space_id)));
+
 	return (status);
 }
diff -urN linux-2.5.72-bk3/drivers/acpi/hardware/hwsleep.c linux-2.5.72-bk4/drivers/acpi/hardware/hwsleep.c
--- linux-2.5.72-bk3/drivers/acpi/hardware/hwsleep.c	2003-06-16 21:19:40.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/hardware/hwsleep.c	2003-06-23 04:46:28.000000000 -0700
@@ -231,7 +231,7 @@
 		return_ACPI_STATUS (status);
 	}
 
-	status = acpi_hw_clear_acpi_status();
+	status = acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK);
 	if (ACPI_FAILURE (status)) {
 		return_ACPI_STATUS (status);
 	}
@@ -355,7 +355,7 @@
 	ACPI_FUNCTION_TRACE ("acpi_enter_sleep_state_s4bios");
 
 	acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
-	acpi_hw_clear_acpi_status();
+	acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK);
 
 	acpi_hw_disable_non_wakeup_gpes();
 
diff -urN linux-2.5.72-bk3/drivers/acpi/tables/tbconvrt.c linux-2.5.72-bk4/drivers/acpi/tables/tbconvrt.c
--- linux-2.5.72-bk3/drivers/acpi/tables/tbconvrt.c	2003-06-16 21:19:59.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/tables/tbconvrt.c	2003-06-23 04:46:28.000000000 -0700
@@ -287,10 +287,14 @@
 		 (acpi_physical_address) (local_fadt->xpm1a_evt_blk.address +
 			ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
 
-	acpi_tb_init_generic_address (&acpi_gbl_xpm1b_enable,
-		 (u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len),
-		 (acpi_physical_address) (local_fadt->xpm1b_evt_blk.address +
-			ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
+	/* PM1B is optional; leave null if not present */
+
+	if (local_fadt->xpm1b_evt_blk.address) {
+		acpi_tb_init_generic_address (&acpi_gbl_xpm1b_enable,
+			 (u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len),
+			 (acpi_physical_address) (local_fadt->xpm1b_evt_blk.address +
+				ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
+	}
 }
 
 
@@ -379,11 +383,15 @@
 			ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
 	acpi_gbl_xpm1a_enable.address_space_id = local_fadt->xpm1a_evt_blk.address_space_id;
 
-	acpi_tb_init_generic_address (&acpi_gbl_xpm1b_enable,
-		(u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len),
-		(acpi_physical_address) (local_fadt->xpm1b_evt_blk.address +
-			ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
-	acpi_gbl_xpm1b_enable.address_space_id = local_fadt->xpm1b_evt_blk.address_space_id;
+	/* PM1B is optional; leave null if not present */
+
+	if (local_fadt->xpm1b_evt_blk.address) {
+		acpi_tb_init_generic_address (&acpi_gbl_xpm1b_enable,
+			(u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len),
+			(acpi_physical_address) (local_fadt->xpm1b_evt_blk.address +
+				ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
+		acpi_gbl_xpm1b_enable.address_space_id = local_fadt->xpm1b_evt_blk.address_space_id;
+	}
 }
 
 
diff -urN linux-2.5.72-bk3/drivers/acpi/utilities/utmisc.c linux-2.5.72-bk4/drivers/acpi/utilities/utmisc.c
--- linux-2.5.72-bk3/drivers/acpi/utilities/utmisc.c	2003-06-16 21:19:40.000000000 -0700
+++ linux-2.5.72-bk4/drivers/acpi/utilities/utmisc.c	2003-06-23 04:46:28.000000000 -0700
@@ -203,10 +203,12 @@
 
 	if (revision <= 1) {
 		acpi_gbl_integer_bit_width = 32;
+		acpi_gbl_integer_nybble_width = 8;
 		acpi_gbl_integer_byte_width = 4;
 	}
 	else {
 		acpi_gbl_integer_bit_width = 64;
+		acpi_gbl_integer_nybble_width = 16;
 		acpi_gbl_integer_byte_width = 8;
 	}
 }
diff -urN linux-2.5.72-bk3/drivers/net/amd8111e.c linux-2.5.72-bk4/drivers/net/amd8111e.c
--- linux-2.5.72-bk3/drivers/net/amd8111e.c	2003-06-16 21:20:05.000000000 -0700
+++ linux-2.5.72-bk4/drivers/net/amd8111e.c	2003-06-23 04:46:28.000000000 -0700
@@ -53,6 +53,8 @@
 	 2. Bug fix: Fixed VLAN support failure.
 	 3. Bug fix: Fixed receive interrupt coalescing bug.
 	 4. Dynamic IPG support is disabled by default.
+	3.0.3 06/05/2003
+	 1. Bug fix: Fixed failure to close the interface if SMP is enabled.
 
 */
 
@@ -89,9 +91,9 @@
 
 #include "amd8111e.h"
 #define MODULE_NAME	"amd8111e"
-#define MODULE_VERSION	"3.0.2"
+#define MODULE_VERSION	"3.0.3"
 MODULE_AUTHOR("Advanced Micro Devices, Inc.");
-MODULE_DESCRIPTION ("AMD8111 based 10/100 Ethernet Controller. Driver Version 3.0.2");
+MODULE_DESCRIPTION ("AMD8111 based 10/100 Ethernet Controller. Driver Version 3.0.3");
 MODULE_LICENSE("GPL");
 MODULE_PARM(speed_duplex, "1-" __MODULE_STRING (MAX_UNITS) "i");
 MODULE_PARM_DESC(speed_duplex, "Set device speed and duplex modes, 0: Auto Negotitate, 1: 10Mbps Half Duplex, 2: 10Mbps Full Duplex, 3: 100Mbps Half Duplex, 4: 100Mbps Full Duplex");
@@ -1171,11 +1173,11 @@
 	if(lp->options & OPTION_DYN_IPG_ENABLE)	        
 		del_timer_sync(&lp->ipg_data.ipg_timer);
 
-	/* Update the statistics before closing */
-	amd8111e_get_stats(dev);
 	spin_unlock_irq(&lp->lock);
-
 	free_irq(dev->irq, dev);
+
+	/* Update the statistics before closing */
+	amd8111e_get_stats(dev);
 	lp->opened = 0;
 	return 0;
 }
diff -urN linux-2.5.72-bk3/drivers/net/bonding/bond_main.c linux-2.5.72-bk4/drivers/net/bonding/bond_main.c
--- linux-2.5.72-bk3/drivers/net/bonding/bond_main.c	2003-06-23 04:46:24.000000000 -0700
+++ linux-2.5.72-bk4/drivers/net/bonding/bond_main.c	2003-06-23 04:46:28.000000000 -0700
@@ -390,6 +390,7 @@
 #include <linux/timer.h>
 #include <linux/socket.h>
 #include <linux/ctype.h>
+#include <linux/inet.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <asm/io.h>
@@ -2792,84 +2793,6 @@
 	mod_timer(&bond->arp_timer, next_timer);
 }
 
-typedef uint32_t in_addr_t;
-
-int
-my_inet_aton(char *cp, unsigned long *the_addr) {
-	static const in_addr_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff };
-	in_addr_t val;
-	char c;
-	union iaddr {
-	  uint8_t bytes[4];
-	  uint32_t word;
-	} res;
-	uint8_t *pp = res.bytes;
-	int digit,base;
-
-	res.word = 0;
-
-	c = *cp;
-	for (;;) {
-		/*
-		 * Collect number up to ``.''.
-		 * Values are specified as for C:
-		 * 0x=hex, 0=octal, isdigit=decimal.
-		 */
-		if (!isdigit(c)) goto ret_0;
-		val = 0; base = 10; digit = 0;
-		for (;;) {
-			if (isdigit(c)) {
-				val = (val * base) + (c - '0');
-				c = *++cp;
-				digit = 1;
-			} else {
-				break;
-			}
-		}
-		if (c == '.') {
-			/*
-			 * Internet format:
-			 *	a.b.c.d
-			 *	a.b.c	(with c treated as 16 bits)
-			 *	a.b	(with b treated as 24 bits)
-			 */
-			if (pp > res.bytes + 2 || val > 0xff) {
-				goto ret_0;
-			}
-			*pp++ = val;
-			c = *++cp;
-		} else
-			break;
-	}
-	/*
-	 * Check for trailing characters.
-	 */
-	if (c != '\0' && (!isascii(c) || !isspace(c))) {
-		goto ret_0;
-	}
-	/*
-	 * Did we get a valid digit?
-	 */
-	if (!digit) {
-		goto ret_0;
-	}
-
-	/* Check whether the last part is in its limits depending on
-	   the number of parts in total.  */
-	if (val > max[pp - res.bytes]) {
-		goto ret_0;
-	}
-
-	if (the_addr != NULL) {
-		*the_addr = res.word | htonl (val);
-	}
-
-	return (1);
-
-ret_0:
-	return (0);
-}
-
 static int bond_sethwaddr(struct net_device *master, struct net_device *slave)
 {
 #ifdef BONDING_DEBUG
@@ -3877,15 +3800,18 @@
         for (arp_ip_count=0 ;
              (arp_ip_count < MAX_ARP_IP_TARGETS) && arp_ip_target[arp_ip_count];
               arp_ip_count++ ) {
-                /* TODO: check and log bad ip address */
-                if (my_inet_aton(arp_ip_target[arp_ip_count],
-                                 &arp_target[arp_ip_count]) == 0) {
+		/* not complete check, but should be good enough to
+		   catch mistakes */
+		if (!isdigit(arp_ip_target[arp_ip_count][0])) { 
                         printk(KERN_WARNING
                                "bonding_init(): bad arp_ip_target module "
                                "parameter (%s), ARP monitoring will not be "
                                "performed\n",
                                arp_ip_target[arp_ip_count]);
                         arp_interval = 0;
+		} else { 
+			u32 ip = in_aton(arp_ip_target[arp_ip_count]); 
+			*(u32 *)(arp_ip_target[arp_ip_count]) = ip;
 		}
         }
 
diff -urN linux-2.5.72-bk3/drivers/net/ixgb/ixgb_ethtool.c linux-2.5.72-bk4/drivers/net/ixgb/ixgb_ethtool.c
--- linux-2.5.72-bk3/drivers/net/ixgb/ixgb_ethtool.c	2003-06-16 21:20:22.000000000 -0700
+++ linux-2.5.72-bk4/drivers/net/ixgb/ixgb_ethtool.c	2003-06-23 04:46:28.000000000 -0700
@@ -50,7 +50,6 @@
 	return (IXGB_EEPROM_SIZE << 1);
 }
 
-#define SUPPORTED_10000baseT_Full (1 << 11)
 #define SPEED_10000 10000
 
 static void
diff -urN linux-2.5.72-bk3/drivers/net/pcmcia/xirc2ps_cs.c linux-2.5.72-bk4/drivers/net/pcmcia/xirc2ps_cs.c
--- linux-2.5.72-bk3/drivers/net/pcmcia/xirc2ps_cs.c	2003-06-16 21:19:59.000000000 -0700
+++ linux-2.5.72-bk4/drivers/net/pcmcia/xirc2ps_cs.c	2003-06-23 04:46:28.000000000 -0700
@@ -358,7 +358,6 @@
 
 typedef struct local_info_t {
     dev_link_t link;
-    struct net_device dev;
     dev_node_t node;
     struct net_device_stats stats;
     int card_type;
@@ -432,22 +431,10 @@
 #define PutByte(reg,value) outb((value), ioaddr+(reg))
 #define PutWord(reg,value) outw((value), ioaddr+(reg))
 
-static void
-busy_loop(u_long len)
-{
-    if (in_interrupt()) {
-	u_long timeout = jiffies + len;
-	u_long flags;
-	save_flags(flags);
-	sti();
-	while (time_before_eq(jiffies, timeout))
-	    ;
-	restore_flags(flags);
-    } else {
-	__set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(len);
-    }
-}
+#define Wait(n) do { \
+	set_current_state(TASK_UNINTERRUPTIBLE); \
+	schedule_timeout(n); \
+} while (0)
 
 /*====== Functions used for debugging =================================*/
 #if defined(PCMCIA_DEBUG) && 0 /* reading regs may change system status */
@@ -619,11 +606,12 @@
     flush_stale_links();
 
     /* Allocate the device structure */
-    local = kmalloc(sizeof(*local), GFP_KERNEL);
-    if (!local) return NULL;
-    memset(local, 0, sizeof(*local));
-    link = &local->link; dev = &local->dev;
-    link->priv = dev->priv = local;
+    dev = alloc_etherdev(sizeof(local_info_t));
+    if (!dev)
+	    return NULL;
+    local = dev->priv;
+    link = &local->link;
+    link->priv = dev;
 
     init_timer(&link->release);
     link->release.function = &xirc2ps_release;
@@ -645,7 +633,6 @@
     dev->get_stats = &do_get_stats;
     dev->do_ioctl = &do_ioctl;
     dev->set_multicast_list = &set_multicast_list;
-    ether_setup(dev);
     dev->open = &do_open;
     dev->stop = &do_stop;
 #ifdef HAVE_TX_TIMEOUT
@@ -684,7 +671,7 @@
 static void
 xirc2ps_detach(dev_link_t * link)
 {
-    local_info_t *local = link->priv;
+    struct net_device *dev = link->priv;
     dev_link_t **linkp;
 
     DEBUG(0, "detach(0x%p)\n", link);
@@ -706,10 +693,11 @@
      */
     del_timer(&link->release);
     if (link->state & DEV_CONFIG) {
-	DEBUG(0, "detach postponed, '%s' still locked\n",
-	      link->dev->dev_name);
-	link->state |= DEV_STALE_LINK;
-	return;
+	xirc2ps_release((unsigned long)link);
+	if (link->state & DEV_STALE_CONFIG) {
+		link->state |= DEV_STALE_LINK;
+		return;
+	}
     }
 
     /* Break the link with Card Services */
@@ -719,8 +707,8 @@
     /* Unlink device structure, free it */
     *linkp = link->next;
     if (link->dev)
-	unregister_netdev(&local->dev);
-    kfree(local);
+	unregister_netdev(dev);
+    kfree(dev);
 
 } /* xirc2ps_detach */
 
@@ -745,7 +733,8 @@
 static int
 set_card_type(dev_link_t *link, const void *s)
 {
-    local_info_t *local = link->priv;
+    struct net_device *dev = link->priv;
+    local_info_t *local = dev->priv;
   #ifdef PCMCIA_DEBUG
     unsigned cisrev = ((const unsigned char *)s)[2];
   #endif
@@ -839,8 +828,8 @@
 xirc2ps_config(dev_link_t * link)
 {
     client_handle_t handle = link->handle;
-    local_info_t *local = link->priv;
-    struct net_device *dev = &local->dev;
+    struct net_device *dev = link->priv;
+    local_info_t *local = dev->priv;
     tuple_t tuple;
     cisparse_t parse;
     ioaddr_t ioaddr;
@@ -1195,11 +1184,10 @@
 xirc2ps_release(u_long arg)
 {
     dev_link_t *link = (dev_link_t *) arg;
-    local_info_t *local = link->priv;
-    struct net_device *dev = &local->dev;
 
     DEBUG(0, "release(0x%p)\n", link);
 
+#if 0
     /*
      * If the device is currently in use, we won't release until it
      * is actually closed.
@@ -1210,8 +1198,10 @@
 	link->state |= DEV_STALE_CONFIG;
 	return;
     }
+#endif
 
     if (link->win) {
+	struct net_device *dev = link->priv;
 	local_info_t *local = dev->priv;
 	if (local->dingo)
 	    iounmap(local->dingo_ccr - 0x0800);
@@ -1243,8 +1233,7 @@
 	      event_callback_args_t * args)
 {
     dev_link_t *link = args->client_data;
-    local_info_t *lp = link->priv;
-    struct net_device *dev = &lp->dev;
+    struct net_device *dev = link->priv;
 
     DEBUG(0, "event(%d)\n", (int)event);
 
@@ -1779,12 +1768,12 @@
     SelectPage(4);
     udelay(1);
     PutByte(XIRCREG4_GPR1, 0);	     /* clear bit 0: power down */
-    busy_loop(HZ/25);		     /* wait 40 msec */
+    Wait(HZ/25);		     /* wait 40 msec */
     if (local->mohawk)
 	PutByte(XIRCREG4_GPR1, 1);	 /* set bit 0: power up */
     else
 	PutByte(XIRCREG4_GPR1, 1 | 4);	 /* set bit 0: power up, bit 2: AIC */
-    busy_loop(HZ/50);		     /* wait 20 msec */
+    Wait(HZ/50);		     /* wait 20 msec */
 }
 
 static void
@@ -1798,9 +1787,9 @@
 
     hardreset(dev);
     PutByte(XIRCREG_CR, SoftReset); /* set */
-    busy_loop(HZ/50);		     /* wait 20 msec */
+    Wait(HZ/50);		     /* wait 20 msec */
     PutByte(XIRCREG_CR, 0);	     /* clear */
-    busy_loop(HZ/25);		     /* wait 40 msec */
+    Wait(HZ/25);		     /* wait 40 msec */
     if (local->mohawk) {
 	SelectPage(4);
 	/* set pin GP1 and GP2 to output  (0x0c)
@@ -1811,7 +1800,7 @@
     }
 
     /* give the circuits some time to power up */
-    busy_loop(HZ/2);		/* about 500ms */
+    Wait(HZ/2);		/* about 500ms */
 
     local->last_ptr_value = 0;
     local->silicon = local->mohawk ? (GetByte(XIRCREG4_BOV) & 0x70) >> 4
@@ -1830,7 +1819,7 @@
 	SelectPage(0x42);
 	PutByte(XIRCREG42_SWC1, 0x80);
     }
-    busy_loop(HZ/25);		     /* wait 40 msec to let it complete */
+    Wait(HZ/25);		     /* wait 40 msec to let it complete */
 
   #ifdef PCMCIA_DEBUG
     if (pc_debug) {
@@ -1889,7 +1878,7 @@
 	    printk(KERN_INFO "%s: MII selected\n", dev->name);
 	    SelectPage(2);
 	    PutByte(XIRCREG2_MSR, GetByte(XIRCREG2_MSR) | 0x08);
-	    busy_loop(HZ/50);
+	    Wait(HZ/50);
 	} else {
 	    printk(KERN_INFO "%s: MII detected; using 10mbs\n",
 		   dev->name);
@@ -1898,7 +1887,7 @@
 		PutByte(XIRCREG42_SWC1, 0xC0);
 	    else  /* enable 10BaseT */
 		PutByte(XIRCREG42_SWC1, 0x80);
-	    busy_loop(HZ/25);	/* wait 40 msec to let it complete */
+	    Wait(HZ/25);	/* wait 40 msec to let it complete */
 	}
 	if (full_duplex)
 	    PutByte(XIRCREG1_ECR, GetByte(XIRCREG1_ECR | FullDuplex));
@@ -1991,7 +1980,7 @@
 	 * Fixme: Better to use a timer here!
 	 */
 	for (i=0; i < 35; i++) {
-	    busy_loop(HZ/10);	 /* wait 100 msec */
+	    Wait(HZ/10);	 /* wait 100 msec */
 	    status = mii_rd(ioaddr,  0, 1);
 	    if ((status & 0x0020) && (status & 0x0004))
 		break;
@@ -2083,12 +2072,8 @@
 {
 	pcmcia_unregister_driver(&xirc2ps_cs_driver);
 
-	while (dev_list) {
-		if (dev_list->state & DEV_CONFIG)
-			xirc2ps_release((u_long)dev_list);
-		if (dev_list)	/* xirc2ps_release() might already have detached... */
-			xirc2ps_detach(dev_list);
-	}
+	while (dev_list)
+		xirc2ps_detach(dev_list);
 }
 
 module_init(init_xirc2ps_cs);
diff -urN linux-2.5.72-bk3/drivers/net/pcnet32.c linux-2.5.72-bk4/drivers/net/pcnet32.c
--- linux-2.5.72-bk3/drivers/net/pcnet32.c	2003-06-16 21:19:46.000000000 -0700
+++ linux-2.5.72-bk4/drivers/net/pcnet32.c	2003-06-23 04:46:28.000000000 -0700
@@ -1003,7 +1003,7 @@
 	    skb_reserve (rx_skbuff, 2);
 	}
 
-	if (lp->rx_dma_addr[i] == NULL) 
+	if (lp->rx_dma_addr[i] == 0)
 		lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail, rx_skbuff->len, PCI_DMA_FROMDEVICE);
 	lp->rx_ring[i].base = (u32)le32_to_cpu(lp->rx_dma_addr[i]);
 	lp->rx_ring[i].buf_length = le16_to_cpu(-PKT_BUF_SZ);
diff -urN linux-2.5.72-bk3/drivers/net/ppp_async.c linux-2.5.72-bk4/drivers/net/ppp_async.c
--- linux-2.5.72-bk3/drivers/net/ppp_async.c	2003-06-16 21:20:19.000000000 -0700
+++ linux-2.5.72-bk4/drivers/net/ppp_async.c	2003-06-23 04:46:28.000000000 -0700
@@ -147,7 +147,6 @@
 	struct asyncppp *ap;
 	int err;
 
-	MOD_INC_USE_COUNT;
 	err = -ENOMEM;
 	ap = kmalloc(sizeof(*ap), GFP_KERNEL);
 	if (ap == 0)
@@ -183,7 +182,6 @@
  out_free:
 	kfree(ap);
  out:
-	MOD_DEC_USE_COUNT;
 	return err;
 }
 
@@ -223,7 +221,6 @@
 	if (ap->tpkt != 0)
 		kfree_skb(ap->tpkt);
 	kfree(ap);
-	MOD_DEC_USE_COUNT;
 }
 
 /*
@@ -351,6 +348,7 @@
 
 
 static struct tty_ldisc ppp_ldisc = {
+	.owner  = THIS_MODULE,
 	.magic	= TTY_LDISC_MAGIC,
 	.name	= "ppp",
 	.open	= ppp_asynctty_open,
diff -urN linux-2.5.72-bk3/drivers/net/sis900.c linux-2.5.72-bk4/drivers/net/sis900.c
--- linux-2.5.72-bk3/drivers/net/sis900.c	2003-06-16 21:20:00.000000000 -0700
+++ linux-2.5.72-bk4/drivers/net/sis900.c	2003-06-23 04:46:28.000000000 -0700
@@ -124,6 +124,7 @@
 	{ "ICS LAN PHY",			0x0015, 0xF440, LAN },
 	{ "NS 83851 PHY",			0x2000, 0x5C20, MIX },
 	{ "Realtek RTL8201 PHY",		0x0000, 0x8200, LAN },
+	{ "VIA 6103 PHY",			0x0101, 0x8f20, LAN },
 	{0,},
 };
 
diff -urN linux-2.5.72-bk3/drivers/net/sundance.c linux-2.5.72-bk4/drivers/net/sundance.c
--- linux-2.5.72-bk3/drivers/net/sundance.c	2003-06-16 21:20:06.000000000 -0700
+++ linux-2.5.72-bk4/drivers/net/sundance.c	2003-06-23 04:46:28.000000000 -0700
@@ -980,8 +980,8 @@
 	{
 		int i;
 		for (i=0; i<TX_RING_SIZE; i++) {
-			printk(KERN_DEBUG "%02x %08x %08x %08x(%02x) %08x %08x\n", i,
-				np->tx_ring_dma + i*sizeof(*np->tx_ring),	
+			printk(KERN_DEBUG "%02x %08Zx %08x %08x(%02x) %08x %08x\n", i,
+				np->tx_ring_dma + i*sizeof(*np->tx_ring),
 				le32_to_cpu(np->tx_ring[i].next_desc),
 				le32_to_cpu(np->tx_ring[i].status),
 				(le32_to_cpu(np->tx_ring[i].status) >> 2) & 0xff,
@@ -1666,7 +1666,7 @@
 	switch (cmd) {
 		case SIOCDEVPRIVATE:
 		for (i=0; i<TX_RING_SIZE; i++) {
-			printk(KERN_DEBUG "%02x %08x %08x %08x(%02x) %08x %08x\n", i,
+			printk(KERN_DEBUG "%02x %08Zx %08x %08x(%02x) %08x %08x\n", i,
 				np->tx_ring_dma + i*sizeof(*np->tx_ring),	
 				le32_to_cpu(np->tx_ring[i].next_desc),
 				le32_to_cpu(np->tx_ring[i].status),
diff -urN linux-2.5.72-bk3/drivers/net/tulip/Kconfig linux-2.5.72-bk4/drivers/net/tulip/Kconfig
--- linux-2.5.72-bk3/drivers/net/tulip/Kconfig	2003-06-16 21:20:19.000000000 -0700
+++ linux-2.5.72-bk4/drivers/net/tulip/Kconfig	2003-06-23 04:46:28.000000000 -0700
@@ -37,7 +37,7 @@
 	---help---
 	  This driver is developed for the SMC EtherPower series Ethernet
 	  cards and also works with cards based on the DECchip 
-	  21040/21041/21140 (Tulip series) chips.  Some LinkSys PCI cards are
+	  21140 (Tulip series) chips.  Some LinkSys PCI cards are
 	  of this type.  (If your card is NOT SMC EtherPower 10/100 PCI
 	  (smc9332dst), you can also try the driver for "Generic DECchip"
 	  cards, above.  However, most people with a network card of this type
diff -urN linux-2.5.72-bk3/drivers/pci/hotplug/acpiphp.h linux-2.5.72-bk4/drivers/pci/hotplug/acpiphp.h
--- linux-2.5.72-bk3/drivers/pci/hotplug/acpiphp.h	2003-06-16 21:20:27.000000000 -0700
+++ linux-2.5.72-bk4/drivers/pci/hotplug/acpiphp.h	2003-06-23 04:46:28.000000000 -0700
@@ -5,8 +5,8 @@
  * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
  * Copyright (c) 2001 IBM Corp.
  * Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
- * Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com)
- * Copyright (c) 2002 NEC Corporation
+ * Copyright (c) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
+ * Copyright (c) 2002,2003 NEC Corporation
  *
  * All rights reserved.
  *
@@ -26,8 +26,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  * Send feedback to <gregkh@us.ibm.com>,
- *		    <h-aono@ap.jp.nec.com>,
- *		    <t-kouchi@cq.jp.nec.com>
+ *		    <t-kochi@bq.jp.nec.com>
  *
  */
 
@@ -35,6 +34,7 @@
 #define _ACPIPHP_H
 
 #include <linux/acpi.h>
+#include <linux/kobject.h>	/* for KOBJ_NAME_LEN */
 #include "pci_hotplug.h"
 
 #define dbg(format, arg...)					\
@@ -49,7 +49,7 @@
 
 #define SLOT_MAGIC	0x67267322
 /* name size which is used for entries in pcihpfs */
-#define SLOT_NAME_SIZE	32		/* ACPI{_SUN}-{BUS}:{DEV} */
+#define SLOT_NAME_SIZE	KOBJ_NAME_LEN		/* {_SUN} */
 
 struct acpiphp_bridge;
 struct acpiphp_slot;
@@ -212,11 +212,7 @@
 #define FUNC_HAS_PS2		(0x00000040)
 #define FUNC_HAS_PS3		(0x00000080)
 
-/* not yet */
-#define SLOT_SUPPORT_66MHZ	(0x00010000)
-#define SLOT_SUPPORT_100MHZ	(0x00020000)
-#define SLOT_SUPPORT_133MHZ	(0x00040000)
-#define SLOT_SUPPORT_PCIX	(0x00080000)
+#define FUNC_EXISTS		(0x10000000) /* to make sure we call _EJ0 only for existing funcs */
 
 /* function prototypes */
 
diff -urN linux-2.5.72-bk3/drivers/pci/hotplug/acpiphp_core.c linux-2.5.72-bk4/drivers/pci/hotplug/acpiphp_core.c
--- linux-2.5.72-bk3/drivers/pci/hotplug/acpiphp_core.c	2003-06-16 21:20:06.000000000 -0700
+++ linux-2.5.72-bk4/drivers/pci/hotplug/acpiphp_core.c	2003-06-23 04:46:28.000000000 -0700
@@ -5,8 +5,8 @@
  * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
  * Copyright (c) 2001 IBM Corp.
  * Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
- * Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com)
- * Copyright (c) 2002 NEC Corporation
+ * Copyright (c) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
+ * Copyright (c) 2002,2003 NEC Corporation
  *
  * All rights reserved.
  *
@@ -26,8 +26,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  * Send feedback to <gregkh@us.ibm.com>,
- *                  <h-aono@ap.jp.nec.com>,
- *		    <t-kouchi@cq.jp.nec.com>
+ *		    <t-kochi@bq.jp.nec.com>
  *
  */
 
@@ -57,7 +56,7 @@
 static int num_slots;
 
 #define DRIVER_VERSION	"0.4"
-#define DRIVER_AUTHOR	"Greg Kroah-Hartman <gregkh@us.ibm.com>, Takayoshi Kochi <t-kouchi@cq.jp.nec.com>"
+#define DRIVER_AUTHOR	"Greg Kroah-Hartman <gregkh@us.ibm.com>, Takayoshi Kochi <t-kochi@bq.jp.nec.com>"
 #define DRIVER_DESC	"ACPI Hot Plug PCI Controller Driver"
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
@@ -376,10 +375,8 @@
  */
 static void make_slot_name (struct slot *slot)
 {
-	snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "ACPI%d-%02x:%02x",
-		 slot->acpi_slot->sun,
-		 slot->acpi_slot->bridge->bus,
-		 slot->acpi_slot->device);
+	snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%u",
+		 slot->acpi_slot->sun);
 }
 
 /**
diff -urN linux-2.5.72-bk3/drivers/pci/hotplug/acpiphp_glue.c linux-2.5.72-bk4/drivers/pci/hotplug/acpiphp_glue.c
--- linux-2.5.72-bk3/drivers/pci/hotplug/acpiphp_glue.c	2003-06-16 21:19:47.000000000 -0700
+++ linux-2.5.72-bk4/drivers/pci/hotplug/acpiphp_glue.c	2003-06-23 04:46:28.000000000 -0700
@@ -1,9 +1,9 @@
 /*
  * ACPI PCI HotPlug glue functions to ACPI CA subsystem
  *
- * Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com)
+ * Copyright (c) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
  * Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
- * Copyright (c) 2002 NEC Corporation
+ * Copyright (c) 2002,2003 NEC Corporation
  *
  * All rights reserved.
  *
@@ -22,7 +22,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Send feedback to <t-kouchi@cq.jp.nec.com>
+ * Send feedback to <t-kochi@bq.jp.nec.com>
  *
  */
 
@@ -204,7 +204,6 @@
 
 	if (ACPI_FAILURE(status)) {
 		err("failed to register interrupt notify handler\n");
-		kfree(newfunc);
 		return status;
 	}
 
@@ -617,9 +616,8 @@
 
 
 /* find hot-pluggable slots, and then find P2P bridge */
-static int add_bridges(struct acpi_device *device)
+static int add_bridge(acpi_handle handle)
 {
-	acpi_handle *handle = device->handle;
 	acpi_status status;
 	unsigned long tmp;
 	int seg, bus;
@@ -673,6 +671,12 @@
 }
 
 
+static void remove_bridge (acpi_handle handle)
+{
+	/* No-op for now .. */
+}
+
+
 static int power_on_slot (struct acpiphp_slot *slot)
 {
 	acpi_status status;
@@ -725,9 +729,7 @@
 	list_for_each (l, &slot->funcs) {
 		func = list_entry(l, struct acpiphp_func, sibling);
 
-		if (func->flags & FUNC_HAS_PS3) {
-			dbg("%s: executing _PS3 on %s\n", __FUNCTION__,
-			    func->pci_dev->slot_name);
+		if (func->flags & (FUNC_HAS_PS3 | FUNC_EXISTS)) {
 			status = acpi_evaluate_object(func->handle, "_PS3", NULL, NULL);
 			if (ACPI_FAILURE(status)) {
 				warn("%s: _PS3 failed\n", __FUNCTION__);
@@ -740,10 +742,8 @@
 	list_for_each (l, &slot->funcs) {
 		func = list_entry(l, struct acpiphp_func, sibling);
 
-		if (func->flags & FUNC_HAS_EJ0) {
-			dbg("%s: executing _EJ0 on %s\n", __FUNCTION__,
-			    func->pci_dev->slot_name);
-
+		/* We don't want to call _EJ0 on non-existing functions. */
+		if (func->flags & (FUNC_HAS_EJ0 | FUNC_EXISTS)) {
 			/* _EJ0 method take one argument */
 			arg_list.count = 1;
 			arg_list.pointer = &arg;
@@ -756,6 +756,7 @@
 				retval = -1;
 				goto err_exit;
 			}
+			func->flags &= (~FUNC_EXISTS);
 		}
 	}
 
@@ -835,6 +836,8 @@
 		retval = acpiphp_configure_function(func);
 		if (retval)
 			goto err_exit;
+
+		func->flags |= FUNC_EXISTS;
 	}
 
 	slot->flags |= SLOT_ENABLED;
@@ -1029,13 +1032,10 @@
 	}
 }
 
-static struct acpi_driver acpi_pci_hp_driver = {
-	.name =		"pci_hp",
-	.class =	"",
-	.ids =		ACPI_PCI_HOST_HID,
-	.ops =	{
-		.add =	add_bridges,
-	}
+
+static struct acpi_pci_driver acpi_pci_hp_driver = {
+	.add =		add_bridge,
+	.remove =	remove_bridge,
 };
 
 /**
@@ -1044,17 +1044,15 @@
  */
 int acpiphp_glue_init (void)
 {
-	acpi_status status;
+	int num;
 
 	if (list_empty(&pci_root_buses))
 		return -1;
 
-	status = acpi_bus_register_driver(&acpi_pci_hp_driver);
+	num = acpi_pci_register_driver(&acpi_pci_hp_driver);
 
-	if (ACPI_FAILURE(status)) {
-		err("%s: acpi_walk_namespace() failed\n", __FUNCTION__);
+	if (num <= 0)
 		return -1;
-	}
 
 	return 0;
 }
@@ -1296,7 +1294,7 @@
 
 /*
  * attention LED ON: 1
- *              OFF: 0
+ *		OFF: 0
  *
  * TBD
  * no direct attention led status information via ACPI
diff -urN linux-2.5.72-bk3/drivers/pci/hotplug/acpiphp_pci.c linux-2.5.72-bk4/drivers/pci/hotplug/acpiphp_pci.c
--- linux-2.5.72-bk3/drivers/pci/hotplug/acpiphp_pci.c	2003-06-16 21:19:37.000000000 -0700
+++ linux-2.5.72-bk4/drivers/pci/hotplug/acpiphp_pci.c	2003-06-23 04:46:28.000000000 -0700
@@ -4,7 +4,7 @@
  * Copyright (c) 1995,2001 Compaq Computer Corporation
  * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
  * Copyright (c) 2001,2002 IBM Corp.
- * Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com)
+ * Copyright (c) 2002 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
  * Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
  * Copyright (c) 2002 NEC Corporation
  *
@@ -25,7 +25,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Send feedback to <t-kouchi@cq.jp.nec.com>
+ * Send feedback to <t-kochi@bq.jp.nec.com>
  *
  */
 
diff -urN linux-2.5.72-bk3/drivers/pci/hotplug/acpiphp_res.c linux-2.5.72-bk4/drivers/pci/hotplug/acpiphp_res.c
--- linux-2.5.72-bk3/drivers/pci/hotplug/acpiphp_res.c	2003-06-16 21:19:59.000000000 -0700
+++ linux-2.5.72-bk4/drivers/pci/hotplug/acpiphp_res.c	2003-06-23 04:46:28.000000000 -0700
@@ -5,7 +5,7 @@
  * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
  * Copyright (c) 2001 IBM Corp.
  * Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
- * Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com)
+ * Copyright (c) 2002 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
  * Copyright (c) 2002 NEC Corporation
  *
  * All rights reserved.
@@ -25,7 +25,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Send feedback to <gregkh@us.ibm.com>,<h-aono@ap.jp.nec.com>
+ * Send feedback to <gregkh@us.ibm.com>, <t-kochi@bq.jp.nec.com>
  *
  */
 
diff -urN linux-2.5.72-bk3/drivers/scsi/aacraid/aachba.c linux-2.5.72-bk4/drivers/scsi/aacraid/aachba.c
--- linux-2.5.72-bk3/drivers/scsi/aacraid/aachba.c	2003-06-16 21:20:00.000000000 -0700
+++ linux-2.5.72-bk4/drivers/scsi/aacraid/aachba.c	2003-06-23 04:46:28.000000000 -0700
@@ -1518,7 +1518,7 @@
 	dev = (struct aac_dev *)scsicmd->device->host->hostdata;
 	// Get rid of old data
 	psg->count = cpu_to_le32(0);
-	psg->sg[0].addr = cpu_to_le32(NULL);
+	psg->sg[0].addr = cpu_to_le32(0);
 	psg->sg[0].count = cpu_to_le32(0);  
 	if (scsicmd->use_sg) {
 		struct scatterlist *sg;
@@ -1558,7 +1558,7 @@
 		psg->count = cpu_to_le32(1);
 		psg->sg[0].addr = cpu_to_le32(addr);
 		psg->sg[0].count = cpu_to_le32(scsicmd->request_bufflen);  
-		scsicmd->SCp.ptr = (char *)addr;
+		scsicmd->SCp.ptr = (char *)(ulong)addr;
 		byte_count = scsicmd->request_bufflen;
 	}
 	return byte_count;
@@ -1574,8 +1574,8 @@
 	dev = (struct aac_dev *)scsicmd->device->host->hostdata;
 	// Get rid of old data
 	psg->count = cpu_to_le32(0);
-	psg->sg[0].addr[0] = cpu_to_le32(NULL);
-	psg->sg[0].addr[1] = cpu_to_le32(NULL);
+	psg->sg[0].addr[0] = cpu_to_le32(0);
+	psg->sg[0].addr[1] = cpu_to_le32(0);
 	psg->sg[0].count = cpu_to_le32(0);  
 	if (scsicmd->use_sg) {
 		struct scatterlist *sg;
@@ -1619,7 +1619,7 @@
 		psg->sg[0].addr[1] = (u32)(le_addr>>32);
 		psg->sg[0].addr[0] = (u32)(le_addr & 0xffffffff);
 		psg->sg[0].count = cpu_to_le32(scsicmd->request_bufflen);  
-		scsicmd->SCp.ptr = (char *)addr;
+		scsicmd->SCp.ptr = (char *)(ulong)addr;
 		byte_count = scsicmd->request_bufflen;
 	}
 	return byte_count;
diff -urN linux-2.5.72-bk3/drivers/scsi/aic7xxx/aic79xx_osm_pci.c linux-2.5.72-bk4/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
--- linux-2.5.72-bk3/drivers/scsi/aic7xxx/aic79xx_osm_pci.c	2003-06-16 21:19:46.000000000 -0700
+++ linux-2.5.72-bk4/drivers/scsi/aic7xxx/aic79xx_osm_pci.c	2003-06-23 04:46:28.000000000 -0700
@@ -52,9 +52,11 @@
 					const struct pci_device_id *ent);
 static int	ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd,
 						 u_long *base, u_long *base2);
+#ifdef MMAPIO
 static int	ahd_linux_pci_reserve_mem_region(struct ahd_softc *ahd,
 						 u_long *bus_addr,
 						 uint8_t **maddr);
+#endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 static void	ahd_linux_pci_dev_remove(struct pci_dev *pdev);
 
@@ -271,6 +273,7 @@
 	return (0);
 }
 
+#ifdef MMAPIO
 static int
 ahd_linux_pci_reserve_mem_region(struct ahd_softc *ahd,
 				 u_long *bus_addr,
@@ -318,6 +321,7 @@
 		error = ENOMEM;
 	return (error);
 }
+#endif
 
 int
 ahd_pci_map_registers(struct ahd_softc *ahd)
diff -urN linux-2.5.72-bk3/drivers/telephony/ixj.c linux-2.5.72-bk4/drivers/telephony/ixj.c
--- linux-2.5.72-bk3/drivers/telephony/ixj.c	2003-06-16 21:19:39.000000000 -0700
+++ linux-2.5.72-bk4/drivers/telephony/ixj.c	2003-06-23 04:46:30.000000000 -0700
@@ -7247,8 +7247,8 @@
 	len += sprintf(buf + len, "\n%s", ixj_h_rcsid);
 	len += sprintf(buf + len, "\n%s", ixjuser_h_rcsid);
 	len += sprintf(buf + len, "\nDriver version %i.%i.%i", IXJ_VER_MAJOR, IXJ_VER_MINOR, IXJ_BLD_VER);
-	len += sprintf(buf + len, "\nsizeof IXJ struct %d bytes", sizeof(IXJ));
-	len += sprintf(buf + len, "\nsizeof DAA struct %d bytes", sizeof(DAA_REGS));
+	len += sprintf(buf + len, "\nsizeof IXJ struct %Zd bytes", sizeof(IXJ));
+	len += sprintf(buf + len, "\nsizeof DAA struct %Zd bytes", sizeof(DAA_REGS));
 	len += sprintf(buf + len, "\nUsing old telephony API");
 	len += sprintf(buf + len, "\nDebug Level %d\n", ixjdebug);
 
diff -urN linux-2.5.72-bk3/drivers/telephony/ixj.h linux-2.5.72-bk4/drivers/telephony/ixj.h
--- linux-2.5.72-bk3/drivers/telephony/ixj.h	2003-06-16 21:20:27.000000000 -0700
+++ linux-2.5.72-bk4/drivers/telephony/ixj.h	2003-06-23 04:46:30.000000000 -0700
@@ -1213,7 +1213,7 @@
 #endif
 	char *read_buffer, *read_buffer_end;
 	char *read_convert_buffer;
-	unsigned int read_buffer_size;
+	size_t read_buffer_size;
 	unsigned int read_buffer_ready;
 #if LINUX_VERSION_CODE < 0x020400
 	struct wait_queue *write_q;
@@ -1222,7 +1222,7 @@
 #endif
 	char *write_buffer, *write_buffer_end;
 	char *write_convert_buffer;
-	unsigned int write_buffer_size;
+	size_t write_buffer_size;
 	unsigned int write_buffers_empty;
 	unsigned long drybuffer;
 	char *write_buffer_rp, *write_buffer_wp;
@@ -1281,7 +1281,7 @@
 	unsigned char fskcnt;
         unsigned int cidsize;
 	unsigned int cidcnt;
-	unsigned pstn_cid_received;
+	unsigned long pstn_cid_received;
 	PHONE_CID cid;
 	PHONE_CID cid_send;
 	unsigned long pstn_ring_int;
diff -urN linux-2.5.72-bk3/fs/cifs/CHANGES linux-2.5.72-bk4/fs/cifs/CHANGES
--- linux-2.5.72-bk3/fs/cifs/CHANGES	2003-06-16 21:20:22.000000000 -0700
+++ linux-2.5.72-bk4/fs/cifs/CHANGES	2003-06-23 04:46:30.000000000 -0700
@@ -1,3 +1,17 @@
+Version 0.80
+-----------
+Fix oops on stopping oplock thread when removing cifs when
+built as module.
+
+Version 0.79
+------------
+Fix mount options for ro (readonly), uid, gid and file and directory mode. 
+
+Version 0.78
+------------
+Fix errors displayed on failed mounts to be more understandable.
+Fixed various incorrect or misleading smb to posix error code mappings.
+
 Version 0.77
 ------------
 Fix display of NTFS DFS junctions to display as symlinks.
diff -urN linux-2.5.72-bk3/fs/cifs/asn1.c linux-2.5.72-bk4/fs/cifs/asn1.c
--- linux-2.5.72-bk3/fs/cifs/asn1.c	2003-06-16 21:19:39.000000000 -0700
+++ linux-2.5.72-bk4/fs/cifs/asn1.c	2003-06-23 04:46:30.000000000 -0700
@@ -432,7 +432,7 @@
 compare_oid(unsigned long *oid1, unsigned int oid1len,
 	    unsigned long *oid2, unsigned int oid2len)
 {
-	int i;
+	unsigned int i;
 
 	if (oid1len != oid2len)
 		return 0;
diff -urN linux-2.5.72-bk3/fs/cifs/cifs_fs_sb.h linux-2.5.72-bk4/fs/cifs/cifs_fs_sb.h
--- linux-2.5.72-bk3/fs/cifs/cifs_fs_sb.h	2003-06-16 21:19:46.000000000 -0700
+++ linux-2.5.72-bk4/fs/cifs/cifs_fs_sb.h	2003-06-23 04:46:30.000000000 -0700
@@ -24,5 +24,9 @@
 	struct nls_table *local_nls;
 	unsigned int rsize;
 	unsigned int wsize;
+	uid_t	mnt_uid;
+	gid_t	mnt_gid;
+	mode_t	mnt_file_mode;
+	mode_t	mnt_dir_mode;
 };
 #endif				/* _CIFS_FS_SB_H */
diff -urN linux-2.5.72-bk3/fs/cifs/cifsfs.c linux-2.5.72-bk4/fs/cifs/cifsfs.c
--- linux-2.5.72-bk3/fs/cifs/cifsfs.c	2003-06-16 21:20:02.000000000 -0700
+++ linux-2.5.72-bk4/fs/cifs/cifsfs.c	2003-06-23 04:46:30.000000000 -0700
@@ -62,6 +62,9 @@
 void cifs_proc_init(void);
 void cifs_proc_clean(void);
 
+static DECLARE_COMPLETION(cifs_oplock_exited);
+
+
 static int
 cifs_read_super(struct super_block *sb, void *data,
 		const char *devname, int silent)
@@ -427,7 +430,8 @@
 		       "cifs_destroy_mids: error not all structures were freed\n");
 	if (kmem_cache_destroy(cifs_oplock_cachep))
 		printk(KERN_WARNING
-		       "error not all oplock structures were freed\n");}
+		       "error not all oplock structures were freed\n");
+}
 
 static int cifs_oplock_thread(void * dummyarg)
 {
@@ -439,14 +443,13 @@
 	int rc;
 
 	daemonize("cifsoplockd");
-	allow_signal(SIGKILL);
+	allow_signal(SIGTERM);
 
 	oplockThread = current;
-	while (1) {
+	do {
 		set_current_state(TASK_INTERRUPTIBLE);
 		schedule_timeout(100*HZ);
 		/* BB add missing code */
-		cFYI(1,("oplock thread woken up - flush inode")); /* BB remove */
 		write_lock(&GlobalMid_Lock); 
 		list_for_each_safe(tmp, tmp1, &GlobalOplock_Q) {
 			oplock_item = list_entry(tmp, struct oplock_q_entry,
@@ -466,11 +469,10 @@
 				write_lock(&GlobalMid_Lock);
 			} else
 				break;
-			cFYI(1,("next time through list")); /* BB remove */
 		}
 		write_unlock(&GlobalMid_Lock);
-		cFYI(1,("next time through while loop")); /* BB remove */
-	}
+	} while(!signal_pending(current));
+	complete_and_exit (&cifs_oplock_exited, 0);
 }
 
 static int __init
@@ -532,8 +534,10 @@
 	cifs_destroy_inodecache();
 	cifs_destroy_mids();
 	cifs_destroy_request_bufs();
-	if(oplockThread)
-		send_sig(SIGKILL, oplockThread, 1);
+	if(oplockThread) {
+		send_sig(SIGTERM, oplockThread, 1);
+		wait_for_completion(&cifs_oplock_exited);
+	}
 }
 
 MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>");
diff -urN linux-2.5.72-bk3/fs/cifs/cifsproto.h linux-2.5.72-bk4/fs/cifs/cifsproto.h
--- linux-2.5.72-bk3/fs/cifs/cifsproto.h	2003-06-16 21:19:39.000000000 -0700
+++ linux-2.5.72-bk4/fs/cifs/cifsproto.h	2003-06-23 04:46:30.000000000 -0700
@@ -49,7 +49,7 @@
 extern int checkSMBhdr(struct smb_hdr *smb, __u16 mid);
 extern int checkSMB(struct smb_hdr *smb, __u16 mid, int length);
 extern int is_valid_oplock_break(struct smb_hdr *smb);
-extern int smbCalcSize(struct smb_hdr *ptr);
+extern unsigned int smbCalcSize(struct smb_hdr *ptr);
 extern int decode_negTokenInit(unsigned char *security_blob, int length,
 			enum securityEnum *secType);
 extern int map_smb_to_linux_error(struct smb_hdr *smb);
diff -urN linux-2.5.72-bk3/fs/cifs/connect.c linux-2.5.72-bk4/fs/cifs/connect.c
--- linux-2.5.72-bk3/fs/cifs/connect.c	2003-06-16 21:20:22.000000000 -0700
+++ linux-2.5.72-bk4/fs/cifs/connect.c	2003-06-23 04:46:30.000000000 -0700
@@ -53,7 +53,7 @@
 	char *UNC;
 	char *UNCip;
 	uid_t linux_uid;
-	uid_t linux_gid;
+	gid_t linux_gid;
 	mode_t file_mode;
 	mode_t dir_mode;
 	int rw;
@@ -136,8 +136,8 @@
 int
 cifs_demultiplex_thread(struct TCP_Server_Info *server)
 {
-	int length, total_read;
-	unsigned int pdu_length;
+	int length;
+	unsigned int pdu_length, total_read;
 	struct smb_hdr *smb_buffer = NULL;
 	struct msghdr smb_msg;
 	mm_segment_t temp_fs;
@@ -351,6 +351,10 @@
 	memset(vol,0,sizeof(struct smb_vol));
 	vol->linux_uid = current->uid;	/* current->euid instead? */
 	vol->linux_gid = current->gid;
+	vol->dir_mode = S_IRWXUGO;
+	/* 2767 perms indicate mandatory locking support */
+	vol->file_mode = S_IALLUGO & ~(S_ISUID | S_IXGRP);
+
 	vol->rw = TRUE;
 
 	if (!options)
@@ -466,6 +470,8 @@
 			/* ignore */
 		} else if (strnicmp(data, "rw", 2) == 0) {
 			vol->rw = TRUE;
+		} else if (strnicmp(data, "ro", 2) == 0) {
+			vol->rw = FALSE;
 		} else
 			printk(KERN_WARNING "CIFS: Unknown mount option %s\n",data);
 	}
@@ -929,8 +935,11 @@
 			cifs_sb->rsize = PAGE_CACHE_SIZE;
 			cERROR(1,("Attempt to set readsize for mount to less than one page (4096)"));
 		}
-
-
+		cifs_sb->mnt_uid = volume_info.linux_uid;
+		cifs_sb->mnt_gid = volume_info.linux_gid;
+		cifs_sb->mnt_file_mode = volume_info.file_mode;
+		cifs_sb->mnt_dir_mode = volume_info.dir_mode;
+		cFYI(1,("file mode: 0x%x  dir mode: 0x%x",cifs_sb->mnt_file_mode,cifs_sb->mnt_dir_mode));
 		tcon =
 		    find_unc(sin_server.sin_addr.s_addr, volume_info.UNC,
 			     volume_info.username);
diff -urN linux-2.5.72-bk3/fs/cifs/file.c linux-2.5.72-bk4/fs/cifs/file.c
--- linux-2.5.72-bk3/fs/cifs/file.c	2003-06-16 21:19:37.000000000 -0700
+++ linux-2.5.72-bk4/fs/cifs/file.c	2003-06-23 04:46:30.000000000 -0700
@@ -123,8 +123,8 @@
 				 to problems creating new read-only files */
 				if (cifs_sb->tcon->ses->capabilities & CAP_UNIX)                
 					CIFSSMBUnixSetPerms(xid, pTcon, full_path, inode->i_mode,
-						0xFFFFFFFFFFFFFFFF,  
-						0xFFFFFFFFFFFFFFFF,
+						(__u64)-1, 
+						(__u64)-1,
 						cifs_sb->local_nls);
 				else {/* BB implement via Windows security descriptors */
 			/* eg CIFSSMBWinSetPerms(xid,pTcon,full_path,mode,-1,-1,local_nls);*/
@@ -351,8 +351,8 @@
 	   size_t write_size, loff_t * poffset)
 {
 	int rc = 0;
-	int bytes_written = 0;
-	int total_written;
+	unsigned int bytes_written = 0;
+	unsigned int total_written;
 	struct cifs_sb_info *cifs_sb;
 	struct cifsTconInfo *pTcon;
 	int xid, long_op;
@@ -633,9 +633,9 @@
 	  loff_t * poffset)
 {
 	int rc = -EACCES;
-	int bytes_read = 0;
-	int total_read;
-	int current_read_size;
+	unsigned int bytes_read = 0;
+	unsigned int total_read;
+	unsigned int current_read_size;
 	struct cifs_sb_info *cifs_sb;
 	struct cifsTconInfo *pTcon;
 	int xid;
@@ -742,13 +742,13 @@
 		struct list_head *page_list, unsigned num_pages)
 {
 	int rc = -EACCES;
-	int xid,i;
+	int xid;
 	loff_t offset;
 	struct page * page;
 	struct cifs_sb_info *cifs_sb;
 	struct cifsTconInfo *pTcon;
 	int bytes_read = 0;
-	unsigned int read_size;
+	unsigned int read_size,i;
 	char * smb_read_data = 0;
 	struct smb_com_read_rsp * pSMBr;
 	struct pagevec lru_pvec;
@@ -877,6 +877,8 @@
 	      FILE_DIRECTORY_INFO * pfindData, int *pobject_type)
 {
 	struct cifsInodeInfo *cifsInfo = CIFS_I(tmp_inode);
+	struct cifs_sb_info *cifs_sb = CIFS_SB(tmp_inode->i_sb);
+
 	pfindData->ExtFileAttributes =
 	    le32_to_cpu(pfindData->ExtFileAttributes);
 	pfindData->AllocationSize = le64_to_cpu(pfindData->AllocationSize);
@@ -894,7 +896,13 @@
 	    cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime));
 	/* treat dos attribute of read-only as read-only mode bit e.g. 555? */
 	/* 2767 perms - indicate mandatory locking */
-	tmp_inode->i_mode = S_IALLUGO & ~(S_ISUID | S_IXGRP);
+		/* BB fill in uid and gid here? with help from winbind? 
+			or retrieve from NTFS stream extended attribute */
+	tmp_inode->i_uid = cifs_sb->mnt_uid;
+	tmp_inode->i_gid = cifs_sb->mnt_gid;
+	/* set default mode. will override for dirs below */
+	tmp_inode->i_mode = cifs_sb->mnt_file_mode;
+
 	cFYI(0,
 	     ("CIFS FFIRST: Attributes came in as 0x%x",
 	      pfindData->ExtFileAttributes));
@@ -905,7 +913,7 @@
 	} else if (pfindData->ExtFileAttributes & ATTR_DIRECTORY) {
 		*pobject_type = DT_DIR;
 		/* override default perms since we do not lock dirs */
-		tmp_inode->i_mode = S_IRWXUGO;
+		tmp_inode->i_mode = cifs_sb->mnt_dir_mode;
 		tmp_inode->i_mode |= S_IFDIR;
 	} else {
 		*pobject_type = DT_REG;
@@ -1091,10 +1099,10 @@
 cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
 {
 	int rc = 0;
-	int xid, i;
+	int xid;
 	int Unicode = FALSE;
 	int UnixSearch = FALSE;
-	unsigned int bufsize;
+	unsigned int bufsize, i;
 	__u16 searchHandle;
 	struct cifs_sb_info *cifs_sb;
 	struct cifsTconInfo *pTcon;
diff -urN linux-2.5.72-bk3/fs/cifs/inode.c linux-2.5.72-bk4/fs/cifs/inode.c
--- linux-2.5.72-bk3/fs/cifs/inode.c	2003-06-16 21:19:39.000000000 -0700
+++ linux-2.5.72-bk4/fs/cifs/inode.c	2003-06-23 04:46:30.000000000 -0700
@@ -224,16 +224,19 @@
 		    cifs_NTtimeToUnix(le64_to_cpu(findData.LastWriteTime));
 		inode->i_ctime =
 		    cifs_NTtimeToUnix(le64_to_cpu(findData.ChangeTime));
-		inode->i_mode = S_IALLUGO & ~(S_ISUID | S_IXGRP);	/* 2767 perms indicate mandatory locking - will override for dirs later */
 		cFYI(0,
 		     (" Attributes came in as 0x%x ", findData.Attributes));
-		if (findData.Attributes & ATTR_REPARSE) {	
-   /* Can IFLNK be set as it basically is on windows with IFREG or IFDIR? */
+
+		/* set default mode. will override for dirs below */
+		inode->i_mode = cifs_sb->mnt_file_mode;
+
+		if (findData.Attributes & ATTR_REPARSE) {
+	/* Can IFLNK be set as it basically is on windows with IFREG or IFDIR? */
 			inode->i_mode |= S_IFLNK;
 		} else if (findData.Attributes & ATTR_DIRECTORY) {
-   /* override default perms since we do not do byte range locking on dirs */
-			inode->i_mode = S_IRWXUGO;	
-            inode->i_mode |= S_IFDIR;
+	/* override default perms since we do not do byte range locking on dirs */
+			inode->i_mode = cifs_sb->mnt_dir_mode;
+			inode->i_mode |= S_IFDIR;
 		} else {
 			inode->i_mode |= S_IFREG;
 			/* treat the dos attribute of read-only as read-only mode e.g. 555 */
@@ -250,8 +253,11 @@
 		      (unsigned long) inode->i_size, inode->i_blocks));
 		inode->i_nlink = le32_to_cpu(findData.NumberOfLinks);
 
-		/* BB fill in uid and gid here? with help from winbind? */
-
+		/* BB fill in uid and gid here? with help from winbind? 
+			or retrieve from NTFS stream extended attribute */
+		inode->i_uid = cifs_sb->mnt_uid;
+		inode->i_gid = cifs_sb->mnt_gid;
+		
 		if (S_ISREG(inode->i_mode)) {
 			cFYI(1, (" File inode "));
 			inode->i_op = &cifs_file_inode_ops;
@@ -389,8 +395,8 @@
 		direntry->d_inode->i_nlink = 2;
 		if (cifs_sb->tcon->ses->capabilities & CAP_UNIX)                
 			CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
-				0xFFFFFFFFFFFFFFFF,  
-				0xFFFFFFFFFFFFFFFF,
+				(__u64)-1,  
+				(__u64)-1,
 				cifs_sb->local_nls);
 		else { /* BB to be implemented via Windows secrty descriptors*/
 		/* eg CIFSSMBWinSetPerms(xid,pTcon,full_path,mode,-1,-1,local_nls);*/
diff -urN linux-2.5.72-bk3/fs/cifs/misc.c linux-2.5.72-bk4/fs/cifs/misc.c
--- linux-2.5.72-bk3/fs/cifs/misc.c	2003-06-16 21:20:25.000000000 -0700
+++ linux-2.5.72-bk4/fs/cifs/misc.c	2003-06-23 04:46:30.000000000 -0700
@@ -274,12 +274,12 @@
 	cFYI(0,
 	     ("Entering checkSMB with Length: %x, smb_buf_length: %x ",
 	      length, ntohl(smb->smb_buf_length)));
-	if ((length < 2 + sizeof (struct smb_hdr))
+	if (((unsigned int)length < 2 + sizeof (struct smb_hdr))
 	    || (4 + ntohl(smb->smb_buf_length) >
 		CIFS_MAX_MSGSIZE + MAX_CIFS_HDR_SIZE)) {
-		if (length < 2 + sizeof (struct smb_hdr)) {
+		if ((unsigned int)length < 2 + sizeof (struct smb_hdr)) {
 			cERROR(1, ("Length less than 2 + sizeof smb_hdr "));
-			if ((length >= sizeof (struct smb_hdr) - 1)
+			if (((unsigned int)length >= sizeof (struct smb_hdr) - 1)
 			    && (smb->Status.CifsError != 0))
 				return 0;	/* some error cases do not return wct and bcc */
 
@@ -298,7 +298,7 @@
 		return 1;
 
 	if ((4 + ntohl(smb->smb_buf_length) != smbCalcSize(smb))
-	    || (4 + ntohl(smb->smb_buf_length) != length)) {
+	    || (4 + ntohl(smb->smb_buf_length) != (unsigned int)length)) {
 		return 0;
 	} else {
 		cERROR(1, ("smbCalcSize %x ", smbCalcSize(smb)));
diff -urN linux-2.5.72-bk3/fs/cifs/netmisc.c linux-2.5.72-bk4/fs/cifs/netmisc.c
--- linux-2.5.72-bk3/fs/cifs/netmisc.c	2003-06-16 21:20:22.000000000 -0700
+++ linux-2.5.72-bk4/fs/cifs/netmisc.c	2003-06-23 04:46:30.000000000 -0700
@@ -791,7 +791,7 @@
 int
 map_smb_to_linux_error(struct smb_hdr *smb)
 {
-	int i;
+	unsigned int i;
 	int rc = -EIO;		/* if transport error smb error may not be set */
 	__u8 smberrclass;
 	__u16 smberrcode;
@@ -859,10 +859,10 @@
  * calculate the size of the SMB message based on the fixed header
  * portion, the number of word parameters and the data portion of the message
  */
-int
+unsigned int
 smbCalcSize(struct smb_hdr *ptr)
 {
-	return (sizeof (struct smb_hdr) + (int) (2 * ptr->WordCount) +
+	return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) +
 		BCC(ptr));
 }
 
diff -urN linux-2.5.72-bk3/fs/cifs/transport.c linux-2.5.72-bk4/fs/cifs/transport.c
--- linux-2.5.72-bk3/fs/cifs/transport.c	2003-06-16 21:19:47.000000000 -0700
+++ linux-2.5.72-bk4/fs/cifs/transport.c	2003-06-23 04:46:30.000000000 -0700
@@ -186,7 +186,7 @@
 	    int *pbytes_returned, const int long_op)
 {
 	int rc = 0;
-	int receive_len;
+	unsigned int receive_len;
 	long timeout;
 	struct mid_q_entry *midQ;
 
diff -urN linux-2.5.72-bk3/fs/ncpfs/sock.c linux-2.5.72-bk4/fs/ncpfs/sock.c
--- linux-2.5.72-bk3/fs/ncpfs/sock.c	2003-06-16 21:19:59.000000000 -0700
+++ linux-2.5.72-bk4/fs/ncpfs/sock.c	2003-06-23 04:46:30.000000000 -0700
@@ -521,7 +521,7 @@
 		return result;
 	}
 	if (result > len) {
-		printk(KERN_ERR "ncpfs: tcp: bug in recvmsg (%u > %u)\n", result, len);
+		printk(KERN_ERR "ncpfs: tcp: bug in recvmsg (%u > %Zu)\n", result, len);
 		return -EIO;			
 	}
 	return result;
@@ -614,7 +614,7 @@
 					goto skipdata2;
 				}
 				if (datalen > req->datalen + 8) {
-					printk(KERN_ERR "ncpfs: tcp: Unexpected reply len %d (expected at most %d)\n", datalen, req->datalen + 8);
+					printk(KERN_ERR "ncpfs: tcp: Unexpected reply len %d (expected at most %Zd)\n", datalen, req->datalen + 8);
 					server->rcv.state = 3;
 					goto skipdata;
 				}
diff -urN linux-2.5.72-bk3/fs/proc/task_mmu.c linux-2.5.72-bk4/fs/proc/task_mmu.c
--- linux-2.5.72-bk3/fs/proc/task_mmu.c	2003-06-16 21:19:41.000000000 -0700
+++ linux-2.5.72-bk4/fs/proc/task_mmu.c	2003-06-23 04:46:30.000000000 -0700
@@ -91,13 +91,13 @@
 	}
 
 	seq_printf(m, "%0*lx-%0*lx %c%c%c%c %0*lx %02x:%02x %lu %n",
-			2*sizeof(void*), map->vm_start,
-			2*sizeof(void*), map->vm_end,
+			(int) (2*sizeof(void*)), map->vm_start,
+			(int) (2*sizeof(void*)), map->vm_end,
 			flags & VM_READ ? 'r' : '-',
 			flags & VM_WRITE ? 'w' : '-',
 			flags & VM_EXEC ? 'x' : '-',
 			flags & VM_MAYSHARE ? 's' : 'p',
-			2*sizeof(void*), map->vm_pgoff << PAGE_SHIFT,
+			(int) (2*sizeof(void*)), map->vm_pgoff << PAGE_SHIFT,
 			MAJOR(dev), MINOR(dev), ino, &len);
 
 	if (map->vm_file) {
diff -urN linux-2.5.72-bk3/include/acpi/acconfig.h linux-2.5.72-bk4/include/acpi/acconfig.h
--- linux-2.5.72-bk3/include/acpi/acconfig.h	2003-06-16 21:20:19.000000000 -0700
+++ linux-2.5.72-bk4/include/acpi/acconfig.h	2003-06-23 04:46:30.000000000 -0700
@@ -64,7 +64,7 @@
 
 /* Version string */
 
-#define ACPI_CA_VERSION                 0x20030522
+#define ACPI_CA_VERSION                 0x20030619
 
 /* Maximum objects in the various object caches */
 
diff -urN linux-2.5.72-bk3/include/acpi/acglobal.h linux-2.5.72-bk4/include/acpi/acglobal.h
--- linux-2.5.72-bk3/include/acpi/acglobal.h	2003-06-16 21:19:37.000000000 -0700
+++ linux-2.5.72-bk4/include/acpi/acglobal.h	2003-06-23 04:46:30.000000000 -0700
@@ -105,6 +105,7 @@
  */
 ACPI_EXTERN u8                                  acpi_gbl_integer_bit_width;
 ACPI_EXTERN u8                                  acpi_gbl_integer_byte_width;
+ACPI_EXTERN u8                                  acpi_gbl_integer_nybble_width;
 ACPI_EXTERN struct acpi_generic_address         acpi_gbl_xpm1a_enable;
 ACPI_EXTERN struct acpi_generic_address         acpi_gbl_xpm1b_enable;
 
diff -urN linux-2.5.72-bk3/include/acpi/achware.h linux-2.5.72-bk4/include/acpi/achware.h
--- linux-2.5.72-bk3/include/acpi/achware.h	2003-06-16 21:20:05.000000000 -0700
+++ linux-2.5.72-bk4/include/acpi/achware.h	2003-06-23 04:46:30.000000000 -0700
@@ -108,7 +108,7 @@
 
 acpi_status
 acpi_hw_clear_acpi_status (
-   void);
+	u32                             flags);
 
 
 /* GPE support */
diff -urN linux-2.5.72-bk3/include/acpi/acpiosxf.h linux-2.5.72-bk4/include/acpi/acpiosxf.h
--- linux-2.5.72-bk3/include/acpi/acpiosxf.h	2003-06-16 21:19:39.000000000 -0700
+++ linux-2.5.72-bk4/include/acpi/acpiosxf.h	2003-06-23 04:46:30.000000000 -0700
@@ -287,15 +287,15 @@
  * Miscellaneous
  */
 
-BOOLEAN
+u8
 acpi_os_readable (
 	void                            *pointer,
-	u32                       	length);
+	acpi_size                       length);
 
-BOOLEAN
+u8
 acpi_os_writable (
 	void                            *pointer,
-	u32                       	length);
+	acpi_size                       length);
 
 u32
 acpi_os_get_timer (
diff -urN linux-2.5.72-bk3/include/acpi/actypes.h linux-2.5.72-bk4/include/acpi/actypes.h
--- linux-2.5.72-bk3/include/acpi/actypes.h	2003-06-16 21:20:05.000000000 -0700
+++ linux-2.5.72-bk4/include/acpi/actypes.h	2003-06-23 04:46:30.000000000 -0700
@@ -50,11 +50,14 @@
 
 /*
  * Data type ranges
- */
-#define ACPI_UINT8_MAX                  (~((UINT8)  0))
-#define ACPI_UINT16_MAX                 (~((UINT16) 0))
-#define ACPI_UINT32_MAX                 (~((UINT32) 0))
-#define ACPI_UINT64_MAX                 (~((UINT64) 0))
+ * Note: These macros are designed to be compiler independent as well as
+ * working around problems that some 32-bit compilers have with 64-bit
+ * constants.
+ */
+#define ACPI_UINT8_MAX                  (UINT8) (~((UINT8)  0)) /* 0xFF               */
+#define ACPI_UINT16_MAX                 (UINT16)(~((UINT16) 0)) /* 0xFFFF             */
+#define ACPI_UINT32_MAX                 (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF         */
+#define ACPI_UINT64_MAX                 (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
 #define ACPI_ASCII_MAX                  0x7F
 
 
@@ -299,8 +302,6 @@
 typedef u32                                     acpi_integer;
 #define ACPI_INTEGER_MAX                ACPI_UINT32_MAX
 #define ACPI_INTEGER_BIT_SIZE           32
-#define ACPI_MAX_BCD_VALUE              99999999
-#define ACPI_MAX_BCD_DIGITS             8
 #define ACPI_MAX_DECIMAL_DIGITS         10
 
 #define ACPI_USE_NATIVE_DIVIDE          /* Use compiler native 32-bit divide */
@@ -313,12 +314,6 @@
 typedef u64                                     acpi_integer;
 #define ACPI_INTEGER_MAX                ACPI_UINT64_MAX
 #define ACPI_INTEGER_BIT_SIZE           64
-#if ACPI_MACHINE_WIDTH == 64
-#define ACPI_MAX_BCD_VALUE              9999999999999999UL
-#else
-#define ACPI_MAX_BCD_VALUE              9999999999999999ULL
-#endif
-#define ACPI_MAX_BCD_DIGITS             16
 #define ACPI_MAX_DECIMAL_DIGITS         19
 
 #if ACPI_MACHINE_WIDTH == 64
diff -urN linux-2.5.72-bk3/include/asm-i386/acpi.h linux-2.5.72-bk4/include/asm-i386/acpi.h
--- linux-2.5.72-bk3/include/asm-i386/acpi.h	2003-06-16 21:20:22.000000000 -0700
+++ linux-2.5.72-bk4/include/asm-i386/acpi.h	2003-06-23 04:46:30.000000000 -0700
@@ -106,6 +106,10 @@
         :"0"(n_hi), "1"(n_lo))
 
 
+#ifdef CONFIG_ACPI_HT_ONLY
+extern int acpi_lapic;
+#define acpi_ioapic 0
+#else
 #ifndef CONFIG_ACPI_BOOT
 #define acpi_lapic 0
 #define acpi_ioapic 0
@@ -120,6 +124,7 @@
 #else
 #define acpi_ioapic 0
 #endif
+#endif
 
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4
diff -urN linux-2.5.72-bk3/include/linux/acpi.h linux-2.5.72-bk4/include/linux/acpi.h
--- linux-2.5.72-bk3/include/linux/acpi.h	2003-06-16 21:19:37.000000000 -0700
+++ linux-2.5.72-bk4/include/linux/acpi.h	2003-06-23 04:46:30.000000000 -0700
@@ -403,8 +403,8 @@
 
 struct acpi_pci_driver {
 	struct acpi_pci_driver *next;
-	int (*add)(acpi_handle *handle);
-	void (*remove)(acpi_handle *handle);
+	int (*add)(acpi_handle handle);
+	void (*remove)(acpi_handle handle);
 };
 
 int acpi_pci_register_driver(struct acpi_pci_driver *driver);
diff -urN linux-2.5.72-bk3/net/core/flow.c linux-2.5.72-bk4/net/core/flow.c
--- linux-2.5.72-bk3/net/core/flow.c	2003-06-23 04:46:25.000000000 -0700
+++ linux-2.5.72-bk4/net/core/flow.c	2003-06-23 04:46:30.000000000 -0700
@@ -388,11 +388,14 @@
 	add_timer(&flow_hash_rnd_timer);
 
 	register_cpu_notifier(&flow_cache_cpu_nb);
-	for (i = 0; i < NR_CPUS; i++)
-		if (cpu_online(i)) {
-			flow_cache_cpu_prepare(i);
-			flow_cache_cpu_online(i);
-		}
+	for (i = 0; i < NR_CPUS; i++) {
+		if (!cpu_online(i))
+			continue;
+		if (flow_cache_cpu_prepare(i) == NOTIFY_OK &&
+		    flow_cache_cpu_online(i) == NOTIFY_OK)
+			continue;
+		panic("NET: failed to initialise flow cache hash table\n");
+	}
 
 	return 0;
 }
diff -urN linux-2.5.72-bk3/net/ipv4/arp.c linux-2.5.72-bk4/net/ipv4/arp.c
--- linux-2.5.72-bk3/net/ipv4/arp.c	2003-06-16 21:20:21.000000000 -0700
+++ linux-2.5.72-bk4/net/ipv4/arp.c	2003-06-23 04:46:30.000000000 -0700
@@ -623,15 +623,20 @@
 	int addr_type;
 	struct neighbour *n;
 
-	/* arp_rcv below verifies the ARP header, verifies the device
-	 * is ARP'able, and linearizes the SKB (if needed).
+	/* arp_rcv below verifies the ARP header and verifies the device
+	 * is ARP'able.
 	 */
 
 	if (in_dev == NULL)
 		goto out;
 
+	/* ARP header, plus 2 device addresses, plus 2 IP addresses.  */
+	if (!pskb_may_pull(skb, (sizeof(struct arphdr) +
+				 (2 * dev->addr_len) +
+				 (2 * sizeof(u32)))))
+		goto out;
+
 	arp = skb->nh.arph;
-	arp_ptr= (unsigned char *)(arp+1);
 
 	switch (dev_type) {
 	default:	
@@ -693,6 +698,7 @@
 /*
  *	Extract fields
  */
+	arp_ptr= (unsigned char *)(arp+1);
 	sha	= arp_ptr;
 	arp_ptr += dev->addr_len;
 	memcpy(&sip, arp_ptr, 4);
@@ -841,11 +847,6 @@
 	if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
 		goto out_of_mem;
 
-	if (skb_is_nonlinear(skb)) {
-		if (skb_linearize(skb, GFP_ATOMIC) != 0)
-			goto freeskb;
-	}
-
 	return NF_HOOK(NF_ARP, NF_ARP_IN, skb, dev, NULL, arp_process);
 
 freeskb:
diff -urN linux-2.5.72-bk3/net/ipv4/netfilter/arp_tables.c linux-2.5.72-bk4/net/ipv4/netfilter/arp_tables.c
--- linux-2.5.72-bk3/net/ipv4/netfilter/arp_tables.c	2003-06-16 21:20:20.000000000 -0700
+++ linux-2.5.72-bk4/net/ipv4/netfilter/arp_tables.c	2003-06-23 04:46:30.000000000 -0700
@@ -247,14 +247,16 @@
 {
 	static const char nulldevname[IFNAMSIZ] = { 0 };
 	unsigned int verdict = NF_DROP;
-	struct arphdr *arp = (*pskb)->nh.arph;
+	struct arphdr *arp;
 	int hotdrop = 0;
 	struct arpt_entry *e, *back;
 	const char *indev, *outdev;
 	void *table_base;
 
-	/* FIXME: Push down to extensions --RR */
-	if (skb_is_nonlinear(*pskb) && skb_linearize(*pskb, GFP_ATOMIC) != 0)
+	/* ARP header, plus 2 device addresses, plus 2 IP addresses.  */
+	if (!pskb_may_pull((*pskb), (sizeof(struct arphdr) +
+				     (2 * (*pskb)->dev->addr_len) +
+				     (2 * sizeof(u32)))))
 		return NF_DROP;
 
 	indev = in ? in->name : nulldevname;
@@ -267,6 +269,7 @@
 	e = get_entry(table_base, table->private->hook_entry[hook]);
 	back = get_entry(table_base, table->private->underflow[hook]);
 
+	arp = (*pskb)->nh.arph;
 	do {
 		if (arp_packet_match(arp, (*pskb)->dev, indev, outdev, &e->arp)) {
 			struct arpt_entry_target *t;
diff -urN linux-2.5.72-bk3/net/ipv6/icmp.c linux-2.5.72-bk4/net/ipv6/icmp.c
--- linux-2.5.72-bk3/net/ipv6/icmp.c	2003-06-16 21:19:47.000000000 -0700
+++ linux-2.5.72-bk4/net/ipv6/icmp.c	2003-06-23 04:46:30.000000000 -0700
@@ -613,12 +613,6 @@
 	case NDISC_NEIGHBOUR_SOLICITATION:
 	case NDISC_NEIGHBOUR_ADVERTISEMENT:
 	case NDISC_REDIRECT:
-		if (skb_is_nonlinear(skb) &&
-		    skb_linearize(skb, GFP_ATOMIC) != 0) {
-			kfree_skb(skb);
-			return 0;
-		}
-
 		ndisc_rcv(skb);
 		break;
 
diff -urN linux-2.5.72-bk3/net/ipv6/ndisc.c linux-2.5.72-bk4/net/ipv6/ndisc.c
--- linux-2.5.72-bk3/net/ipv6/ndisc.c	2003-06-16 21:20:05.000000000 -0700
+++ linux-2.5.72-bk4/net/ipv6/ndisc.c	2003-06-23 04:46:30.000000000 -0700
@@ -714,12 +714,6 @@
 	struct inet6_ifaddr *ifp;
 	struct neighbour *neigh;
 
-	if (skb->len < sizeof(struct nd_msg)) {
-		if (net_ratelimit())
-			printk(KERN_WARNING "ICMP NS: packet too short\n");
-		return;
-	}
-
 	if (ipv6_addr_type(&msg->target)&IPV6_ADDR_MULTICAST) {
 		if (net_ratelimit())
 			printk(KERN_WARNING "ICMP NS: target address is multicast\n");
@@ -1410,7 +1404,12 @@
 
 int ndisc_rcv(struct sk_buff *skb)
 {
-	struct nd_msg *msg = (struct nd_msg *) skb->h.raw;
+	struct nd_msg *msg;
+
+	if (!pskb_may_pull(skb, skb->len))
+		return 0;
+
+	msg = (struct nd_msg *) skb->h.raw;
 
 	__skb_push(skb, skb->data-skb->h.raw);
 
diff -urN linux-2.5.72-bk3/net/irda/irda_device.c linux-2.5.72-bk4/net/irda/irda_device.c
--- linux-2.5.72-bk3/net/irda/irda_device.c	2003-06-16 21:20:01.000000000 -0700
+++ linux-2.5.72-bk4/net/irda/irda_device.c	2003-06-23 04:46:30.000000000 -0700
@@ -231,7 +231,7 @@
 void irda_task_delete(struct irda_task *task)
 {
 	/* Unregister task */
-	hashbin_remove(tasks, (int) task, NULL);
+	hashbin_remove(tasks, (long) task, NULL);
 
 	__irda_task_delete(task);
 }
@@ -345,7 +345,7 @@
 	init_timer(&task->timer);
 
 	/* Register task */
-	hashbin_insert(tasks, (irda_queue_t *) task, (int) task, NULL);
+	hashbin_insert(tasks, (irda_queue_t *) task, (long) task, NULL);
 
 	/* No time to waste, so lets get going! */
 	ret = irda_task_kick(task);
diff -urN linux-2.5.72-bk3/net/irda/irnet/irnet_irda.c linux-2.5.72-bk4/net/irda/irnet/irnet_irda.c
--- linux-2.5.72-bk3/net/irda/irnet/irnet_irda.c	2003-06-16 21:19:39.000000000 -0700
+++ linux-2.5.72-bk4/net/irda/irnet/irnet_irda.c	2003-06-23 04:46:30.000000000 -0700
@@ -33,8 +33,8 @@
 {
   int			index;		/* In the log */
 
-  DENTER(CTRL_TRACE, "(ap=0x%X, event=%d, daddr=%08x, name=``%s'')\n",
-	 (unsigned int) ap, event, daddr, name);
+  DENTER(CTRL_TRACE, "(ap=0x%p, event=%d, daddr=%08x, name=``%s'')\n",
+	 ap, event, daddr, name);
 
   /* Protect this section via spinlock.
    * Note : as we are the only event producer, we only need to exclude
@@ -100,7 +100,7 @@
 {
   notify_t	notify;		/* Callback structure */
 
-  DENTER(IRDA_SR_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SR_TRACE, "(self=0x%p)\n", self);
 
   DABORT(self->tsap != NULL, -EBUSY, IRDA_SR_ERROR, "Already busy !\n");
 
@@ -125,8 +125,8 @@
   /* Remember which TSAP selector we actually got */
   self->stsap_sel = self->tsap->stsap_sel;
 
-  DEXIT(IRDA_SR_TRACE, " - tsap=0x%X, sel=0x%X\n",
-	(unsigned int) self->tsap, self->stsap_sel);
+  DEXIT(IRDA_SR_TRACE, " - tsap=0x%p, sel=0x%X\n",
+	self->tsap, self->stsap_sel);
   return 0;
 }
 
@@ -151,7 +151,7 @@
 {
   __u8	dtsap_sel = 0;		/* TSAP we are looking for */
 
-  DENTER(IRDA_SR_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SR_TRACE, "(self=0x%p)\n", self);
 
   /* By default, no error */
   self->errno = 0;
@@ -231,7 +231,7 @@
 static inline int
 irnet_find_lsap_sel(irnet_socket *	self)
 {
-  DENTER(IRDA_SR_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SR_TRACE, "(self=0x%p)\n", self);
 
   /* This should not happen */
   DABORT(self->iriap, -EBUSY, IRDA_SR_ERROR, "busy with a previous query.\n");
@@ -268,7 +268,7 @@
 {
   int		err;
 
-  DENTER(IRDA_SR_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SR_TRACE, "(self=0x%p)\n", self);
 
   /* Open a local TSAP (an IrTTP instance) */
   err = irnet_open_tsap(self);
@@ -369,7 +369,7 @@
 {
   int	ret;
 
-  DENTER(IRDA_SR_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SR_TRACE, "(self=0x%p)\n", self);
 
   /* Ask lmp for the current discovery log */
   self->discoveries = irlmp_get_discoveries(&self->disco_number, self->mask,
@@ -382,8 +382,8 @@
       clear_bit(0, &self->ttp_connect);
       DRETURN(-ENETUNREACH, IRDA_SR_INFO, "No Cachelog...\n");
     }
-  DEBUG(IRDA_SR_INFO, "Got the log (0x%X), size is %d\n",
-	(unsigned int) self->discoveries, self->disco_number);
+  DEBUG(IRDA_SR_INFO, "Got the log (0x%p), size is %d\n",
+	self->discoveries, self->disco_number);
 
   /* Start with the first discovery */
   self->disco_index = -1;
@@ -426,7 +426,7 @@
   int	number;			/* Number of nodes in the log */
   int	i;
 
-  DENTER(IRDA_SR_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SR_TRACE, "(self=0x%p)\n", self);
 
   /* Ask lmp for the current discovery log */
   discoveries = irlmp_get_discoveries(&number, 0xffff,
@@ -474,7 +474,7 @@
 int
 irda_irnet_create(irnet_socket *	self)
 {
-  DENTER(IRDA_SOCK_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SOCK_TRACE, "(self=0x%p)\n", self);
 
   self->magic = IRNET_MAGIC;	/* Paranoia */
 
@@ -518,7 +518,7 @@
 {
   int		err;
 
-  DENTER(IRDA_SOCK_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SOCK_TRACE, "(self=0x%p)\n", self);
 
   /* Check if we are already trying to connect.
    * Because irda_irnet_connect() can be called directly by pppd plus
@@ -585,7 +585,7 @@
 void
 irda_irnet_destroy(irnet_socket *	self)
 {
-  DENTER(IRDA_SOCK_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SOCK_TRACE, "(self=0x%p)\n", self);
   if(self == NULL)
     return;
 
@@ -676,7 +676,7 @@
   int	number;			/* Number of nodes in the log */
   int	i;
 
-  DENTER(IRDA_SERV_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SERV_TRACE, "(self=0x%p)\n", self);
 
   /* Ask lmp for the current discovery log */
   discoveries = irlmp_get_discoveries(&number, 0xffff,
@@ -722,7 +722,7 @@
   irnet_socket *	new = (irnet_socket *) NULL;
   int			err;
 
-  DENTER(IRDA_SERV_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SERV_TRACE, "(self=0x%p)\n", self);
 
   /* Get the addresses of the requester */
   self->daddr = irttp_get_daddr(self->tsap);
@@ -741,8 +741,8 @@
       new = (irnet_socket *) hashbin_find(irnet_server.list,
 					  0, self->rname);
       if(new)
-	DEBUG(IRDA_SERV_INFO, "Socket 0x%X matches rname ``%s''.\n",
-	      (unsigned int) new, new->rname);
+	DEBUG(IRDA_SERV_INFO, "Socket 0x%p matches rname ``%s''.\n",
+	      new, new->rname);
     }
 
   /* If no name matches, try to find an socket by the destination address */
@@ -758,8 +758,8 @@
 	  if((new->rdaddr == self->daddr) || (new->daddr == self->daddr))
 	    {
 	      /* Yes !!! Get it.. */
-	      DEBUG(IRDA_SERV_INFO, "Socket 0x%X matches daddr %#08x.\n",
-		    (unsigned int) new, self->daddr);
+	      DEBUG(IRDA_SERV_INFO, "Socket 0x%p matches daddr %#08x.\n",
+		    new, self->daddr);
 	      break;
 	    }
 	  new = (irnet_socket *) hashbin_get_next(irnet_server.list);
@@ -777,8 +777,8 @@
 	     (new->rname[0] == '\0') && (new->ppp_open))
 	    {
 	      /* Yes !!! Get it.. */
-	      DEBUG(IRDA_SERV_INFO, "Socket 0x%X is free.\n",
-		    (unsigned int) new);
+	      DEBUG(IRDA_SERV_INFO, "Socket 0x%p is free.\n",
+		    new);
 	      break;
 	    }
 	  new = (irnet_socket *) hashbin_get_next(irnet_server.list);
@@ -788,7 +788,7 @@
   /* Spin lock end */
   spin_unlock_bh(&irnet_server.spinlock);
 
-  DEXIT(IRDA_SERV_TRACE, " - new = 0x%X\n", (unsigned int) new);
+  DEXIT(IRDA_SERV_TRACE, " - new = 0x%p\n", new);
   return new;
 }
 
@@ -806,8 +806,8 @@
 		     __u32		max_sdu_size,
 		     __u8		max_header_size)
 {
-  DENTER(IRDA_SERV_TRACE, "(server=0x%X, new=0x%X)\n",
-	 (unsigned int) server, (unsigned int) new);
+  DENTER(IRDA_SERV_TRACE, "(server=0x%p, new=0x%p)\n",
+	 server, new);
 
   /* Now attach up the new socket */
   new->tsap = irttp_dup(server->tsap, new);
@@ -878,7 +878,7 @@
 irnet_disconnect_server(irnet_socket *	self,
 			struct sk_buff *skb)
 {
-  DENTER(IRDA_SERV_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_SERV_TRACE, "(self=0x%p)\n", self);
 
   /* Put the received packet in the black hole */
   kfree_skb(skb);
@@ -1010,8 +1010,8 @@
   unsigned char *	p;
   int			code = 0;
 
-  DENTER(IRDA_TCB_TRACE, "(self/ap=0x%X, skb=0x%X)\n",
-	 (unsigned int) ap,(unsigned int) skb);
+  DENTER(IRDA_TCB_TRACE, "(self/ap=0x%p, skb=0x%p)\n",
+	 ap, skb);
   DASSERT(skb != NULL, 0, IRDA_CB_ERROR, "skb is NULL !!!\n");
 
   /* Check is ppp is ready to receive our packet */
@@ -1081,7 +1081,7 @@
   int			test_open;
   int			test_connect;
 
-  DENTER(IRDA_TCB_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_TCB_TRACE, "(self=0x%p)\n", self);
   DASSERT(self != NULL, , IRDA_CB_ERROR, "Self is NULL !!!\n");
 
   /* Don't care about it, but let's not leak it */
@@ -1171,7 +1171,7 @@
 {
   irnet_socket *	self = (irnet_socket *) instance;
 
-  DENTER(IRDA_TCB_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_TCB_TRACE, "(self=0x%p)\n", self);
 
   /* Check if socket is closing down (via irda_irnet_destroy()) */
   if(! test_bit(0, &self->ttp_connect))
@@ -1237,7 +1237,7 @@
   irnet_socket *	self = (irnet_socket *) instance;
   LOCAL_FLOW		oldflow = self->tx_flow;
 
-  DENTER(IRDA_TCB_TRACE, "(self=0x%X, flow=%d)\n", (unsigned int) self, flow);
+  DENTER(IRDA_TCB_TRACE, "(self=0x%p, flow=%d)\n", self, flow);
 
   /* Update our state */
   self->tx_flow = flow;
@@ -1278,7 +1278,7 @@
 {
   irnet_socket *	self = (irnet_socket *) instance;
 
-  DENTER(IRDA_TCB_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_TCB_TRACE, "(self=0x%p)\n", self);
   DASSERT(self != NULL, , IRDA_CB_ERROR, "Self is NULL !!!\n");
 
   /* We can only get this event if we are connected */
@@ -1320,9 +1320,9 @@
   irnet_socket *	server = &irnet_server.s;
   irnet_socket *	new = (irnet_socket *) NULL;
 
-  DENTER(IRDA_TCB_TRACE, "(server=0x%X)\n", (unsigned int) server);
+  DENTER(IRDA_TCB_TRACE, "(server=0x%p)\n", server);
   DASSERT(instance == &irnet_server, , IRDA_CB_ERROR,
-	  "Invalid instance (0x%X) !!!\n", (unsigned int) instance);
+	  "Invalid instance (0x%p) !!!\n", instance);
   DASSERT(sap == irnet_server.s.tsap, , IRDA_CB_ERROR, "Invalid sap !!!\n");
 
   /* Try to find the most appropriate IrNET socket */
@@ -1466,7 +1466,7 @@
 {
   irnet_socket *	self = (irnet_socket *) priv;
 
-  DENTER(IRDA_OCB_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_OCB_TRACE, "(self=0x%p)\n", self);
   DASSERT(self != NULL, , IRDA_OCB_ERROR, "Self is NULL !!!\n");
 
   /* Check if already connected (via irnet_connect_socket())
@@ -1530,7 +1530,7 @@
   irnet_socket *	self = (irnet_socket *) priv;
   __u8			dtsap_sel;		/* TSAP we are looking for */
 
-  DENTER(IRDA_OCB_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_OCB_TRACE, "(self=0x%p)\n", self);
   DASSERT(self != NULL, , IRDA_OCB_ERROR, "Self is NULL !!!\n");
 
   /* Check if already connected (via irnet_connect_socket())
@@ -1583,8 +1583,8 @@
   self->iriap = NULL;
 
   /* No more items : remove the log and signal termination */
-  DEBUG(IRDA_OCB_INFO, "Cleaning up log (0x%X)\n",
-	(unsigned int) self->discoveries);
+  DEBUG(IRDA_OCB_INFO, "Cleaning up log (0x%p)\n",
+	self->discoveries);
   if(self->discoveries != NULL)
     {
       /* Cleanup our copy of the discovery log */
@@ -1643,9 +1643,9 @@
 {
   irnet_socket *	self = &irnet_server.s;
 	
-  DENTER(IRDA_OCB_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_OCB_TRACE, "(self=0x%p)\n", self);
   DASSERT(priv == &irnet_server, , IRDA_OCB_ERROR,
-	  "Invalid instance (0x%X) !!!\n", (unsigned int) priv);
+	  "Invalid instance (0x%p) !!!\n", priv);
 
   DEBUG(IRDA_OCB_INFO, "Discovered new IrNET/IrLAN node %s...\n",
 	discovery->info);
@@ -1674,9 +1674,9 @@
 {
   irnet_socket *	self = &irnet_server.s;
 	
-  DENTER(IRDA_OCB_TRACE, "(self=0x%X)\n", (unsigned int) self);
+  DENTER(IRDA_OCB_TRACE, "(self=0x%p)\n", self);
   DASSERT(priv == &irnet_server, , IRDA_OCB_ERROR,
-	  "Invalid instance (0x%X) !!!\n", (unsigned int) priv);
+	  "Invalid instance (0x%p) !!!\n", priv);
 
   DEBUG(IRDA_OCB_INFO, "IrNET/IrLAN node %s expired...\n",
 	expiry->info);
diff -urN linux-2.5.72-bk3/net/irda/irnet/irnet_ppp.c linux-2.5.72-bk4/net/irda/irnet/irnet_ppp.c
--- linux-2.5.72-bk3/net/irda/irnet/irnet_ppp.c	2003-06-16 21:20:19.000000000 -0700
+++ linux-2.5.72-bk4/net/irda/irnet/irnet_ppp.c	2003-06-23 04:46:30.000000000 -0700
@@ -43,7 +43,7 @@
   char *	next;		/* Next command to process */
   int		length;		/* Length of current command */
 
-  DENTER(CTRL_TRACE, "(ap=0x%X, count=%d)\n", (unsigned int) ap, count);
+  DENTER(CTRL_TRACE, "(ap=0x%p, count=%Zd)\n", ap, count);
 
   /* Check for overflow... */
   DABORT(count >= IRNET_MAX_COMMAND, -ENOMEM,
@@ -58,7 +58,7 @@
 
   /* Safe terminate the string */
   command[count] = '\0';
-  DEBUG(CTRL_INFO, "Command line received is ``%s'' (%d).\n",
+  DEBUG(CTRL_INFO, "Command line received is ``%s'' (%Zd).\n",
 	command, count);
 
   /* Check every commands in the command line */
@@ -184,8 +184,8 @@
 {
   int		done_event = 0;
 
-  DENTER(CTRL_TRACE, "(ap=0x%X, event=0x%X)\n",
-	 (unsigned int) ap, (unsigned int) event);
+  DENTER(CTRL_TRACE, "(ap=0x%p, event=0x%p)\n",
+	 ap, event);
 
   /* Test if we have some work to do or we have already finished */
   if(ap->disco_number == -1)
@@ -205,8 +205,8 @@
       /* Check if the we got some results */
       if(ap->discoveries == NULL)
 	ap->disco_number = -1;
-      DEBUG(CTRL_INFO, "Got the log (0x%X), size is %d\n",
-	    (unsigned int) ap->discoveries, ap->disco_number);
+      DEBUG(CTRL_INFO, "Got the log (0x%p), size is %d\n",
+	    ap->discoveries, ap->disco_number);
     }
 
   /* Check if we have more item to dump */
@@ -232,8 +232,8 @@
   if(ap->disco_index >= ap->disco_number)
     {
       /* No more items : remove the log and signal termination */
-      DEBUG(CTRL_INFO, "Cleaning up log (0x%X)\n",
-	    (unsigned int) ap->discoveries);
+      DEBUG(CTRL_INFO, "Cleaning up log (0x%p)\n",
+	    ap->discoveries);
       if(ap->discoveries != NULL)
 	{
 	  /* Cleanup our copy of the discovery log */
@@ -261,7 +261,7 @@
   char		event[64];	/* Max event is 61 char */
   ssize_t	ret = 0;
 
-  DENTER(CTRL_TRACE, "(ap=0x%X, count=%d)\n", (unsigned int) ap, count);
+  DENTER(CTRL_TRACE, "(ap=0x%p, count=%Zd)\n", ap, count);
 
   /* Check if we can write an event out in one go */
   DABORT(count < sizeof(event), -EOVERFLOW, CTRL_ERROR, "Buffer to small.\n");
@@ -307,7 +307,7 @@
   if(ret != 0)
     {
       /* No, return the error code */
-      DEXIT(CTRL_TRACE, " - ret %d\n", ret);
+      DEXIT(CTRL_TRACE, " - ret %Zd\n", ret);
       return ret;
     }
 
@@ -402,7 +402,7 @@
 {
   unsigned int mask;
 
-  DENTER(CTRL_TRACE, "(ap=0x%X)\n", (unsigned int) ap);
+  DENTER(CTRL_TRACE, "(ap=0x%p)\n", ap);
 
   poll_wait(file, &irnet_events.rwait, wait);
   mask = POLLOUT | POLLWRNORM;
@@ -439,7 +439,7 @@
   struct irnet_socket *	ap;
   int			err;
 
-  DENTER(FS_TRACE, "(file=0x%X)\n", (unsigned int) file);
+  DENTER(FS_TRACE, "(file=0x%p)\n", file);
 
 #ifdef SECURE_DEVIRNET
   /* This could (should?) be enforced by the permissions on /dev/irnet. */
@@ -482,7 +482,7 @@
   /* Put our stuff where we will be able to find it later */
   file->private_data = ap;
 
-  DEXIT(FS_TRACE, " - ap=0x%X\n", (unsigned int) ap);
+  DEXIT(FS_TRACE, " - ap=0x%p\n", ap);
   return 0;
 }
 
@@ -498,8 +498,8 @@
 {
   irnet_socket *	ap = (struct irnet_socket *) file->private_data;
 
-  DENTER(FS_TRACE, "(file=0x%X, ap=0x%X)\n",
-	 (unsigned int) file, (unsigned int) ap);
+  DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n",
+	 file, ap);
   DABORT(ap == NULL, 0, FS_ERROR, "ap is NULL !!!\n");
 
   /* Detach ourselves */
@@ -535,8 +535,8 @@
 {
   irnet_socket *	ap = (struct irnet_socket *) file->private_data;
 
-  DPASS(FS_TRACE, "(file=0x%X, ap=0x%X, count=%d)\n",
-	(unsigned int) file, (unsigned int) ap, count);
+  DPASS(FS_TRACE, "(file=0x%p, ap=0x%p, count=%Zd)\n",
+	file, ap, count);
   DABORT(ap == NULL, -ENXIO, FS_ERROR, "ap is NULL !!!\n");
 
   /* If we are connected to ppp_generic, let it handle the job */
@@ -559,8 +559,8 @@
 {
   irnet_socket *	ap = (struct irnet_socket *) file->private_data;
 
-  DPASS(FS_TRACE, "(file=0x%X, ap=0x%X, count=%d)\n",
-	(unsigned int) file, (unsigned int) ap, count);
+  DPASS(FS_TRACE, "(file=0x%p, ap=0x%p, count=%Zd)\n",
+	file, ap, count);
   DABORT(ap == NULL, -ENXIO, FS_ERROR, "ap is NULL !!!\n");
 
   /* If we are connected to ppp_generic, let it handle the job */
@@ -581,8 +581,8 @@
   irnet_socket *	ap = (struct irnet_socket *) file->private_data;
   unsigned int		mask;
 
-  DENTER(FS_TRACE, "(file=0x%X, ap=0x%X)\n",
-	 (unsigned int) file, (unsigned int) ap);
+  DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n",
+	 file, ap);
 
   mask = POLLOUT | POLLWRNORM;
   DABORT(ap == NULL, mask, FS_ERROR, "ap is NULL !!!\n");
@@ -611,8 +611,8 @@
   int			err;
   int			val;
 
-  DENTER(FS_TRACE, "(file=0x%X, ap=0x%X, cmd=0x%X)\n",
-	 (unsigned int) file, (unsigned int) ap, cmd);
+  DENTER(FS_TRACE, "(file=0x%p, ap=0x%p, cmd=0x%X)\n",
+	 file, ap, cmd);
 
   /* Basic checks... */
   DASSERT(ap != NULL, -ENXIO, PPP_ERROR, "ap is NULL...\n");
@@ -777,8 +777,8 @@
   int			islcp;		/* Protocol == LCP */
   int			needaddr;	/* Need PPP address */
 
-  DENTER(PPP_TRACE, "(ap=0x%X, skb=0x%X)\n",
-	 (unsigned int) ap, (unsigned int) skb);
+  DENTER(PPP_TRACE, "(ap=0x%p, skb=0x%p)\n",
+	 ap, skb);
 
   /* Extract PPP protocol from the frame */
   data  = skb->data;
@@ -845,8 +845,8 @@
   irnet_socket *	self = (struct irnet_socket *) chan->private;
   int			ret;
 
-  DENTER(PPP_TRACE, "(channel=0x%X, ap/self=0x%X)\n",
-	 (unsigned int) chan, (unsigned int) self);
+  DENTER(PPP_TRACE, "(channel=0x%p, ap/self=0x%p)\n",
+	 chan, self);
 
   /* Check if things are somewhat valid... */
   DASSERT(self != NULL, 0, PPP_ERROR, "Self is NULL !!!\n");
@@ -949,8 +949,8 @@
   int			val;
   u32			accm[8];
 
-  DENTER(PPP_TRACE, "(channel=0x%X, ap=0x%X, cmd=0x%X)\n",
-	 (unsigned int) chan, (unsigned int) ap, cmd);
+  DENTER(PPP_TRACE, "(channel=0x%p, ap=0x%p, cmd=0x%X)\n",
+	 chan, ap, cmd);
 
   /* Basic checks... */
   DASSERT(ap != NULL, -ENXIO, PPP_ERROR, "ap is NULL...\n");
diff -urN linux-2.5.72-bk3/net/irda/irttp.c linux-2.5.72-bk4/net/irda/irttp.c
--- linux-2.5.72-bk3/net/irda/irttp.c	2003-06-16 21:20:06.000000000 -0700
+++ linux-2.5.72-bk4/net/irda/irttp.c	2003-06-23 04:46:30.000000000 -0700
@@ -1408,7 +1408,7 @@
 	spin_lock_irqsave(&irttp->tsaps->hb_spinlock, flags);
 
 	/* Find the old instance */
-	if (!hashbin_find(irttp->tsaps, (int) orig, NULL)) {
+	if (!hashbin_find(irttp->tsaps, (long) orig, NULL)) {
 		IRDA_DEBUG(0, "%s(), unable to find TSAP\n", __FUNCTION__);
 		spin_unlock_irqrestore(&irttp->tsaps->hb_spinlock, flags);
 		return NULL;
diff -urN linux-2.5.72-bk3/scripts/kconfig/mconf.c linux-2.5.72-bk4/scripts/kconfig/mconf.c
--- linux-2.5.72-bk3/scripts/kconfig/mconf.c	2003-06-16 21:19:44.000000000 -0700
+++ linux-2.5.72-bk4/scripts/kconfig/mconf.c	2003-06-23 04:46:30.000000000 -0700
@@ -492,7 +492,7 @@
 			switch (type) {
 			case 'm':
 				if (single_menu_mode)
-					submenu->data = (void *) !submenu->data;
+					submenu->data = (void *) (long) !submenu->data;
 				else
 					conf(submenu);
 				break;
diff -urN linux-2.5.72-bk3/sound/pci/korg1212/korg1212.c linux-2.5.72-bk4/sound/pci/korg1212/korg1212.c
--- linux-2.5.72-bk3/sound/pci/korg1212/korg1212.c	2003-06-16 21:19:39.000000000 -0700
+++ linux-2.5.72-bk4/sound/pci/korg1212/korg1212.c	2003-06-23 04:46:30.000000000 -0700
@@ -2070,7 +2070,7 @@
 	snd_iprintf(buffer, korg1212->card->longname);
 	snd_iprintf(buffer, " (index #%d)\n", korg1212->card->number + 1);
 	snd_iprintf(buffer, "\nGeneral settings\n");
-	snd_iprintf(buffer, "    period size: %d bytes\n", K1212_PERIOD_BYTES);
+	snd_iprintf(buffer, "    period size: %Zd bytes\n", K1212_PERIOD_BYTES);
 	snd_iprintf(buffer, "     clock mode: %s\n", clockSourceName[korg1212->clkSrcRate] );
 	snd_iprintf(buffer, "  left ADC Sens: %d\n", korg1212->leftADCInSens );
 	snd_iprintf(buffer, " right ADC Sens: %d\n", korg1212->rightADCInSens );
@@ -2336,7 +2336,7 @@
 	korg1212->sharedBufferPhy = (unsigned long)phys_addr;
 
         if (korg1212->sharedBufferPtr == NULL) {
-		snd_printk(KERN_ERR "can not allocate shared buffer memory (%d bytes)\n", sizeof(KorgSharedBuffer));
+		snd_printk(KERN_ERR "can not allocate shared buffer memory (%Zd bytes)\n", sizeof(KorgSharedBuffer));
                 return -ENOMEM;
         }
 
@@ -2385,9 +2385,12 @@
 
         korg1212->dspCodeSize = sizeof (dspCode);
 
-        korg1212->VolumeTablePhy = (u32) &((KorgSharedBuffer *) korg1212->sharedBufferPhy)->volumeData;
-        korg1212->RoutingTablePhy = (u32) &((KorgSharedBuffer *) korg1212->sharedBufferPhy)->routeData;
-        korg1212->AdatTimeCodePhy = (u32) &((KorgSharedBuffer *) korg1212->sharedBufferPhy)->AdatTimeCode;
+        korg1212->VolumeTablePhy = korg1212->sharedBufferPhy +
+		offsetof(KorgSharedBuffer, volumeData);
+        korg1212->RoutingTablePhy = korg1212->sharedBufferPhy +
+		offsetof(KorgSharedBuffer, routeData);
+        korg1212->AdatTimeCodePhy = korg1212->sharedBufferPhy +
+		offsetof(KorgSharedBuffer, AdatTimeCode);
 
         korg1212->dspMemPtr = snd_malloc_pci_pages(korg1212->pci, korg1212->dspCodeSize, &phys_addr);
 	korg1212->dspMemPhy = (u32)phys_addr;
diff -urN linux-2.5.72-bk3/usr/gen_init_cpio.c linux-2.5.72-bk4/usr/gen_init_cpio.c
--- linux-2.5.72-bk3/usr/gen_init_cpio.c	2003-06-16 21:20:06.000000000 -0700
+++ linux-2.5.72-bk4/usr/gen_init_cpio.c	2003-06-23 04:46:30.000000000 -0700
@@ -56,7 +56,7 @@
 	const char *name = "TRAILER!!!";
 
 	sprintf(s, "%s%08X%08X%08lX%08lX%08X%08lX"
-	       "%08X%08X%08X%08X%08X%08X%08X",
+	       "%08X%08X%08X%08X%08X%08ZX%08X",
 		"070701",		/* magic */
 		0,			/* ino */
 		0,			/* mode */
@@ -87,7 +87,7 @@
 	time_t mtime = time(NULL);
 
 	sprintf(s,"%s%08X%08X%08lX%08lX%08X%08lX"
-	       "%08X%08X%08X%08X%08X%08X%08X",
+	       "%08X%08X%08X%08X%08X%08ZX%08X",
 		"070701",		/* magic */
 		ino++,			/* ino */
 		S_IFDIR | mode,		/* mode */
@@ -119,7 +119,7 @@
 		mode |= S_IFCHR;
 
 	sprintf(s,"%s%08X%08X%08lX%08lX%08X%08lX"
-	       "%08X%08X%08X%08X%08X%08X%08X",
+	       "%08X%08X%08X%08X%08X%08ZX%08X",
 		"070701",		/* magic */
 		ino++,			/* ino */
 		mode,			/* mode */
@@ -176,7 +176,7 @@
 	}
 
 	sprintf(s,"%s%08X%08X%08lX%08lX%08X%08lX"
-	       "%08X%08X%08X%08X%08X%08X%08X",
+	       "%08X%08X%08X%08X%08X%08ZX%08X",
 		"070701",		/* magic */
 		ino++,			/* ino */
 		mode,			/* mode */
