# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	v2.6.2-rc1 -> 1.1517 
#	include/asm-x86_64/dwarf2.h	1.1     -> 1.2    
#	drivers/scsi/megaraid.c	1.58    -> 1.59   
#	arch/sparc64/kernel/smp.c	1.64    -> 1.65   
#	drivers/block/paride/Kconfig	1.2     -> 1.3    
#	drivers/atm/horizon.c	1.13    -> 1.14   
#	drivers/usb/input/hid.h	1.27.1.2 -> 1.29   
#	drivers/base/firmware_class.c	1.6     -> 1.7    
#	arch/x86_64/kernel/traps.c	1.31    -> 1.32   
#	arch/x86_64/mm/fault.c	1.19    -> 1.20   
#	  net/ipv6/anycast.c	1.9     -> 1.10   
#	arch/x86_64/ia32/ia32_binfmt.c	1.19    -> 1.20   
#	     net/core/flow.c	1.16    -> 1.18   
#	drivers/message/i2o/Kconfig	1.5     -> 1.6    
#	  net/ipv6/exthdrs.c	1.13    -> 1.14   
#	arch/i386/kernel/apm.c	1.59    -> 1.60   
#	drivers/usb/input/wacom.c	1.31    -> 1.32   
#	arch/x86_64/kernel/vmlinux.lds.S	1.20    -> 1.21   
#	Documentation/video4linux/bttv/README	1.5     -> 1.6    
#	net/ipv6/ip6_output.c	1.48    -> 1.49   
#	arch/x86_64/lib/usercopy.c	1.7     -> 1.8    
#	net/ipv6/ip6_tunnel.c	1.15    -> 1.16   
#	 fs/xfs/xfs_itable.c	1.6     -> 1.7    
#	arch/x86_64/kernel/acpi/sleep.c	1.1     -> 1.2    
#	drivers/input/serio/i8042.c	1.35.1.3 -> 1.39   
#	 net/ipv6/datagram.c	1.12    -> 1.14   
#	Documentation/video4linux/bttv/CARDLIST	1.9     -> 1.10    Documentation/video4linux/CARDLIST.bttv (moved)
#	  drivers/md/Kconfig	1.7     -> 1.8    
#	Documentation/video4linux/bttv/Insmod-options	1.6     -> 1.7    
#	include/asm-x86_64/kdebug.h	1.4     -> 1.5    
#	arch/i386/kernel/cpu/mcheck/non-fatal.c	1.7     -> 1.8    
#	drivers/md/raid6mmx.c	1.1     -> 1.2    
#	   arch/i386/Kconfig	1.96    -> 1.98   
#	drivers/cdrom/cdrom.c	1.44    -> 1.45   
#	arch/x86_64/kernel/x8664_ksyms.c	1.20    -> 1.21   
#	    drivers/atm/he.c	1.23    -> 1.25   
#	         init/main.c	1.116   -> 1.117  
#	drivers/md/raid6recov.c	1.1     -> 1.2    
#	drivers/net/irda/sir_dongle.c	1.4     -> 1.5    
#	Documentation/BK-usage/00-INDEX	1.1     -> 1.2    
#	 include/linux/cpu.h	1.8     -> 1.9    
#	    include/net/ah.h	1.2     -> 1.3    
#	drivers/md/raid6sse1.c	1.1     -> 1.2    
#	drivers/md/raid6test/Makefile	1.1     -> 1.2    
#	include/linux/blkdev.h	1.132   -> 1.133  
#	drivers/scsi/aacraid/aacraid.h	1.10    -> 1.11   
#	arch/i386/pci/direct.c	1.18    -> 1.19   
#	drivers/md/raid6test/test.c	1.1     -> 1.2    
#	drivers/input/mouse/psmouse-base.c	1.43.1.1 -> 1.46   
#	drivers/serial/serial_core.c	1.75    -> 1.78   
#	arch/i386/kernel/cpu/mtrr/if.c	1.9     -> 1.10   
#	drivers/media/video/w9966.c	1.11    -> 1.12   
#	arch/x86_64/kernel/i387.c	1.9     -> 1.10   
#	drivers/net/irda/tekram-sir.c	1.3     -> 1.4    
#	     drivers/md/md.c	1.196   -> 1.197  
#	include/asm-x86_64/ptrace.h	1.8     -> 1.9    
#	drivers/net/irda/sir_core.c	1.1     -> 1.2    
#	     net/ipv6/icmp.c	1.45    -> 1.46   
#	net/ipv6/reassembly.c	1.20    -> 1.21   
#	arch/sparc64/defconfig	1.110   -> 1.111  
#	drivers/input/keyboard/maple_keyb.c	1.4.1.1 -> 1.6    
#	drivers/input/mouse/synaptics.c	1.15    -> 1.16   
#	arch/x86_64/kernel/entry.S	1.15    -> 1.16   
#	drivers/input/keyboard/98kbd.c	1.2     -> 1.3    
#	arch/sparc64/mm/init.c	1.52    -> 1.53   
#	arch/i386/kernel/dmi_scan.c	1.49    -> 1.51   
#	arch/sparc64/kernel/head.S	1.21    -> 1.22   
#	drivers/scsi/aacraid/linit.c	1.23    -> 1.24   
#	      net/ipv6/raw.c	1.46    -> 1.47   
#	drivers/char/keyboard.c	1.38.1.1 -> 1.42   
#	drivers/usb/input/hid-input.c	1.20.1.1 -> 1.22   
#	drivers/usb/input/hiddev.c	1.41.1.1 -> 1.43   
#	arch/x86_64/ia32/sys_ia32.c	1.47    -> 1.48   
#	arch/x86_64/kernel/pci-gart.c	1.25    -> 1.26   
#	include/linux/input.h	1.40.1.1 -> 1.44   
#	 drivers/net/dummy.c	1.7     -> 1.8    
#	arch/x86_64/ia32/ia32entry.S	1.27    -> 1.28   
#	drivers/net/irda/Makefile	1.19    -> 1.20   
#	arch/x86_64/lib/thunk.S	1.2     -> 1.3    
#	drivers/video/console/Makefile	1.15    -> 1.16   
#	  fs/xfs/xfs_iomap.h	1.1     -> 1.2    
#	drivers/net/8139cp.c	1.58    -> 1.59   
#	drivers/usb/input/hid-ff.c	1.4     -> 1.5    
#	arch/alpha/kernel/signal.c	1.19    -> 1.20   
#	drivers/video/aty/aty128fb.c	1.40    -> 1.41   
#	drivers/input/joydev.c	1.20.1.1 -> 1.23   
#	 drivers/pnp/Kconfig	1.6     -> 1.7    
#	include/asm-alpha/elf.h	1.6     -> 1.7    
#	drivers/ide/Makefile	1.14    -> 1.15   
#	security/selinux/netif.c	1.1     -> 1.2    
#	drivers/scsi/aha1542.c	1.31    -> 1.32   
#	drivers/net/irda/sir-dev.h	1.2     -> 1.3    
#	fs/xfs/xfs_log_recover.c	1.37    -> 1.38   
#	include/linux/apm_bios.h	1.7     -> 1.8    
#	  arch/ppc64/Kconfig	1.37    -> 1.38   
#	arch/x86_64/kernel/process.c	1.22    -> 1.23   
#	 net/ipv6/af_inet6.c	1.59    -> 1.60   
#	include/asm-x86_64/mc146818rtc.h	1.2     -> 1.3    
#	include/asm-x86_64/timex.h	1.9     -> 1.10   
#	drivers/usb/input/hid-core.c	1.67.1.1 -> 1.71   
#	include/asm-x86_64/vsyscall32.h	1.1     -> 1.2    
#	include/linux/skbuff.h	1.38    -> 1.39   
#	drivers/net/irda/actisys-sir.c	1.3     -> 1.4    
#	    net/ipv6/ndisc.c	1.63    -> 1.64   
#	         MAINTAINERS	1.190   -> 1.191  
#	     net/sctp/ipv6.c	1.49    -> 1.50   
#	drivers/net/irda/sir_dev.c	1.9     -> 1.10   
#	arch/sparc64/kernel/sys_sparc32.c	1.84    -> 1.86   
#	drivers/input/mouse/logips2pp.c	1.4     -> 1.5    
#	include/asm-x86_64/calling.h	1.6     -> 1.7    
#	arch/x86_64/kernel/sys_x86_64.c	1.11    -> 1.12   
#	            Makefile	1.447   -> 1.448  
#	 arch/i386/defconfig	1.102   -> 1.103  
#	include/asm-x86_64/unistd.h	1.19    -> 1.20   
#	arch/x86_64/kernel/time.c	1.27    -> 1.28   
#	arch/x86_64/defconfig	1.29    -> 1.30   
#	      net/ipv6/ah6.c	1.25    -> 1.26   
#	drivers/md/raid6x86.h	1.1     -> 1.2    
#	arch/x86_64/kernel/acpi/wakeup.S	1.3     -> 1.4    
#	include/asm-x86_64/thread_info.h	1.13    -> 1.14   
#	arch/ppc64/kernel/sys_ppc32.c	1.75    -> 1.76   
#	drivers/video/logo/Makefile	1.3     -> 1.4    
#	drivers/ide/pci/pdc202xx_new.c	1.20    -> 1.21   
#	drivers/net/irda/Kconfig	1.12    -> 1.13   
#	    net/ipv6/route.c	1.62    -> 1.63   
#	drivers/usb/media/w9968cf.c	1.2     -> 1.3    
#	 drivers/pcmcia/ds.c	1.39    -> 1.43   
#	drivers/usb/input/hid-lgff.c	1.5     -> 1.6    
#	drivers/net/tulip/xircom_cb.c	1.18    -> 1.19   
#	drivers/net/irda/esi-sir.c	1.2     -> 1.3    
#	include/net/addrconf.h	1.13    -> 1.14   
#	 arch/x86_64/Kconfig	1.39    -> 1.40   
#	drivers/input/keyboard/atkbd.c	1.42.1.1 -> 1.48   
#	drivers/net/irda/sir_kthread.c	1.9     -> 1.10   
#	  net/ipv6/ip6_fib.c	1.21    -> 1.22   
#	include/asm-x86_64/system.h	1.17    -> 1.18   
#	drivers/scsi/aic7xxx/aicasm/Makefile	1.11    -> 1.12   
#	    net/ipv6/mcast.c	1.48    -> 1.49   
#	drivers/char/drm/Kconfig	1.9     -> 1.10   
#	arch/sparc64/Kconfig	1.44    -> 1.45   
#	      net/ipv4/ah4.c	1.28    -> 1.29   
#	drivers/input/mouse/psmouse.h	1.4     -> 1.5    
#	include/asm-x86_64/proto.h	1.15    -> 1.16   
#	arch/x86_64/Makefile	1.32    -> 1.33   
#	include/asm-x86_64/ia32.h	1.15    -> 1.16   
#	fs/xfs/linux/xfs_aops.c	1.56    -> 1.57   
#	drivers/scsi/Kconfig	1.48    -> 1.50   
#	drivers/media/dvb/ttusb-dec/ttusb_dec.c	1.10    -> 1.12   
#	drivers/input/keyboard/amikbd.c	1.13    -> 1.14   
#	include/asm-x86_64/scatterlist.h	1.3     -> 1.4    
#	arch/x86_64/kernel/ldt.c	1.11    -> 1.12   
#	arch/x86_64/kernel/pci-dma.c	1.7     -> 1.8    
#	 net/ipv6/addrconf.c	1.86    -> 1.90   
#	arch/ppc/kernel/setup.c	1.49    -> 1.50   
#	   fs/compat_ioctl.c	1.15    -> 1.16   
#	  drivers/md/raid6.h	1.1     -> 1.2    
#	drivers/usb/input/usbkbd.c	1.32.1.1 -> 1.34   
#	drivers/video/radeonfb.c	1.34    -> 1.35   
#	include/asm-x86_64/hw_irq.h	1.9     -> 1.10   
#	arch/x86_64/ia32/ia32_signal.c	1.17    -> 1.18   
#	include/asm-x86_64/processor.h	1.25    -> 1.26   
#	drivers/md/raid6int.uc	1.1     -> 1.3    
#	arch/ppc/kernel/signal.c	1.28    -> 1.29   
#	arch/x86_64/mm/k8topology.c	1.6     -> 1.7    
#	     net/ipv4/igmp.c	1.44    -> 1.45   
#	drivers/scsi/aic7xxx/Makefile	1.23    -> 1.24   
#	arch/sparc64/kernel/traps.c	1.30    -> 1.31   
#	drivers/serial/sunzilog.c	1.39    -> 1.40   
#	arch/x86_64/ia32/ia32_aout.c	1.1     -> 1.2    
#	arch/i386/kernel/apic.c	1.49    -> 1.51   
#	drivers/macintosh/adbhid.c	1.16    -> 1.17   
#	drivers/md/raid6algos.c	1.1     -> 1.3    
#	include/asm-x86_64/desc.h	1.13    -> 1.14   
#	               (new)	        -> 1.1     Documentation/video4linux/CARDLIST.saa7134
#	               (new)	        -> 1.1     drivers/input/keyboard/hpps2atkbd.h
#	               (new)	        -> 1.1     drivers/net/irda/litelink-sir.c
#	               (new)	        -> 1.1     Documentation/video4linux/README.cx88
#	               (new)	        -> 1.1     drivers/net/irda/act200l-sir.c
#	               (new)	        -> 1.1     Documentation/video4linux/README.saa7134
#	               (new)	        -> 1.1     drivers/net/irda/girbil-sir.c
#	               (new)	        -> 1.1     Documentation/video4linux/CARDLIST.tuner
#	               (new)	        -> 1.1     drivers/net/irda/ma600-sir.c
#	               (new)	        -> 1.1     Documentation/video4linux/README.ir
#	               (new)	        -> 1.1     Documentation/BK-usage/cpcset
#	               (new)	        -> 1.1     drivers/net/irda/mcp2120-sir.c
#	               (new)	        -> 1.1     drivers/net/irda/old_belkin-sir.c
#	               (new)	        -> 1.1     Documentation/BK-usage/gcapatch
#	               (new)	        -> 1.1     include/asm-x86_64/hpet.h
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/01/20	torvalds@home.osdl.org	1.1494.2.75
# Linux 2.6.2-rc1
# --------------------------------------------
# 04/01/20	torvalds@home.osdl.org	1.1494.2.76
# Merge bk://are.twiddle.net/axp-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/20	davem@nuts.ninka.net	1.1494.9.1
# [SPARC64]: Fix 32-bit execve out_mm error path.
# 
# Do not pass a NULL mm to mmdrop().
# --------------------------------------------
# 04/01/21	davem@nuts.ninka.net	1.1494.9.2
# [TTUSB]: ttusb_dec.c needs linux/init.h
# --------------------------------------------
# 04/01/21	vojtech@ucw.cz	1.1494.2.77
# Merge ucw.cz:/home/vojtech/bk/linus into ucw.cz:/home/vojtech/bk/input
# --------------------------------------------
# 04/01/21	davem@nuts.ninka.net	1.1494.9.3
# [SPARC64]: Update defconfig.
# --------------------------------------------
# 04/01/21	davem@kernel.bkbits.net	1.1494.10.1
# Merge davem@nuts.ninka.net:/disk1/davem/BK/sparc-2.6
# into kernel.bkbits.net:/home/davem/sparc-2.6
# --------------------------------------------
# 04/01/21	dtor_core@ameritech.net	1.1494.2.78
# input: Allow Synaptics packet rate to be controlled by the
#        psmouse_rate= option.
# --------------------------------------------
# 04/01/21	dtor_core@ameritech.net	1.1494.2.79
# input: If we get a byte with timeout or parity flags in psmouse.c,
#        we take the appropriate action. (throw the byte away, reset
#        byte counter, return NAK if acking, and complain).
# --------------------------------------------
# 04/01/21	torvalds@home.osdl.org	1.1494.2.80
# Merge bk://kernel.bkbits.net/davem/sparc-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/21	kraxel@bytesex.org	1.1494.2.81
# [PATCH] selinux build fix
# 
# trivial one: uses __init and thus needs linux/init.h
# --------------------------------------------
# 04/01/21	kraxel@bytesex.org	1.1494.2.82
# [PATCH] video4linux driver documentation update
# 
# This updates / adds documentation for the bttv, saa7134 and cx88
# video4linux drivers.
# --------------------------------------------
# 04/01/21	davej@redhat.com	1.1494.2.83
# [PATCH] Check for MCE ability before checking registers.
# 
# Here's a novel idea, check the CPU has machine check capabilities
# before we start polling registers.
# 
# I was wondering why my VIA C3 was starting this.  Who knows it may solve
# some of the random crashes I saw there.
# --------------------------------------------
# 04/01/21	trini@kernel.crashing.org	1.1494.2.84
# [PATCH] Elvis^H^H^H^H^HPaul has left the building
# 
# > Paul Mackerras:
# >   o sort exception tables
# 
# And as more proof that Paul is leaving us ppc32 folks, *sniff*, the
# following is needed for PPC32 to compile:
# --------------------------------------------
# 04/01/21	akpm@osdl.org	1.1494.2.85
# [NET]: Do not mark dummy_free_one() __exit in dummy.c driver.
# --------------------------------------------
# 04/01/21	vnourval@tcs.hut.fi	1.1494.2.86
# [IPV6]: Fix link-local address check in datagram.c
# --------------------------------------------
# 04/01/21	shemminger@osdl.org	1.1494.2.87
# [IPV6]: More missing sysctl table sentinels in addrconf.c
# --------------------------------------------
# 04/01/21	krkumar@us.ibm.com	1.1494.2.88
# [IPV6]: Explicity set *dst to NULL at top of ip6_dst_lookup().
# --------------------------------------------
# 04/01/21	chas@cmf.nrl.navy.mil	1.1494.2.89
# [ATM]: [horizon] avoid warning about limited range of data type
# --------------------------------------------
# 04/01/21	davem@nuts.ninka.net	1.1494.11.1
# [SPARC64]: Add missing sched_balance_exec() to 32-bit compat execve().
# --------------------------------------------
# 04/01/21	vnourval@tcs.hut.fi	1.1494.2.90
# [IPV6]: Add and use new 'strict' parameter to ip6_chk_addr().
# 
# RFC 2461 requires that the source address of Neighbor Discovery messages
# is an address assigned to the sending interface.
# 
# Duplicate Address Detection should also be interface specific. We don't,
# for example, want a node to DoS itself just because it has two interfaces
# on the same link and both happen to listen to the same multicast group. If
# there is a true duplicate on the link, the interface doing DAD will notice
# it anyway.
# 
# The attached patch adds a 'strict' parameter to ip6_chk_addr() and
# ip6_get_ifaddr() to allow link-local protocols like ND and DAD to do
# strict address checks even on addresses with greater scope than
# link-local.
# --------------------------------------------
# 04/01/22	torvalds@home.osdl.org	1.1494.2.91
# Merge bk://kernel.bkbits.net/davem/sparc-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/22	akpm@osdl.org	1.1494.2.92
# [PATCH] RAID-6 fixes
# 
# From: "H. Peter Anvin" <hpa@zytor.com>
# 
# As expected, when it hit mainline I started getting real bug reports... 
# the attached patch does the following:
# 
# - Fixes a few x86-64 specific bugs;
# 
# - Removes MMX and SSE-1 from x86-64 (if we have x86-64 we have SSE-2);
# 
# - Slightly astracts the integer code to make it easier to add
#   architecture-specific optimizations later (e.g.  IA64 once gcc gets
#   better IA64 intrinsics support);
# 
# - Resurrects the user-space testbench, and makes it not output the known
#   false positive of the D+Q case (D+Q is equivalent to a RAID-5 recovery,
#   so I didn't implement it in the user-space testbench.)
# --------------------------------------------
# 04/01/22	akpm@osdl.org	1.1494.2.93
# [PATCH] document RAID-6 support in mdadm-1.5.0
# 
# From: "H. Peter Anvin" <hpa@zytor.com>
# 
# This is purely a doc patch saying RAID-6 support is available in
# mdadm-1.5.0 and the patch is no longer necessary.
# --------------------------------------------
# 04/01/22	akpm@osdl.org	1.1494.2.94
# [PATCH] ppc64: add missing sched_balance_exec() call
# 
# From: Anton Blanchard <anton@samba.org>
# 
# We were missing the sched_balance_exec call.  Could explain some NUMA
# scheduling weirdness we were seeing.
# --------------------------------------------
# 04/01/22	akpm@osdl.org	1.1494.2.95
# [PATCH] ppc64: include i2c in config
# 
# ppc64 doesn't use drivers/Kconfig (it should) so it needs to include i2c by
# hand.
# --------------------------------------------
# 04/01/22	torvalds@home.osdl.org	1.1494.2.96
# Merge bk://bk.arm.linux.org.uk/linux-2.6-pcmcia
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/22	vnourval@tcs.hut.fi	1.1494.12.1
# [IPV6]: addrconf_sysctl_forward_strategy() needs to invoke rt6_purge_dflt_routers() too.
# --------------------------------------------
# 04/01/22	torvalds@home.osdl.org	1.1494.2.97
# Fix APIC timer initialization.
# 
# We used to write fields that were marked RESERVED and that
# are apparently some old stale timer base. Stop doing that.
# 
# Verified with Mikael Pettersson, and confirmed to fix ACPI
# boot-time lockups for a few people. 
# --------------------------------------------
# 04/01/22	rusty@rustcorp.com.au	1.1494.12.2
# [NET]: Simplify net/flow.c per-cpu handling.
# 
# The cpu handling in net/core/flow.c is complex: it tries to allocate
# flow cache as each CPU comes up.  It might as well allocate them for
# each possible CPU at boot.
# --------------------------------------------
# 04/01/22	mikpe@user.it.uu.se	1.1494.2.98
# [PATCH] non-integrated local APIC LVTT init compatibility
# 
# Add back the old i82489DX bits to use timer scaling for the old
# non-integrated APIC setup. 
# 
# It's possible these bits don't need to be set on i82489DXs,
# but not having this HW for testing I elected to maintain
# the old behaviour on these old machines.
# --------------------------------------------
# 04/01/22	bcollins@debian.org	1.1494.1.5
# Merge http://linux.bkbits.net/linux-2.5
# into debian.org:/usr/src/kernel/sparc-2.6
# --------------------------------------------
# 04/01/22	torvalds@home.osdl.org	1.1494.2.99
# Merge bk://kernel.bkbits.net/davem/net-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/23	roehrich@sgi.com	1.1494.13.1
# [XFS] In xfs_bulkstat, we need to do the readahead loop always.
# 
# SGI Modid: xfs-linux:xfs-kern:164517a
# --------------------------------------------
# 04/01/23	sandeen@sgi.com	1.1494.13.2
# [XFS] Fix for large allocation groups, so that extent
# sizes will not overflow pagebuf lengths.
# 
# SGI Modid: xfs-linux:xfs-kern:164827a
# --------------------------------------------
# 04/01/23	bcollins@debian.org	1.1496
# Merge http://linux.bkbits.net/linux-2.5
# into debian.org:/usr/src/kernel/linux-2.6
# --------------------------------------------
# 04/01/23	akpm@osdl.org	1.1494.2.100
# [PATCH] LSI Logic MegaRAID3 PCI ID
# 
# From: Chris Meadors <clubneon@hereintown.net>
# 
# Add a missing PCI ID.
# --------------------------------------------
# 04/01/23	akpm@osdl.org	1.1494.2.101
# [PATCH] RAID-6 fix for IA-64
# 
# From: "H. Peter Anvin" <hpa@transmeta.com>
# 
# Fix for RAID-6 on IA-64, from Bjorn Helgaas, and verified by me.
# --------------------------------------------
# 04/01/23	akpm@osdl.org	1.1494.2.102
# [PATCH] ppc32: Fixes to the signal context code
# 
# From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
# 
# This patch (which has been in my tree for some time now) does 2 things to
# the ppc32 signal code:
# 
# - The new sys_swapcontext() syscall that we added recently (and which is
#   _not_ yet used by glibc, so it's ok to change it slightly at this point,
#   glibc kernel version check will limit us to 2.6.2 or 2.6.3) gets a new
#   context size argument, so we can deal with future context size changes.
# 
# - When ucontext is get/set/swapped using the above syscall, the TLS (r2)
#   is preserved (it's still saved/restored on signal entry & return though).
# 
# The equivalent of this patch is already in the ppc64 signal32.c emulation,
# and it has no effect until glibc is updated to use the new syscall, which
# should happen soon now, so please apply.
# --------------------------------------------
# 04/01/23	akpm@osdl.org	1.1494.2.103
# [PATCH] Fix rq_for_each_bio() macro again
# 
# From: Rusty Russell <rusty@rustcorp.com.au>
# 
# Looks like an obvious typo.  Works fine if "bio" is the name of the
# iterator.
# --------------------------------------------
# 04/01/23	torvalds@home.osdl.org	1.1494.2.104
# Merge http://xfs.org:8090/xfs-linux-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.105
# [PATCH] PCI probing typo
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.106
# [PATCH] OOSTORE needs MTRR.
# 
# The centaur CPU init code gets linking errors without it.
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.107
# [PATCH] Reduce stack usage in w9966 driver.
# 
# 2KB onstack allocation. Nasty.
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.108
# [PATCH] Restore 2.4 MTRR feature.
# 
# If the CPU doesn't support MTRRs, don't create a /proc/mtrr
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.109
# [PATCH] logic error in aty128fb
# 
# Negate the expression not the register seems more sensible?
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.110
# [PATCH] Remove unused CONFIG symbol.
# 
# Grep of the tree only turned up these two uses.
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.111
# [PATCH] Reduce stack usage in ttusb driver.
# 
# ARM_PACKET_SIZE is 4KB. Ouch.
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.112
# [PATCH] Correct CPUs printout on boot.
# 
# This currently prints out the maximum number of CPUs the
# kernel is configured to support, instead of the actual
# number that the kernel brought up. Which results in odd
# displays that look like you have more CPUs than you do.
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.113
# [PATCH] Remove useless cruft from ATM HE driver.
# 
# Echoing changes done in 2.4. (It now has a pci_pool_create backport).
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.114
# [PATCH] logic error in radeonfb.
# 
# Looks like another instance of a ! in the wrong place.
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.115
# [PATCH] logic error in XFS
# 
# Yet another misplaced ! by the looks..
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.116
# [PATCH] DMI updates from 2.4
# 
# A lot of the blacklists never made it forward, here's what I found
# still lying around in my old 2.5 tree when I brought it up to date.
# 
# I think 2.4 has had more updates since then (and there may be
# some entries languishing in vendor 2.4 trees), I'll take a peek
# when I get some spare cycles.
# --------------------------------------------
# 04/01/23	davej@redhat.com	1.1494.2.117
# [PATCH] Update post-halloween doc url.
# 
# I did a s/2.5/2.6/ a while ago, as it made more sense when 2.6 appeared.
# The old URL will continue to work (symlink to the new file).  If I move
# this again, whack me.
# --------------------------------------------
# 04/01/23	torvalds@home.osdl.org	1.1494.2.118
# Fix up he.c misuse of pci_pool_create() that
# slipped in.
# --------------------------------------------
# 04/01/23	akpm@osdl.org	1.1494.2.119
# [PATCH] md: Fix possible hang in raid shutdown.
# 
# From: NeilBrown <neilb@cse.unsw.edu.au>
# 
# If a raid array was syncing on shutdown, it would hang on shutdown,
# constantly re-entering md_enter_safemade.  This fixes it.
# --------------------------------------------
# 04/01/23	torvalds@home.osdl.org	1.1497
# Merge bk://bk.phunnypharm.org/linux-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/23	akpm@osdl.org	1.1498
# [PATCH] Fix CPU hotplug in networking
# 
# The code directly accessed the "cpucontrol" semaphore used
# for CPU hotplug. That doesn't work all that well, since the
# semaphore doesn't even exist on UP.
# --------------------------------------------
# 04/01/23	bcollins@debian.org	1.1494.1.6
# [SUNZILOG]: Fix locking in cases where UART layer has grabbed the lock already.
# --------------------------------------------
# 04/01/23	davem@nuts.ninka.net	1.1499
# Merge nuts.ninka.net:/disk1/davem/BK/sparcwork-2.6
# into nuts.ninka.net:/disk1/davem/BK/sparc-2.6
# --------------------------------------------
# 04/01/23	axboe@suse.de	1.1498.1.1
# [PATCH] remove mt rainier warning
# 
# A debug printk was left in there by mistake, it'll get printed for every
# non-mrw drive. So kill it.
# --------------------------------------------
# 04/01/23	hunold@convergence.de	1.1498.1.2
# [PATCH] Fix up 'linux-dvb' maintainers entry
# 
# We've created a new e-mail address which is currently an open
# mailing-list anybody can subscribe to. 
# 
# It's currently watched by the main developers.  If spam takes over the
# list, we might change it to "moderated" or even route it to one single
# person.
# --------------------------------------------
# 04/01/23	jt@bougret.hpl.hp.com	1.1498.2.1
# [IRDA]: Update dongle api.
# 
# From Martin Diehl.
# 
# * change dongle api such that raw r/w and modem line helpers are directly
#   called, not virtual callbacks.
# --------------------------------------------
# 04/01/23	jt@bougret.hpl.hp.com	1.1498.2.2
# [IRDA]: Update actisys-sir driver.
# 
# From Martin Diehl.
# 
# * convert to de-virtualized sirdev helpers
# * improve error path during speed change
# --------------------------------------------
# 04/01/23	jt@bougret.hpl.hp.com	1.1498.2.3
# [IRDA]: Update esr-sir driver.
# 
# From Martin Diehl.
# 
# * convert to de-virtualized sirdev helpers
# * add probably missing dongle power-up operation
# --------------------------------------------
# 04/01/23	jt@bougret.hpl.hp.com	1.1498.2.4
# [IRDA]: Update tekram-sir driver.
# 
# From Martin Diehl.
# 
# * increase default write-delay to 150msec
# * convert to de-virtualized sirdev helpers
# --------------------------------------------
# 04/01/23	jt@bougret.hpl.hp.com	1.1498.2.5
# [IRDA]: Add litelink-sir driver.
# 
# From Eugene Crosser.
# 
# * converted for new api from old driver
# 
# From Martin Diehl.
# 
# * convert to de-virtualized sirdev helpers
# * set dongle to 9600 in case of invalid speed instead leaving it in
#   unknown configuration
# --------------------------------------------
# 04/01/23	jt@bougret.hpl.hp.com	1.1498.2.6
# [IRDA]: Add act200l-sir driver.
# 
# From Martin Diehl.
# 
# * converted for new api from old driver
# --------------------------------------------
# 04/01/23	jt@bougret.hpl.hp.com	1.1498.2.7
# [IRDA]: Add girbil-sir driver.
# 
# From Martin Diehl.
# 
# * converted for new api from old driver
# --------------------------------------------
# 04/01/23	jt@bougret.hpl.hp.com	1.1498.2.8
# [IRDA]: Add ma600-sir driver.
# 
# From Martin Diehl.
# 
# * converted for new api from old driver
# --------------------------------------------
# 04/01/23	jt@bougret.hpl.hp.com	1.1498.2.9
# [IRDA]: Add mcp2120-sir driver.
# 
# From Martin Diehl.
# 
# * converted for new api from old driver
# --------------------------------------------
# 04/01/23	jt@bougret.hpl.hp.com	1.1498.2.10
# [IRDA]: Add old_belkin-sir driver.
# 
# From Martin Diehl.
# 
# * converted for new api from old driver
# --------------------------------------------
# 04/01/23	jt@bougret.hpl.hp.com	1.1498.2.11
# [IRDA]: Kconfig changes to enable new drivers into the build, from Martin Diehl.
# --------------------------------------------
# 04/01/24	markh@osdl.org	1.1494.14.1
# [PATCH] Fix for aacraid and high memory on 2.6.1
# 
# Here is an update to use pci_set_consistent_dma_mask.  But since
# dma_alloc_coherent uses dma_mask instead of consistent one, I left in
# setting dma_mask as well until the alloc routine changes.
# --------------------------------------------
# 04/01/24	jejb@mulgrave.(none)	1.1494.14.2
# drivers/scsi/Kconfig URL update: resource.cx
# 
# From: 	Petri Koistinen <petri.koistinen@iki.fi>
# --------------------------------------------
# 04/01/24	jejb@mulgrave.(none)	1.1494.14.3
# aic7xxx parallel build
# 
# From: 	Justin T. Gibbs <gibbs@scsiguy.com>
# --------------------------------------------
# 04/01/24	akpm@osdl.org	1.1494.14.4
# [PATCH] aha1542 warning fix
# 
# Fix this:
# 
# drivers/scsi/aha1542.c:74: warning: unsigned int format, different type arg (arg 5)
# --------------------------------------------
# 04/01/24	dlstevens@us.ibm.com	1.1498.3.1
# [MULTICAST]: multicast loop with include filters fix
# 
# When sending a multicast and using looping back a copy to the
# local machine, the interface filter checks can be done before the
# source address is specified. For an INCLUDE filter, this won't match
# the allowed sources and the packets won't be delivered locally,
# even when the ultimate source address chosen is in the allowed list.
# 
# The patch below fixes the filter checks for both IGMPv3 and MLDv2
# to only apply when a source address is available.
# 
# Thanks to Steven Hessing for reporting the problem and providing
# a test case for reproducing it.
# --------------------------------------------
# 04/01/24	bart@samwel.tk	1.1498.3.2
# [NET]: Return 'unsigned char *' from *skb_pull*() routines.
# --------------------------------------------
# 04/01/24	jmorris@redhat.com	1.1498.3.3
# [IPSEC]: Guard against potentially fatal stack usage for auth_data.
# --------------------------------------------
# 04/01/24	yoshfuji@linux-ipv6.org	1.1498.3.4
# [IPV6]: Fix several comment spelling errors and typos.
# --------------------------------------------
# 04/01/24	torvalds@home.osdl.org	1.1500
# Merge bk://kernel.bkbits.net/davem/sparc-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/24	ak@suse.de	1.1501
# [PATCH] x86-64 merge
# 
# Mainly lots of bug fixes and a few minor features. One change is that
# it uses drivers/Kconfig now like i386. This requires a few minor changes in
# outside Kconfig files which I am sending separately.
# 
#  - Tighten/fix some code in NUMA node discovery
#  - Fix oopses in threaded 32bit coredumps and read correct registers.
#  - Merge with 2.6.2rc1
#  - Sync arch/x86_64/Kconfig with i386. Uses drivers/Kconfig now.
#  - Remove bcopy export
#  - Fix check for signal stack for 32bit signals
#  - Fix bcopy and exit prototypes for gcc 3.4
#  - Fix asm contraint in usercopy.c for gcc 3.4
#  - Use rt_sigreturn, not sigreturn for rt sigreturns.
#  - Pass si_fault address to 32bit
#  - Truncate si_error to 16bit in 32bit emulation to match i386
#  - Move IA32 flag switching for 32bit executables to flush_thread
#    (code copied from ppc64/sparc64)
#  - Print exception trace for strace too, share code.
#  - Default to 3GB address space for a.out executables
#  - Fix security hole in ptrace. Also fixes some problems with 32bit gdb.
#  - Sync mmap address selection algorithm with mm/mmap.c version
#  - Disable a.out coredumps completely
#  - Fix bug in sigaltstack 32bit emulation. Kylix IDE now works.
#  - Move errata 93/BIOS workaround into fault handler.  This should work
#    around USB legacy BIOS bugs too, although not completely (we cannot fix
#    faults injected by SMM into user space 64bit processes)
#  - Quieten some unimplemented 32bit syscall warnings and avoid repeated
#    warnings.
#  - Set LDT segment limit correctly (fixes problems with some modify_ldt
#    user)
#  - Remove obsolete ldt rw lock.
#  - Remove sys32_modify_ldt. The standard sys_modify_ldt is equivalent.
#  - Remove traces of old kgdb support
#  - Merge CFI changes from Jim Houston and some other smaller changes The
#    kernel assembly functions are described with dwarf2 unwind
#    information now, which makes it easier for debuggers to make sense of
#    stack backtraces.  The code is only enabled with CONFIG_DEBUG_INFO.
#    Note this implies that when you use CONFIG_DEBUG_INFO you may need
#    an binutils update.
#  - defconfig updated
#  - Readd sleep support code (Pavel Machek)
#  - Drop fusion and flush workarounds from IOMMU code
#  - Add iommu=nofullflush option
#  - Rewrite 32bit emulation for siginfo conversion (Joe Korty)
#  - Allow remapping of scatterlists after unmap. This fixes some problems
#    with the SCSI layer retrying previously mapped sg lists when iommu
#    merging was enabled (it's disabled now by default)
#  - Port HPET rtc device emulation code from i386
# --------------------------------------------
# 04/01/24	ak@suse.de	1.1502
# [PATCH] Kconfig fixes for x86-64
# 
# x86-64 using drivers/Kconfig requires some minor changes. Mostly to disable drivers
# that do not work.
# 
# - Mark paride bpck6 not 64bit clean
# - Disable I2O on 64bit
# - Mark PNP dependent on ISA
# - Mark NSP32 driver as not 64bit clean
# --------------------------------------------
# 04/01/24	akpm@osdl.org	1.1503
# [PATCH] IDE build fix
# 
# From: Arkadiusz Miskiewicz <arekm@pld-linux.org>
# 
# Both drivers/ide/legacy and drivers/ide/ppc broke because they can no
# longer include drivers/ide/timing.h.  Fix.
# 
# (Acked by Bart)
# --------------------------------------------
# 04/01/24	akpm@osdl.org	1.1504
# [PATCH] pdc202xx_new.c: fix PDC20270/1 init on the Xserve Apple machines
# 
# From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
# 
# From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
# 
# Fix initialization of the PDC20270/1 chipsets on the Xserve Apple machines.
# --------------------------------------------
# 04/01/24	akpm@osdl.org	1.1505
# [PATCH] Array overindexing in w9968cf
# 
# From: Jean Delvare <khali@linux-fr.org>
# 
# There are 24 members of this array.
# --------------------------------------------
# 04/01/24	akpm@osdl.org	1.1506
# [PATCH] DMI update fix
# 
# From: Dave Jones <davej@redhat.com>
# 
# Fix typo in the recent 2.4 DMI sync-up.
# --------------------------------------------
# 04/01/24	akpm@osdl.org	1.1507
# [PATCH] The RAW_GETBIND compat_ioctl fails
# 
# From: James Cross <jscross@veritas.com>
# 
# The RAW_GETBIND compatibility ioctl call does convert properly between the
# 32bit/64bit version of raw_config_request due to a trivial error, and the
# ioctl call fails.
# --------------------------------------------
# 04/01/24	akpm@osdl.org	1.1508
# [PATCH] request_firmware(): use del_timer_sync()
# 
# Avoid a possible timer deletion race.
# --------------------------------------------
# 04/01/24	torvalds@home.osdl.org	1.1509
# Merge bk://linux-scsi.bkbits.net/scsi-for-linus-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/24	panagiotis.issaris@mech.kuleuven.ac.be	1.1510
# [PATCH] Graphire3 support
# 
# I got a Wacom Graphire3 for my birthday and unfortunately it didn't
# work. After some playing around, I noticed the 2.6 kernel needs a few
# small modifications to make it work.
# 
# This simple patch adds support for the Wacom Graphire 3.
# --------------------------------------------
# 04/01/24	hirofumi@mail.parknet.co.jp	1.1511
# [netdrvr 8139cp] fix NAPI race
# 
# Andreas Happe <andreashappe@gmx.net> writes:
# > my notebook (hp/compaq nx7000) still crashes when using 8139cp (runs
# > rock solid with 8139too driver). The computer just locks up, there is no
# > dmesg output. This has happened since I've got this laptop (around
# > november '03).
# 
# It seems 8139cp.c has the race condition of rx_poll and interrupt.
# 
# NOTE, since I don't have this device, patch is untested. Sorry.
# --------------------------------------------
# 04/01/24	shemminger@osdl.org	1.1512
# [PATCH] Make xircom cardbus handle shared irq
# 
# Current driver doesn't do shared irq properly.  When testing on
# a laptop here irq 3 get shared between pcmcia slot and tty/IRDA
# --------------------------------------------
# 04/01/24	torvalds@home.osdl.org	1.1510.1.1
# Merge bk://kernel.bkbits.net/davem/net-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/24	rmk@flint.arm.linux.org.uk	1.1498.4.1
# [SERIAL] Eliminate a couple of redundant tests
# 
# There is no way that tty can be NULL in uart_put_char() and
# uart_write().  Eliminate these redundant tests.
# --------------------------------------------
# 04/01/24	rmk@flint.arm.linux.org.uk	1.1498.4.2
# [SERIAL] Fix missing NULL check
# 
# tty->driver_data or state->port may end up being NULL in uart_close.
# Make sure that we correctly clean up in this case, rather than
# oopsing.
# --------------------------------------------
# 04/01/24	davem@kernel.bkbits.net	1.1510.1.2
# Merge davem@nuts.ninka.net:/disk1/davem/BK/irda-2.6
# into kernel.bkbits.net:/home/davem/irda-2.6
# --------------------------------------------
# 04/01/24	rmk@flint.arm.linux.org.uk	1.1498.4.3
# [SERIAL] Use tty_name() when printing the tty name.
# --------------------------------------------
# 04/01/24	torvalds@home.osdl.org	1.1513
# Merge bk://gkernel.bkbits.net/net-drivers-2.5
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/24	torvalds@home.osdl.org	1.1514
# Merge bk://kernel.bkbits.net/davem/irda-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/24	akpm@osdl.org	1.1515
# [PATCH] i8042 timer fix
# 
# From: Jim Collette <jim@hamachi.net>
# 
# There's an exit path in i8042_interrupt() which forgets to rearm the timer.
# It can make the mouse die when X is started.
# --------------------------------------------
# 04/01/24	torvalds@home.osdl.org	1.1516
# Merge bk://bk.arm.linux.org.uk/linux-2.6-serial
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/24	torvalds@home.osdl.org	1.1517
# Merge bk://gkernel.bkbits.net/misc-2.5
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
#
diff -Nru a/Documentation/BK-usage/00-INDEX b/Documentation/BK-usage/00-INDEX
--- a/Documentation/BK-usage/00-INDEX	Sat Jan 24 16:27:48 2004
+++ b/Documentation/BK-usage/00-INDEX	Sat Jan 24 16:27:48 2004
@@ -17,6 +17,14 @@
 which compresses its input, and then outputs the uu-/base64-encoded
 version of the compressed input.
 
+cpcset: Copy changeset between unrelated repositories.
+Attempts to preserve changeset user, user address, description, in
+addition to the changeset (the patch) itself.
+Typical usage:
+	cd my-updated-repo
+	bk changes	# looking for a changeset...
+	cpcset 1.1511 . ../another-repo
+
 csets-to-patches: Produces a delta of two BK repositories, in the form
 of individual files, each containing a single cset as a GNU patch.
 Output is several files, each with the filename "/tmp/rev-$REV.patch"
@@ -32,6 +40,11 @@
 	cd my-updated-repo
 	bk changes -L ~/repo/original-repo 2>&1 | \
 		perl cset-to-linus > summary.txt
+
+gcapatch:  Generates patch containing changes in local repository.
+Typical usage:
+	cd my-updated-repo
+	gcapatch > foo.patch
 
 unbz64wrap: Reverse an encoded, compressed data stream created by
 bz64wrap into an uncompressed, typically text/plain output.
diff -Nru a/Documentation/BK-usage/cpcset b/Documentation/BK-usage/cpcset
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/BK-usage/cpcset	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Purpose: Copy changeset patch and description from one
+#	   repository to another, unrelated one.
+#
+# usage:  cpcset [revision] [from-repository] [to-repository]
+#
+
+REV=$1
+FROM=$2
+TO=$3
+TMPF=/tmp/cpcset.$$
+
+rm -f $TMPF*
+
+CWD_SAVE=`pwd`
+cd $FROM
+bk changes -r$REV			|	\
+	grep -v '^ChangeSet'		|	\
+	sed -e 's/^  //g' > $TMPF.log
+
+USERHOST=`bk changes -r$REV | grep '^ChangeSet' | awk '{print $4}'`
+export BK_USER=`echo $USERHOST | awk '-F@' '{print $1}'`
+export BK_HOST=`echo $USERHOST | awk '-F@' '{print $2}'`
+
+bk export -tpatch -hdu -r$REV > $TMPF.patch && \
+cd $CWD_SAVE && \
+cd $TO && \
+bk import -tpatch -CFR -y"`cat $TMPF.log`" $TMPF.patch . && \
+bk commit -y"`cat $TMPF.log`"
+
+rm -f $TMPF*
+
+echo changeset $REV copied.
+echo ""
+
diff -Nru a/Documentation/BK-usage/gcapatch b/Documentation/BK-usage/gcapatch
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/BK-usage/gcapatch	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# Purpose: Generate GNU diff of local changes versus canonical top-of-tree
+#
+# Usage: gcapatch > foo.patch
+#
+
+bk export -tpatch -hdu -r`bk repogca bk://linux.bkbits.net/linux-2.5`,+
diff -Nru a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/CARDLIST.bttv	Sat Jan 24 16:27:48 2004
@@ -0,0 +1,115 @@
+card=0 -  *** UNKNOWN/GENERIC *** 
+card=1 - MIRO PCTV
+card=2 - Hauppauge (bt848)
+card=3 - STB, Gateway P/N 6000699 (bt848)
+card=4 - Intel Create and Share PCI/ Smart Video Recorder III
+card=5 - Diamond DTV2000
+card=6 - AVerMedia TVPhone
+card=7 - MATRIX-Vision MV-Delta
+card=8 - Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26
+card=9 - IMS/IXmicro TurboTV
+card=10 - Hauppauge (bt878)
+card=11 - MIRO PCTV pro
+card=12 - ADS Technologies Channel Surfer TV (bt848)
+card=13 - AVerMedia TVCapture 98
+card=14 - Aimslab Video Highway Xtreme (VHX)
+card=15 - Zoltrix TV-Max
+card=16 - Prolink Pixelview PlayTV (bt878)
+card=17 - Leadtek WinView 601
+card=18 - AVEC Intercapture
+card=19 - Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)
+card=20 - CEI Raffles Card
+card=21 - Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50
+card=22 - Askey CPH050/ Phoebe Tv Master + FM
+card=23 - Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878
+card=24 - Askey CPH05X/06X (bt878) [many vendors]
+card=25 - Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar
+card=26 - Hauppauge WinCam newer (bt878)
+card=27 - Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50
+card=28 - Terratec TerraTV+ Version 1.1 (bt878)
+card=29 - Imagenation PXC200
+card=30 - Lifeview FlyVideo 98 LR50
+card=31 - Formac iProTV, Formac ProTV I (bt848)
+card=32 - Intel Create and Share PCI/ Smart Video Recorder III
+card=33 - Terratec TerraTValue Version Bt878
+card=34 - Leadtek WinFast 2000/ WinFast 2000 XP
+card=35 - Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II
+card=36 - Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner
+card=37 - Prolink PixelView PlayTV pro
+card=38 - Askey CPH06X TView99
+card=39 - Pinnacle PCTV Studio/Rave
+card=40 - STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100
+card=41 - AVerMedia TVPhone 98
+card=42 - ProVideo PV951
+card=43 - Little OnAir TV
+card=44 - Sigma TVII-FM
+card=45 - MATRIX-Vision MV-Delta 2
+card=46 - Zoltrix Genie TV/FM
+card=47 - Terratec TV/Radio+
+card=48 - Askey CPH03x/ Dynalink Magic TView
+card=49 - IODATA GV-BCTV3/PCI
+card=50 - Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP
+card=51 - Eagle Wireless Capricorn2 (bt878A)
+card=52 - Pinnacle PCTV Studio Pro
+card=53 - Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS
+card=54 - Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]
+card=55 - Askey CPH031/ BESTBUY Easy TV
+card=56 - Lifeview FlyVideo 98FM LR50
+card=57 - GrandTec 'Grand Video Capture' (Bt848)
+card=58 - Askey CPH060/ Phoebe TV Master Only (No FM)
+card=59 - Askey CPH03x TV Capturer
+card=60 - Modular Technology MM100PCTV
+card=61 - AG Electronics GMV1
+card=62 - Askey CPH061/ BESTBUY Easy TV (bt878)
+card=63 - ATI TV-Wonder
+card=64 - ATI TV-Wonder VE
+card=65 - Lifeview FlyVideo 2000S LR90
+card=66 - Terratec TValueRadio
+card=67 - IODATA GV-BCTV4/PCI
+card=68 - 3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)
+card=69 - Active Imaging AIMMS
+card=70 - Prolink Pixelview PV-BT878P+ (Rev.4C,8E)
+card=71 - Lifeview FlyVideo 98EZ (capture only) LR51
+card=72 - Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)
+card=73 - Sensoray 311
+card=74 - RemoteVision MX (RV605)
+card=75 - Powercolor MTV878/ MTV878R/ MTV878F
+card=76 - Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)
+card=77 - GrandTec Multi Capture Card (Bt878)
+card=78 - Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF
+card=79 - DSP Design TCVIDEO
+card=80 - Hauppauge WinTV PVR
+card=81 - IODATA GV-BCTV5/PCI
+card=82 - Osprey 100/150 (878)
+card=83 - Osprey 100/150 (848)
+card=84 - Osprey 101 (848)
+card=85 - Osprey 101/151
+card=86 - Osprey 101/151 w/ svid
+card=87 - Osprey 200/201/250/251
+card=88 - Osprey 200/250
+card=89 - Osprey 210/220
+card=90 - Osprey 500
+card=91 - Osprey 540
+card=92 - Osprey 2000
+card=93 - IDS Eagle
+card=94 - Pinnacle PCTV Sat
+card=95 - Formac ProTV II (bt878)
+card=96 - MachTV
+card=97 - Euresys Picolo
+card=98 - ProVideo PV150
+card=99 - AD-TVK503
+card=100 - Hercules Smart TV Stereo
+card=101 - Pace TV & Radio Card
+card=102 - IVC-200
+card=103 - Grand X-Guard / Trust 814PCI
+card=104 - Nebula Electronics DigiTV
+card=105 - ProVideo PV143
+card=106 - PHYTEC VD-009-X1 MiniDIN (bt878)
+card=107 - PHYTEC VD-009-X1 Combi (bt878)
+card=108 - PHYTEC VD-009 MiniDIN (bt878)
+card=109 - PHYTEC VD-009 Combi (bt878)
+card=110 - IVC-100
+card=111 - IVC-120G
+card=112 - pcHDTV HD-2000 TV
+card=113 - Twinhan DST + clones
+card=114 - Winfast VC100
diff -Nru a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/CARDLIST.saa7134	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,23 @@
+  0 -> UNKNOWN/GENERIC                         
+  1 -> Proteus Pro [philips reference design]   [1131:2001,1131:2001]
+  2 -> LifeView FlyVIDEO3000                    [5168:0138]
+  3 -> LifeView FlyVIDEO2000                    [5168:0138]
+  4 -> EMPRESS                                  [1131:6752]
+  5 -> SKNet Monster TV                         [1131:4e85]
+  6 -> Tevion MD 9717                          
+  7 -> KNC One TV-Station RDS / Typhoon TV+Radio 90031 [1131:fe01]
+  8 -> Terratec Cinergy 400 TV                  [153B:1142]
+  9 -> Medion 5044                             
+ 10 -> Kworld/KuroutoShikou SAA7130-TVPCI      
+ 11 -> Terratec Cinergy 600 TV                  [153B:1143]
+ 12 -> Medion 7134                              [16be:0003]
+ 13 -> ELSA EX-VISION 300TV                     [1048:226b]
+ 14 -> ELSA EX-VISION 500TV                     [1048:226b]
+ 15 -> ASUS TV-FM 7134                          [PCI_VENDOR_ID_ASUSTEK:4842,PCI_VENDOR_ID_ASUSTEK:4830]
+ 16 -> AOPEN VA1000 POWER                       [1131:7133]
+ 17 -> 10MOONS PCI TV CAPTURE CARD              [1131:2001]
+ 18 -> BMK MPEX No Tuner                       
+ 19 -> Compro VideoMate TV                      [185b:c100]
+ 20 -> Matrox CronosPlus                        [PCI_VENDOR_ID_MATROX:48d0]
+ 21 -> Medion 2819                              [1461:a70b]
+ 22 -> BMK MPEX Tuner                          
diff -Nru a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/CARDLIST.tuner	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,43 @@
+tuner=0 - Temic PAL (4002 FH5)
+tuner=1 - Philips PAL_I (FI1246 and compatibles)
+tuner=2 - Philips NTSC (FI1236,FM1236 and compatibles)
+tuner=3 - Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)
+tuner=4 - NoTuner
+tuner=5 - Philips PAL_BG (FI1216 and compatibles)
+tuner=6 - Temic NTSC (4032 FY5)
+tuner=7 - Temic PAL_I (4062 FY5)
+tuner=8 - Temic NTSC (4036 FY5)
+tuner=9 - Alps HSBH1
+tuner=10 - Alps TSBE1
+tuner=11 - Alps TSBB5
+tuner=12 - Alps TSBE5
+tuner=13 - Alps TSBC5
+tuner=14 - Temic PAL_BG (4006FH5)
+tuner=15 - Alps TSCH6
+tuner=16 - Temic PAL_DK (4016 FY5)
+tuner=17 - Philips NTSC_M (MK2)
+tuner=18 - Temic PAL_I (4066 FY5)
+tuner=19 - Temic PAL* auto (4006 FN5)
+tuner=20 - Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)
+tuner=21 - Temic NTSC (4039 FR5)
+tuner=22 - Temic PAL/SECAM multi (4046 FM5)
+tuner=23 - Philips PAL_DK (FI1256 and compatibles)
+tuner=24 - Philips PAL/SECAM multi (FQ1216ME)
+tuner=25 - LG PAL_I+FM (TAPC-I001D)
+tuner=26 - LG PAL_I (TAPC-I701D)
+tuner=27 - LG NTSC+FM (TPI8NSR01F)
+tuner=28 - LG PAL_BG+FM (TPI8PSB01D)
+tuner=29 - LG PAL_BG (TPI8PSB11D)
+tuner=30 - Temic PAL* auto + FM (4009 FN5)
+tuner=31 - SHARP NTSC_JP (2U5JF5540)
+tuner=32 - Samsung PAL TCPM9091PD27
+tuner=33 - MT2032 universal
+tuner=34 - Temic PAL_BG (4106 FH5)
+tuner=35 - Temic PAL_DK/SECAM_L (4012 FY5)
+tuner=36 - Temic NTSC (4136 FY5)
+tuner=37 - LG PAL (newer TAPC series)
+tuner=38 - Philips PAL/SECAM multi (FM1216ME MK3)
+tuner=39 - LG NTSC (newer TAPC series)
+tuner=40 - HITACHI V7-J180AT
+tuner=41 - Philips PAL_MK (FI1216 MK)
+tuner=42 - Philips 1236D ATSC/NTSC daul in
diff -Nru a/Documentation/video4linux/README.cx88 b/Documentation/video4linux/README.cx88
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/README.cx88	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,59 @@
+
+cx8800 release notes
+====================
+
+This is a v4l2 device driver for the cx2388x chip.
+
+
+current status
+==============
+
+video
+	Basically works.  Some minor quality glitches.  For now
+	only capture, overlay support isn't completed yet.
+
+audio
+	Doesn't work.  Also the chip specs for the on-chip TV sound
+	decoder are next to useless :-/
+	Most tuner chips do provide mono sound, which may or may not
+	be useable depending on the board design.  With the Hauppauge
+	cards it works, so there is at least mono sound.  Not nice,
+	but better than nothing.
+
+vbi
+	not implemented yet (but I don't expect problems here, just
+	found no time for that yet).
+
+
+how to add support for new cards
+================================
+
+The driver needs some config info for the TV cards.  This stuff is in
+cx88-cards.c.  If the driver doesn't work well you likely need a new
+entry for your card in that file.  Check the kernel log (using dmesg)
+to see whenever the driver knows your card or not.  There is a line
+like this one:
+
+	cx8800[0]: subsystem: 0070:3400, board: Hauppauge WinTV \
+		34xxx models [card=1,autodetected]
+
+If your card is listed as "board: UNKNOWN/GENERIC" it is unknown to
+the driver.
+
+You can try to create a new entry yourself, or you can mail me the
+config information.  I need at least the following informations to
+add the card:
+
+ * the PCI Subsystem ID ("0070:3400" from the line above, "lspci -v"
+   output is fine too).
+ * the tuner type used by the card.  You can try to find one by
+   trial-and-error using the tuner=<n> insmod option.  If you
+   know which one the card has you can also have a look at the
+   list in CARDLIST.tuner
+
+Have fun,
+
+  Gerd
+
+-- 
+Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
diff -Nru a/Documentation/video4linux/README.ir b/Documentation/video4linux/README.ir
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/README.ir	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,72 @@
+
+infrared remote control support in video4linux drivers
+======================================================
+
+
+basics
+------
+
+Current versions use the linux input layer to support infrared
+remote controls.  I suggest to download my input layer tools
+from http://bytesex.org/snapshot/input-<date>.tar.gz
+
+Modules you have to load:
+
+  saa7134	statically built in, i.e. just the driver :)
+  bttv		ir-kbd-gpio or ir-kbd-i2c depending on your
+		card.
+
+ir-kbd-gpio and ir-kbd-i2c don't support all cards lirc supports
+(yet), mainly for the reason that the code of lirc_i2c and lirc_gpio
+was very confusing and I decided to basically start over from scratch.
+Feel free to contact me in case of trouble.  Note that the ir-kbd-*
+modules work on 2.6.x kernels only through ...
+
+
+how it works
+------------
+
+The modules register the remote as keyboard within the linux input
+layer, i.e. you'll see the keys of the remote as normal key strokes
+(if CONFIG_INPUT_KEYBOARD is enabled).
+
+Using the event devices (CONFIG_INPUT_EVDEV) it is possible for
+applications to access the remote via /dev/input/event<n> devices.
+You might have to create the special files using "/sbin/MAKEDEV
+input".  The input layer tools mentioned above use the event device.
+
+The input layer tools are nice for trouble shooting, i.e. to check
+whenever the input device is really present, which of the devices it
+is, check whenever pressing keys on the remote actually generates
+events and the like.  You can also use the kbd utility to change the
+keymaps (2.6.x kernels only through).
+
+
+using with lircd
+================
+
+The cvs version of the lircd daemon supports reading events from the
+linux input layer (via event device).  The input layer tools tarball
+comes with a lircd config file.
+
+
+using without lircd
+===================
+
+XFree86 likely can be configured to recognise the remote keys.  Once I
+simply tried to configure one of the multimedia keyboards as input
+device, which had the effect that XFree86 recognised some of the keys
+of my remote control and passed volume up/down key presses as
+XF86AudioRaiseVolume and XF86AudioLowerVolume key events to the X11
+clients.
+
+It likely is possible to make that fly with a nice xkb config file,
+I know next to nothing about that through.
+
+
+Have fun,
+
+  Gerd
+
+--
+Gerd Knorr <kraxel@bytesex.org>
diff -Nru a/Documentation/video4linux/README.saa7134 b/Documentation/video4linux/README.saa7134
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/video4linux/README.saa7134	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,73 @@
+
+
+What is it?
+===========
+
+This is a v4l2/oss device driver for saa7130/33/34/35 based capture / TV
+boards.  See http://www.semiconductors.philips.com/pip/saa7134hl for a
+description.
+
+
+Status
+======
+
+Almost everything is working.  video, sound, tuner, radio, mpeg ts, ...
+
+As with bttv, card-specific tweaks are needed.  Check CARDLIST for a
+list of known TV cards and saa7134-cards.c for the drivers card
+configuration info.
+
+
+Build
+=====
+
+Pick up videodev + v4l2 patches from http://bytesex.org/patches/.
+Configure, build, install + boot the new kernel.  You'll need at least
+these config options:
+
+	CONFIG_I2C=m
+	CONFIG_VIDEO_DEV=m
+
+Type "make" to build the driver now.  "make install" installs the
+driver.  "modprobe saa7134" should load it.  Depending on the card you
+might have to pass card=<nr> as insmod option, check CARDLIST for
+valid choices.
+
+
+Changes / Fixes
+===============
+
+Please mail me unified diffs ("diff -u") with your changes, and don't
+forget to tell me what it changes / which problem it fixes / whatever
+it is good for ...
+
+
+Known Problems
+==============
+
+* The tuner for the flyvideos isn't detected automatically and the
+  default might not work for you depending on which version you have.
+  There is a tuner= insmod option to override the driver's default.
+
+Card Variations:
+================
+
+Cards can use either of these two crystals (xtal):
+ - 32.11 MHz -> .audio_clock=0x187de7
+ - 24.576MHz -> .audio_clock=0x200000
+(xtal * .audio_clock = 51539600)
+
+
+Credits
+=======
+
+andrew.stevens@philips.com + werner.leeb@philips.com for providing
+saa7134 hardware specs and sample board.
+
+
+Have fun,
+
+  Gerd
+
+-- 
+Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
diff -Nru a/Documentation/video4linux/bttv/CARDLIST b/Documentation/video4linux/bttv/CARDLIST
--- a/Documentation/video4linux/bttv/CARDLIST	Sat Jan 24 16:27:48 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,141 +0,0 @@
-bttv.o
-  card=0 -  *** UNKNOWN/GENERIC *** 
-  card=1 - MIRO PCTV
-  card=2 - Hauppauge (bt848)
-  card=3 - STB, Gateway P/N 6000699 (bt848)
-  card=4 - Intel Create and Share PCI/ Smart Video Recorder III
-  card=5 - Diamond DTV2000
-  card=6 - AVerMedia TVPhone
-  card=7 - MATRIX-Vision MV-Delta
-  card=8 - Lifeview FlyVideo II (Bt848) LR26
-  card=9 - IMS/IXmicro TurboTV
-  card=10 - Hauppauge (bt878)
-  card=11 - MIRO PCTV pro
-  card=12 - ADS Technologies Channel Surfer TV (bt848)
-  card=13 - AVerMedia TVCapture 98
-  card=14 - Aimslab Video Highway Xtreme (VHX)
-  card=15 - Zoltrix TV-Max
-  card=16 - Prolink Pixelview PlayTV (bt878)
-  card=17 - Leadtek WinView 601
-  card=18 - AVEC Intercapture
-  card=19 - Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)
-  card=20 - CEI Raffles Card
-  card=21 - Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50
-  card=22 - Askey CPH050/ Phoebe Tv Master + FM
-  card=23 - Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878
-  card=24 - Askey CPH05X/06X (bt878) [many vendors]
-  card=25 - Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar
-  card=26 - Hauppauge WinCam newer (bt878)
-  card=27 - Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50
-  card=28 - Terratec TerraTV+ Version 1.1 (bt878)
-  card=29 - Imagenation PXC200
-  card=30 - Lifeview FlyVideo 98 LR50
-  card=31 - Formac iProTV
-  card=32 - Intel Create and Share PCI/ Smart Video Recorder III
-  card=33 - Terratec TerraTValue Version Bt878
-  card=34 - Leadtek WinFast 2000/ WinFast 2000 XP
-  card=35 - Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II
-  card=36 - Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner
-  card=37 - Prolink PixelView PlayTV pro
-  card=38 - Askey CPH06X TView99
-  card=39 - Pinnacle PCTV Studio/Rave
-  card=40 - STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100
-  card=41 - AVerMedia TVPhone 98
-  card=42 - ProVideo PV951
-  card=43 - Little OnAir TV
-  card=44 - Sigma TVII-FM
-  card=45 - MATRIX-Vision MV-Delta 2
-  card=46 - Zoltrix Genie TV/FM
-  card=47 - Terratec TV/Radio+
-  card=48 - Askey CPH03x/ Dynalink Magic TView
-  card=49 - IODATA GV-BCTV3/PCI
-  card=50 - Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP
-  card=51 - Eagle Wireless Capricorn2 (bt878A)
-  card=52 - Pinnacle PCTV Studio Pro
-  card=53 - Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS
-  card=54 - Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]
-  card=55 - Askey CPH031/ BESTBUY Easy TV
-  card=56 - Lifeview FlyVideo 98FM LR50
-  card=57 - GrandTec 'Grand Video Capture' (Bt848)
-  card=58 - Askey CPH060/ Phoebe TV Master Only (No FM)
-  card=59 - Askey CPH03x TV Capturer
-  card=60 - Modular Technology MM100PCTV
-  card=61 - AG Electronics GMV1
-  card=62 - Askey CPH061/ BESTBUY Easy TV (bt878)
-  card=63 - ATI TV-Wonder
-  card=64 - ATI TV-Wonder VE
-  card=65 - Lifeview FlyVideo 2000S LR90
-  card=66 - Terratec TValueRadio
-  card=67 - IODATA GV-BCTV4/PCI
-  card=68 - 3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)
-  card=69 - Active Imaging AIMMS
-  card=70 - Prolink Pixelview PV-BT878P+ (Rev.4C,8E)
-  card=71 - Lifeview FlyVideo 98EZ (capture only) LR51
-  card=72 - Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)
-  card=73 - Sensoray 311
-  card=74 - RemoteVision MX (RV605)
-  card=75 - Powercolor MTV878/ MTV878R/ MTV878F
-  card=76 - Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)
-  card=77 - GrandTec Multi Capture Card (Bt878)
-  card=78 - Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF
-  card=79 - DSP Design TCVIDEO
-  card=80 - Hauppauge WinTV PVR
-  card=81 - GV-BCTV5/PCI
-  card=82 - Osprey 100/150 (878)
-  card=83 - Osprey 100/150 (848)
-  card=84 - Osprey 101 (848)
-  card=85 - Osprey 101/151
-  card=86 - Osprey 101/151 w/ svid
-  card=87 - Osprey 200/201/250/251
-  card=88 - Osprey 200/250
-  card=89 - Osprey 210/220
-  card=90 - Osprey 500
-  card=91 - Osprey 540
-  card=92 - Osprey 2000
-  card=93 - IDS Eagle
-  card=94 - Pinnacle PCTV Sat
-  card=95 - Formac ProTV II
-  card=96 - MachTV
-  card=97 - Euresys Picolo
-
-tuner.o
-  type=0 - Temic PAL (4002 FH5)
-  type=1 - Philips PAL_I (FI1246 and compatibles)
-  type=2 - Philips NTSC (FI1236,FM1236 and compatibles)
-  type=3 - Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)
-  type=4 - NoTuner
-  type=5 - Philips PAL_BG (FI1216 and compatibles)
-  type=6 - Temic NTSC (4032 FY5)
-  type=7 - Temic PAL_I (4062 FY5)
-  type=8 - Temic NTSC (4036 FY5)
-  type=9 - Alps HSBH1
-  type=10 - Alps TSBE1
-  type=11 - Alps TSBB5
-  type=12 - Alps TSBE5
-  type=13 - Alps TSBC5
-  type=14 - Temic PAL_BG (4006FH5)
-  type=15 - Alps TSCH6
-  type=16 - Temic PAL_DK (4016 FY5)
-  type=17 - Philips NTSC_M (MK2)
-  type=18 - Temic PAL_I (4066 FY5)
-  type=19 - Temic PAL* auto (4006 FN5)
-  type=20 - Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)
-  type=21 - Temic NTSC (4039 FR5)
-  type=22 - Temic PAL/SECAM multi (4046 FM5)
-  type=23 - Philips PAL_DK (FI1256 and compatibles)
-  type=24 - Philips PAL/SECAM multi (FQ1216ME)
-  type=25 - LG PAL_I+FM (TAPC-I001D)
-  type=26 - LG PAL_I (TAPC-I701D)
-  type=27 - LG NTSC+FM (TPI8NSR01F)
-  type=28 - LG PAL_BG+FM (TPI8PSB01D)
-  type=29 - LG PAL_BG (TPI8PSB11D)
-  type=30 - Temic PAL* auto + FM (4009 FN5)
-  type=31 - SHARP NTSC_JP (2U5JF5540)
-  type=32 - Samsung PAL TCPM9091PD27
-  type=33 - MT2032 universal
-  type=34 - Temic PAL_BG (4106 FH5)
-  type=35 - Temic PAL_DK/SECAM_L (4012 FY5)
-  type=36 - Temic NTSC (4136 FY5)
-  type=37 - LG PAL (newer TAPC series)
-  type=38 - Philips PAL/SECAM multi (FM1216ME MK3)
-  type=39 - LG NTSC (newer TAPC series)
diff -Nru a/Documentation/video4linux/bttv/Insmod-options b/Documentation/video4linux/bttv/Insmod-options
--- a/Documentation/video4linux/bttv/Insmod-options	Sat Jan 24 16:27:48 2004
+++ b/Documentation/video4linux/bttv/Insmod-options	Sat Jan 24 16:27:48 2004
@@ -1,4 +1,10 @@
 
+Note: "modinfo <module>" prints various informations about a kernel
+module, among them a complete and up-to-date list of insmod options.
+This list tends to be outdated because it is updated manually ...
+
+==========================================================================
+
 bttv.o
 	the bt848/878 (grabber chip) driver
 
diff -Nru a/Documentation/video4linux/bttv/README b/Documentation/video4linux/bttv/README
--- a/Documentation/video4linux/bttv/README	Sat Jan 24 16:27:48 2004
+++ b/Documentation/video4linux/bttv/README	Sat Jan 24 16:27:48 2004
@@ -1,88 +1,37 @@
 
-IMPORTANT:  Don't send me mails with images attached unless I ask you
-to do so.  Mails with images attached will go to /dev/null unseen.
-
-
-Release notes for bttv-0.7.x
-============================
-
-This version is based on Ralphs 0.6.4 release.  There are alot of
-changes.  Bugfixes, merged patches from other people, merged fixes
-from the kernel version, port to the new i2c stack, removed support
-for 2.0.x, code cleanups, ...
-
-To compile this bttv version, you'll the new i2c stack.  Kernels
-newer than 2.3.34 have this already included.  If you have a older
-kernel, download it from:
-	http://www2.lm-sensors.nu/~lm78/download.html
+Release notes for bttv
+======================
 
 You'll need at least these config options for bttv:
-CONFIG_I2C=m
-CONFIG_I2C_ALGOBIT=m
-CONFIG_VIDEO_DEV=m
+	CONFIG_I2C=m
+	CONFIG_I2C_ALGOBIT=m
+	CONFIG_VIDEO_DEV=m
 
 The latest bttv version is available from http://bytesex.org/bttv/
 
-You'll find Ralphs original (mostly outdated) documentation in the
-ralphs-doc subdirectory.
-
-
-Compile bttv
-------------
-
-If you are compiling the kernel version, just say 'm' if you are asked
-for bttv.  I /strongly/ recommend to compile bttv as module, because
-there are some insmod options for configuring the driver.  Starting
-with 0.7.49 the most important ones are available as kernel args too.
-
-If you downloaded the separate bttv bundle:  You need configured kernel
-sources to compile the bttv driver.  The driver uses some Makefile
-magic to compile the modules with your kernel's configuration
-(wrt. module-versions, SMP, ...).  If you already have compiled the
-kernel at least once, you probably don't have do worry about this.  If
-not, go to /usr/src/linux and run at least "make config".  Even
-better, compile your own kernel, you'll never become a real hacker
-else ;-)
-Note that you have to turn on video4linux support (CONFIG_VIDEO_DEV)
-in the kernel to get the videodev.o module which is required by bttv.
-
 
 Make bttv work with your card
 -----------------------------
 
-Setup your /etc/modules.conf file and let kmod load the modules.
-See also:
+Just try "modprobe bttv" and see if that works.
 
-Modules.conf:	some sample entries for /etc/modules.conf
-Insmod-options:	list of all insmod options available for bttv and
-		the helper modules.
-MAKEDEV:	a script to create the special files for v4l
-CARDLIST:	List of all supported cards
-Cards:		more detailed descriptions of known TV cards:
-		OEM name variants, used i2c chips, ...
-		also includes non-bttv cards.
-
-Loading just the bttv modules isn't enouth for most cards.  The
-drivers for the i2c tuner/sound chips must also be loaded.  bttv tries
-to load them automagically by calling request_module() now, but this
-obviously works only with kmod enabled.
+If it doesn't bttv likely could not autodetect your card and needs some
+insmod options.  The most important insmod option for bttv is "card=n"
+to select the correct card type.  If you get video but no sound you've
+very likely specified the wrong (or no) card type.  A list of supported
+cards is in CARDLIST.bttv
 
 If bttv takes very long to load (happens sometimes with the cheap
 cards which have no tuner), try adding this to your modules.conf:
 	options i2c-algo-bit bit_test=1
 
-The most important insmod option for bttv is "card=n" to select the
-correct card type in case the autodetection does'nt work. If you get
-video but no sound you've very likely specified the wrong (or no)
-card type.  A list of supported cards is in CARDLIST.
-
 For the WinTV/PVR you need one firmware file from the driver CD:
 hcwamc.rbf.  The file is in the pvr45xxx.exe archive (self-extracting
 zip file, unzip can unpack it).  Put it into the /etc/pvr directory or
 use the firm_altera=<path> insmod option to point the driver to the
 location of the file.
 
-If your card isn't listed in CARDLIST or if you have trouble making
+If your card isn't listed in CARDLIST.bttv or if you have trouble making
 audio work, you should read the Sound-FAQ.
 
 
@@ -103,14 +52,6 @@
 in bttv-cards.c (in case you are intrested or want to mail patches
 with updates).
 
-Old driver versions used to have a heuristic which could identify some
-bt848-based cards.  It worked for Hauppauge and Miro cards in most
-cases (simply because these where the first cards available on the
-market), but misdetected other bt848 cards.  That code is gone now for
-exactly this reason, the misdetection confused lots of people.  If you
-have a old Hauppauge or Miro card, you'll have to load the driver with
-card=1 or card=2 these days.
-
 
 Still doesn't work?
 -------------------
@@ -146,4 +87,4 @@
   Gerd
 
 --
-Gerd Knorr <kraxel@goldbach.in-berlin.de>
+Gerd Knorr <kraxel@bytesex.org>
diff -Nru a/MAINTAINERS b/MAINTAINERS
--- a/MAINTAINERS	Sat Jan 24 16:27:49 2004
+++ b/MAINTAINERS	Sat Jan 24 16:27:49 2004
@@ -709,7 +709,8 @@
 
 DVB SUBSYSTEM AND DRIVERS
 P:	LinuxTV.org Project
-L: 	linux-dvb@linuxtv.org
+M: 	linux-dvb-maintainer@linuxtv.org
+L: 	linux-dvb@linuxtv.org (subscription required)
 W:	http://linuxtv.org/developer/dvb.xml
 S:	Supported
 
diff -Nru a/Makefile b/Makefile
--- a/Makefile	Sat Jan 24 16:27:49 2004
+++ b/Makefile	Sat Jan 24 16:27:49 2004
@@ -690,7 +690,7 @@
 _modinst_:
 	@if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \
 		echo "Warning: you may need to install module-init-tools"; \
-		echo "See http://www.codemonkey.org.uk/post-halloween-2.5.txt";\
+		echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
 		sleep 1; \
 	fi
 	@rm -rf $(MODLIB)/kernel
diff -Nru a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
--- a/arch/alpha/kernel/signal.c	Sat Jan 24 16:27:49 2004
+++ b/arch/alpha/kernel/signal.c	Sat Jan 24 16:27:49 2004
@@ -201,10 +201,13 @@
  * Do a signal return; undo the signal stack.
  */
 
+#if _NSIG_WORDS > 1
+# error "Non SA_SIGINFO frame needs rearranging"
+#endif
+
 struct sigframe
 {
 	struct sigcontext sc;
-	unsigned long extramask[_NSIG_WORDS-1];
 	unsigned int retcode[3];
 };
 
@@ -268,19 +271,20 @@
 	return err;
 }
 
+/* Note that this syscall is also used by setcontext(3) to install
+   a given sigcontext.  This because it's impossible to set *all*
+   registers and transfer control from userland.  */
+
 asmlinkage void
-do_sigreturn(struct sigframe *frame, struct pt_regs *regs,
+do_sigreturn(struct sigcontext *sc, struct pt_regs *regs,
 	     struct switch_stack *sw)
 {
 	sigset_t set;
 
 	/* Verify that it's a good sigcontext before using it */
-	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+	if (verify_area(VERIFY_READ, sc, sizeof(*sc)))
 		goto give_sigsegv;
-	if (__get_user(set.sig[0], &frame->sc.sc_mask)
-	    || (_NSIG_WORDS > 1
-		&& __copy_from_user(&set.sig[1], &frame->extramask,
-				    sizeof(frame->extramask))))
+	if (__get_user(set.sig[0], &sc->sc_mask))
 		goto give_sigsegv;
 
 	sigdelsetmask(&set, ~_BLOCKABLE);
@@ -289,7 +293,7 @@
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
 
-	if (restore_sigcontext(&frame->sc, regs, sw))
+	if (restore_sigcontext(sc, regs, sw))
 		goto give_sigsegv;
 
 	/* Send SIGTRAP if we're single-stepping: */
@@ -314,10 +318,9 @@
 		struct switch_stack *sw)
 {
 	sigset_t set;
-	stack_t st;
 
-	/* Verify that it's a good sigcontext before using it */
-	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
+	/* Verify that it's a good ucontext_t before using it */
+	if (verify_area(VERIFY_READ, &frame->uc, sizeof(frame->uc)))
 		goto give_sigsegv;
 	if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
 		goto give_sigsegv;
@@ -331,12 +334,6 @@
 	if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw))
 		goto give_sigsegv;
 
-	if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
-		goto give_sigsegv;
-	/* It is more difficult to avoid calling this function than to
-	   call it and ignore errors.  */
-	do_sigaltstack(&st, NULL, rdusp());
-
 	/* Send SIGTRAP if we're single-stepping: */
 	if (ptrace_cancel_bpt (current)) {
 		siginfo_t info;
@@ -437,10 +434,6 @@
 		goto give_sigsegv;
 
 	err |= setup_sigcontext(&frame->sc, regs, sw, set->sig[0], oldsp);
-	if (_NSIG_WORDS > 1) {
-		err |= __copy_to_user(frame->extramask, &set->sig[1], 
-				      sizeof(frame->extramask));
-	}
 	if (err)
 		goto give_sigsegv;
 
diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig
--- a/arch/i386/Kconfig	Sat Jan 24 16:27:48 2004
+++ b/arch/i386/Kconfig	Sat Jan 24 16:27:48 2004
@@ -399,7 +399,7 @@
 
 config X86_OOSTORE
 	bool
-	depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6
+	depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR
 	default y
 
 config HPET_TIMER
@@ -1260,11 +1260,6 @@
 	  and slower, but it will give very useful debugging information.
 	  If you don't debug the kernel, you can say N, but we may not be able
 	  to solve problems without frame pointers.
-
-config X86_EXTRA_IRQS
-	bool
-	depends on X86_LOCAL_APIC || X86_VOYAGER
-	default y
 
 config X86_FIND_SMP_CONFIG
 	bool
diff -Nru a/arch/i386/defconfig b/arch/i386/defconfig
--- a/arch/i386/defconfig	Sat Jan 24 16:27:49 2004
+++ b/arch/i386/defconfig	Sat Jan 24 16:27:49 2004
@@ -1101,7 +1101,6 @@
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_SPINLOCK_SLEEP=y
 CONFIG_FRAME_POINTER=y
-CONFIG_X86_EXTRA_IRQS=y
 CONFIG_X86_FIND_SMP_CONFIG=y
 CONFIG_X86_MPPARSE=y
 
diff -Nru a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
--- a/arch/i386/kernel/apic.c	Sat Jan 24 16:27:50 2004
+++ b/arch/i386/kernel/apic.c	Sat Jan 24 16:27:50 2004
@@ -834,11 +834,13 @@
 
 void __setup_APIC_LVTT(unsigned int clocks)
 {
-	unsigned int lvtt1_value, tmp_value;
+	unsigned int lvtt_value, tmp_value, ver;
 
-	lvtt1_value = SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV) |
-			APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR;
-	apic_write_around(APIC_LVTT, lvtt1_value);
+	ver = GET_APIC_VERSION(apic_read(APIC_LVR));
+	lvtt_value = APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR;
+	if (!APIC_INTEGRATED(ver))
+		lvtt_value |= SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV);
+	apic_write_around(APIC_LVTT, lvtt_value);
 
 	/*
 	 * Divide PICLK by 16
diff -Nru a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
--- a/arch/i386/kernel/apm.c	Sat Jan 24 16:27:48 2004
+++ b/arch/i386/kernel/apm.c	Sat Jan 24 16:27:48 2004
@@ -844,6 +844,8 @@
 		idle_percentage *= 100;
 		idle_percentage /= jiffies_since_last_check;
 		use_apm_idle = (idle_percentage > idle_threshold);
+		if (apm_info.forbid_idle)
+			use_apm_idle = 0;
 		last_jiffies = jiffies;
 		last_stime = current->stime;
 	}
diff -Nru a/arch/i386/kernel/cpu/mcheck/non-fatal.c b/arch/i386/kernel/cpu/mcheck/non-fatal.c
--- a/arch/i386/kernel/cpu/mcheck/non-fatal.c	Sat Jan 24 16:27:48 2004
+++ b/arch/i386/kernel/cpu/mcheck/non-fatal.c	Sat Jan 24 16:27:48 2004
@@ -74,6 +74,16 @@
 
 static int __init init_nonfatal_mce_checker(void)
 {
+	struct cpuinfo_x86 *c = &boot_cpu_data;
+
+	/* Check for MCE support */
+	if (!cpu_has(c, X86_FEATURE_MCE))
+		return -ENODEV;
+
+	/* Check for PPro style MCA */
+	if (!cpu_has(c, X86_FEATURE_MCA))
+		return -ENODEV;
+
 	/* Some Athlons misbehave when we frob bank 0 */
 	if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
 		boot_cpu_data.x86 == 6)
diff -Nru a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c
--- a/arch/i386/kernel/cpu/mtrr/if.c	Sat Jan 24 16:27:48 2004
+++ b/arch/i386/kernel/cpu/mtrr/if.c	Sat Jan 24 16:27:48 2004
@@ -352,6 +352,14 @@
 
 static int __init mtrr_if_init(void)
 {
+	struct cpuinfo_x86 *c = &boot_cpu_data;
+
+	if ((!cpu_has(c, X86_FEATURE_MTRR)) &&
+	    (!cpu_has(c, X86_FEATURE_K6_MTRR)) &&
+	    (!cpu_has(c, X86_FEATURE_CYRIX_ARR)) &&
+	    (!cpu_has(c, X86_FEATURE_CENTAUR_MCR)))
+		return -ENODEV;
+
 	proc_root_mtrr =
 	    create_proc_entry("mtrr", S_IWUSR | S_IRUGO, &proc_root);
 	if (proc_root_mtrr) {
diff -Nru a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c
--- a/arch/i386/kernel/dmi_scan.c	Sat Jan 24 16:27:49 2004
+++ b/arch/i386/kernel/dmi_scan.c	Sat Jan 24 16:27:49 2004
@@ -283,6 +283,30 @@
 	return 0;
 }
 
+static __init int apm_is_horked_d850md(struct dmi_blacklist *d)
+{
+	if (apm_info.disabled == 0) {
+		apm_info.disabled = 1;
+		printk(KERN_INFO "%s machine detected. Disabling APM.\n", d->ident);
+		printk(KERN_INFO "This bug is fixed in bios P15 which is available for \n");
+		printk(KERN_INFO "download from support.intel.com \n");
+	}
+	return 0;
+}
+
+/* 
+ * Some APM bioses hang on APM idle calls
+ */
+
+static __init int apm_likes_to_melt(struct dmi_blacklist *d)
+{
+	if (apm_info.forbid_idle == 0) {
+		apm_info.forbid_idle = 1;
+		printk(KERN_INFO "%s machine detected. Disabling APM idle calls.\n", d->ident);
+	}
+	return 0;
+}
+
 /*
  * Some machines, usually laptops, can't handle an enabled local APIC.
  * The symptoms include hangs or reboots when suspending or resuming,
@@ -558,6 +582,22 @@
 			MATCH(DMI_PRODUCT_NAME, "Latitude C600"),
 			NO_MATCH, NO_MATCH
 			} },
+	{ set_apm_ints, "Dell Latitude", {  /* Allow interrupts during suspend on Dell Latitude laptops*/
+			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			MATCH(DMI_PRODUCT_NAME, "Latitude C510"),
+			NO_MATCH, NO_MATCH
+			} },
+	{ apm_is_horked, "Dell Inspiron 2500", { /* APM crashes */
+			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			MATCH(DMI_PRODUCT_NAME, "Inspiron 2500"),
+			MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
+			MATCH(DMI_BIOS_VERSION,"A11")
+			} },
+	{ set_apm_ints, "Dell Inspiron", {	/* Allow interrupts during suspend on Dell Inspiron laptops*/
+			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"),
+			NO_MATCH, NO_MATCH
+			} },
 	{ broken_apm_power, "Dell Inspiron 5000e", {	/* Handle problems with APM on Inspiron 5000e */
 			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
 			MATCH(DMI_BIOS_VERSION, "A04"),
@@ -568,6 +608,12 @@
 			MATCH(DMI_BIOS_VERSION, "A12"),
 			MATCH(DMI_BIOS_DATE, "02/04/2002"), NO_MATCH
 			} },
+	{ apm_is_horked, "Dell Dimension 4100", { /* APM crashes */
+			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			MATCH(DMI_PRODUCT_NAME, "XPS-Z"),
+			MATCH(DMI_BIOS_VENDOR,"Intel Corp."),
+			MATCH(DMI_BIOS_VERSION,"A11")
+			} },
 	{ set_realmode_power_off, "Award Software v4.60 PGMA", {	/* broken PM poweroff bios */
 			MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."),
 			MATCH(DMI_BIOS_VERSION, "4.60 PGMA"),
@@ -578,21 +624,16 @@
 			MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
 			NO_MATCH, NO_MATCH
 			} },
-	{ set_bios_reboot, "Dell PowerEdge 300", {	/* Handle problems with rebooting on Dell 1300's */
+	{ set_bios_reboot, "Dell PowerEdge 300", {	/* Handle problems with rebooting on Dell 300's */
 			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
 			MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
 			NO_MATCH, NO_MATCH
 			} },
-	{ set_bios_reboot, "Dell PowerEdge 2400", {  /* Handle problems with rebooting on Dell 300/800's */
+	{ set_bios_reboot, "Dell PowerEdge 2400", {  /* Handle problems with rebooting on Dell 2400's */
 			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
 			MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
 			NO_MATCH, NO_MATCH
 			} },
-	{ set_apm_ints, "Dell Inspiron", {	/* Allow interrupts during suspend on Dell Inspiron laptops*/
-			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"),
-			NO_MATCH, NO_MATCH
-			} },
 	{ set_apm_ints, "Compaq 12XL125", {	/* Allow interrupts during suspend on Compaq Laptops*/
 			MATCH(DMI_SYS_VENDOR, "Compaq"),
 			MATCH(DMI_PRODUCT_NAME, "Compaq PC"),
@@ -619,7 +660,7 @@
 			MATCH(DMI_BIOS_VERSION, "Version1.01"),
 			NO_MATCH, NO_MATCH,
 			} },
-	{ apm_is_horked, "Intel D850MD", { /* APM crashes */
+	{ apm_is_horked_d850md, "Intel D850MD", { /* APM crashes */
 			MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
 			MATCH(DMI_BIOS_VERSION, "MV85010A.86A.0016.P07.0201251536"),
 			NO_MATCH, NO_MATCH,
@@ -647,6 +688,16 @@
 			MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
 			MATCH(DMI_BIOS_VERSION,"A11")
 			} },
+	{ apm_likes_to_melt, "Jabil AMD", { /* APM idle hangs */
+			MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
+			MATCH(DMI_BIOS_VERSION, "0AASNP06"),
+			NO_MATCH, NO_MATCH,
+			} },
+	{ apm_likes_to_melt, "AMI Bios", { /* APM idle hangs */
+			MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
+			MATCH(DMI_BIOS_VERSION, "0AASNP05"), 
+			NO_MATCH, NO_MATCH,
+			} },
 	{ sony_vaio_laptop, "Sony Vaio", { /* This is a Sony Vaio laptop */
 			MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
 			MATCH(DMI_PRODUCT_NAME, "PCG-"),
@@ -777,6 +828,11 @@
                         } },
 	{ broken_pirq, "l44GX Bios", {        		/* Bad $PIR */
 			MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
+			MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0115.P12"),
+			NO_MATCH, NO_MATCH
+                        } },
+	{ broken_pirq, "l44GX Bios", {        		/* Bad $PIR */
+			MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
 			MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0120.P12"),
 			NO_MATCH, NO_MATCH
                         } },
@@ -788,6 +844,12 @@
 	{ broken_pirq, "l44GX Bios", {		/* Bad $PIR */
 			MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
 			MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0066.P07.9906041405"),
+			NO_MATCH, NO_MATCH
+			} },
+
+	{ broken_pirq, "IBM xseries 370", {		/* Bad $PIR */
+			MATCH(DMI_BIOS_VENDOR, "IBM"),
+			MATCH(DMI_BIOS_VERSION,"MMKT33AUS"),
 			NO_MATCH, NO_MATCH
 			} },
                         
diff -Nru a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c
--- a/arch/i386/pci/direct.c	Sat Jan 24 16:27:48 2004
+++ b/arch/i386/pci/direct.c	Sat Jan 24 16:27:48 2004
@@ -259,7 +259,7 @@
 	release_resource(region);
 
  type2:
-	if ((!pci_probe & PCI_PROBE_CONF2) == 0)
+	if ((pci_probe & PCI_PROBE_CONF2) == 0)
 		goto out;
 	region = request_region(0xCF8, 4, "PCI conf2");
 	if (!region)
diff -Nru a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
--- a/arch/ppc/kernel/setup.c	Sat Jan 24 16:27:50 2004
+++ b/arch/ppc/kernel/setup.c	Sat Jan 24 16:27:50 2004
@@ -675,7 +675,6 @@
 	if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
 
 	paging_init();
-	sort_exception_table();
 
 	/* this is for modules since _machine can be a define -- Cort */
 	ppc_md.ppc_machine = _machine;
diff -Nru a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c
--- a/arch/ppc/kernel/signal.c	Sat Jan 24 16:27:50 2004
+++ b/arch/ppc/kernel/signal.c	Sat Jan 24 16:27:50 2004
@@ -241,12 +241,16 @@
  * (except for MSR).
  */
 static int
-restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr)
+restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig)
 {
+	unsigned long save_r2;
 #ifdef CONFIG_ALTIVEC
 	unsigned long msr;
 #endif
 
+	/* backup/restore the TLS as we don't want it to be modified */
+	if (!sig)
+		save_r2 = regs->gpr[2];
 	/* copy up to but not including MSR */
 	if (__copy_from_user(regs, &sr->mc_gregs, PT_MSR * sizeof(elf_greg_t)))
 		return 1;
@@ -254,6 +258,8 @@
 	if (__copy_from_user(&regs->orig_gpr3, &sr->mc_gregs[PT_ORIG_R3],
 			     GP_REGS_SIZE - PT_ORIG_R3 * sizeof(elf_greg_t)))
 		return 1;
+	if (!sig)
+		regs->gpr[2] = save_r2;
 
 	/* force the process to reload the FP registers from
 	   current->thread when it next does FP instructions */
@@ -359,7 +365,7 @@
 	force_sig(SIGSEGV, current);
 }
 
-static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs)
+static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int sig)
 {
 	sigset_t set;
 	struct mcontext *mcp;
@@ -368,7 +374,7 @@
 	    || __get_user(mcp, &ucp->uc_regs))
 		return -EFAULT;
 	restore_sigmask(&set);
-	if (restore_user_regs(regs, mcp))
+	if (restore_user_regs(regs, mcp, sig))
 		return -EFAULT;
 
 	return 0;
@@ -376,10 +382,16 @@
 
 int sys_swapcontext(struct ucontext __user *old_ctx,
 		    struct ucontext __user *new_ctx,
-		    int r5, int r6, int r7, int r8, struct pt_regs *regs)
+		    int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
 {
 	unsigned char tmp;
 
+	/* Context size is for future use. Right now, we only make sure
+	 * we are passed something we understand
+	 */
+	if (ctx_size < sizeof(struct ucontext))
+		return -EINVAL;
+
 	if (old_ctx != NULL) {
 		if (verify_area(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
 		    || save_user_regs(regs, &old_ctx->uc_mcontext, 0)
@@ -406,7 +418,7 @@
 	 * or if another thread unmaps the region containing the context.
 	 * We kill the task with a SIGSEGV in this situation.
 	 */
-	if (do_setcontext(new_ctx, regs))
+	if (do_setcontext(new_ctx, regs, 0))
 		do_exit(SIGSEGV);
 	sigreturn_exit(regs);
 	/* doesn't actually return back to here */
@@ -425,7 +437,7 @@
 		(regs->gpr[1] + __SIGNAL_FRAMESIZE + 16);
 	if (verify_area(VERIFY_READ, rt_sf, sizeof(struct rt_sigframe)))
 		goto bad;
-	if (do_setcontext(&rt_sf->uc, regs))
+	if (do_setcontext(&rt_sf->uc, regs, 1))
 		goto bad;
 
 	/*
@@ -484,7 +496,7 @@
 	if (save_user_regs(regs, &frame->mctx, __NR_sigreturn))
 		goto badframe;
 
-	if (put_user(regs->gpr[1], (unsigned long *)newsp))
+	if (put_user(regs->gpr[1], (unsigned long __user *)newsp))
 		goto badframe;
 	regs->gpr[1] = newsp;
 	regs->gpr[3] = sig;
@@ -529,7 +541,7 @@
 
 	sr = (struct mcontext *) sigctx.regs;
 	if (verify_area(VERIFY_READ, sr, sizeof(*sr))
-	    || restore_user_regs(regs, sr))
+	    || restore_user_regs(regs, sr, 1))
 		goto badframe;
 
 	sigreturn_exit(regs);		/* doesn't return */
diff -Nru a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
--- a/arch/ppc64/Kconfig	Sat Jan 24 16:27:49 2004
+++ b/arch/ppc64/Kconfig	Sat Jan 24 16:27:49 2004
@@ -286,6 +286,8 @@
 
 source "drivers/char/Kconfig"
 
+source "drivers/i2c/Kconfig"
+
 source "drivers/media/Kconfig"
 
 source "fs/Kconfig"
diff -Nru a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
--- a/arch/ppc64/kernel/sys_ppc32.c	Sat Jan 24 16:27:49 2004
+++ b/arch/ppc64/kernel/sys_ppc32.c	Sat Jan 24 16:27:49 2004
@@ -2011,6 +2011,8 @@
 	int retval;
 	int i;
 
+	sched_balance_exec();
+
 	file = open_exec(filename);
 
 	retval = PTR_ERR(file);
diff -Nru a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
--- a/arch/sparc64/Kconfig	Sat Jan 24 16:27:49 2004
+++ b/arch/sparc64/Kconfig	Sat Jan 24 16:27:49 2004
@@ -727,6 +727,10 @@
 	depends on DEBUG_KERNEL
 	bool "Stack Overflow Detection Support"
 
+config DEBUG_BOOTMEM
+	depends on DEBUG_KERNEL
+	bool "Debug BOOTMEM initialization"
+
 # We have a custom atomic_dec_and_lock() implementation but it's not
 # compatible with spinlock debugging so we need to fall back on
 # the generic version in that case.
diff -Nru a/arch/sparc64/defconfig b/arch/sparc64/defconfig
--- a/arch/sparc64/defconfig	Sat Jan 24 16:27:48 2004
+++ b/arch/sparc64/defconfig	Sat Jan 24 16:27:48 2004
@@ -379,6 +379,7 @@
 CONFIG_MD_RAID0=m
 CONFIG_MD_RAID1=m
 CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
 CONFIG_MD_MULTIPATH=m
 CONFIG_BLK_DEV_DM=m
 # CONFIG_DM_IOCTL_V4 is not set
@@ -969,7 +970,7 @@
 CONFIG_PHONE_IXJ=m
 
 #
-# Unix 98 PTY support
+# Unix98 PTY support
 #
 CONFIG_UNIX98_PTYS=y
 CONFIG_UNIX98_PTY_COUNT=256
@@ -1054,16 +1055,21 @@
 CONFIG_I2C_ALI15X3=m
 CONFIG_I2C_AMD756=m
 CONFIG_I2C_AMD8111=m
+CONFIG_I2C_ELV=m
 CONFIG_I2C_I801=m
 CONFIG_I2C_I810=m
+CONFIG_I2C_ISA=m
 CONFIG_I2C_NFORCE2=m
 CONFIG_I2C_PHILIPSPAR=m
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
 CONFIG_I2C_PROSAVAGE=m
 CONFIG_I2C_SAVAGE4=m
 CONFIG_SCx200_ACB=m
 CONFIG_I2C_SIS5595=m
 CONFIG_I2C_SIS630=m
 CONFIG_I2C_SIS96X=m
+CONFIG_I2C_VELLEMAN=m
 CONFIG_I2C_VIA=m
 CONFIG_I2C_VIAPRO=m
 CONFIG_I2C_VOODOO3=m
@@ -1073,14 +1079,20 @@
 #
 CONFIG_I2C_SENSOR=m
 CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ASB100=m
 CONFIG_SENSORS_EEPROM=m
 CONFIG_SENSORS_IT87=m
 CONFIG_SENSORS_LM75=m
 CONFIG_SENSORS_LM78=m
 CONFIG_SENSORS_LM83=m
 CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM90=m
 CONFIG_SENSORS_VIA686A=m
 CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
 # File systems
@@ -1572,12 +1584,15 @@
 #
 # USB Miscellaneous drivers
 #
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
 # CONFIG_USB_TIGL is not set
 CONFIG_USB_AUERSWALD=m
 CONFIG_USB_RIO500=m
 CONFIG_USB_LEGOTOWER=m
 # CONFIG_USB_BRLVGER is not set
 CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
 CONFIG_USB_SPEEDTOUCH=m
 CONFIG_USB_TEST=m
 # CONFIG_USB_GADGET is not set
diff -Nru a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
--- a/arch/sparc64/kernel/head.S	Sat Jan 24 16:27:49 2004
+++ b/arch/sparc64/kernel/head.S	Sat Jan 24 16:27:49 2004
@@ -54,7 +54,14 @@
 
         .ascii  "HdrS"
         .word   LINUX_VERSION_CODE
-        .half   0x0203          /* HdrS version */
+
+	/* History:
+	 *
+	 * 0x0202 : Supports kernel params string
+	 * 0x0300 : Supports being located at other than 0x4000
+	 */
+        .half   0x0300          /* HdrS version */
+
 root_flags:
         .half   1
 root_dev:
@@ -345,7 +352,8 @@
 	nop
 	nop
 	and	%g1, %g3, %g1		/* Mask to just get paddr bits.       */
-	sub	%g1, %g2, %g1		/* Get rid of %pc offset to get base. */
+	set	0x5fff, %l3		/* Mask offset to get phys base.      */
+	andn	%g1, %l3, %g1
 
 	/* NOTE: We hold on to %g1 paddr base as we need it below to lock
 	 * NOTE: the PROM cif code into the TLB.
diff -Nru a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
--- a/arch/sparc64/kernel/smp.c	Sat Jan 24 16:27:48 2004
+++ b/arch/sparc64/kernel/smp.c	Sat Jan 24 16:27:48 2004
@@ -1261,6 +1261,7 @@
 
 void __devinit smp_prepare_boot_cpu(void)
 {
+	current_thread_info()->cpu = hard_smp_processor_id();
 	cpu_set(smp_processor_id(), cpu_online_map);
 	cpu_set(smp_processor_id(), phys_cpu_present_map);
 }
diff -Nru a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
--- a/arch/sparc64/kernel/sys_sparc32.c	Sat Jan 24 16:27:49 2004
+++ b/arch/sparc64/kernel/sys_sparc32.c	Sat Jan 24 16:27:49 2004
@@ -1950,6 +1950,8 @@
 	int retval;
 	int i;
 
+	sched_balance_exec();
+
 	file = open_exec(filename);
 
 	retval = PTR_ERR(file);
@@ -2023,7 +2025,8 @@
 		security_bprm_free(&bprm);
 
 out_mm:
-	mmdrop(bprm.mm);
+	if (bprm.mm)
+		mmdrop(bprm.mm);
 
 out_file:
 	if (bprm.file) {
diff -Nru a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
--- a/arch/sparc64/kernel/traps.c	Sat Jan 24 16:27:50 2004
+++ b/arch/sparc64/kernel/traps.c	Sat Jan 24 16:27:50 2004
@@ -2043,8 +2043,4 @@
 	 */
 	atomic_inc(&init_mm.mm_count);
 	current->active_mm = &init_mm;
-
-#ifdef CONFIG_SMP
-	current_thread_info()->cpu = hard_smp_processor_id();
-#endif
 }
diff -Nru a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
--- a/arch/sparc64/mm/init.c	Sat Jan 24 16:27:49 2004
+++ b/arch/sparc64/mm/init.c	Sat Jan 24 16:27:49 2004
@@ -1293,6 +1293,10 @@
 	unsigned long bootmap_pfn, bytes_avail, size;
 	int i;
 
+#ifdef CONFIG_DEBUG_BOOTMEM
+	prom_printf("bootmem_init: Scan sp_banks, ");
+#endif
+
 	bytes_avail = 0UL;
 	for (i = 0; sp_banks[i].num_bytes != 0; i++) {
 		end_of_phys_memory = sp_banks[i].base_addr +
@@ -1359,14 +1363,24 @@
 	/* Initialize the boot-time allocator. */
 	max_pfn = max_low_pfn = end_pfn;
 	min_low_pfn = pfn_base;
+
+#ifdef CONFIG_DEBUG_BOOTMEM
+	prom_printf("init_bootmem(spfn[%lx], bpfn[%lx], mlpfn[%lx])\n",
+		    start_pfn, bootmap_pfn, max_low_pfn);
+#endif
 	bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap_pfn, pfn_base, end_pfn);
 
 	/* Now register the available physical memory with the
 	 * allocator.
 	 */
-	for (i = 0; sp_banks[i].num_bytes != 0; i++)
+	for (i = 0; sp_banks[i].num_bytes != 0; i++) {
+#ifdef CONFIG_DEBUG_BOOTMEM
+		prom_printf("free_bootmem(sp_banks:%d): base[%lx] size[%lx]\n",
+			    i, sp_banks[i].base_addr, sp_banks[i].num_bytes);
+#endif
 		free_bootmem(sp_banks[i].base_addr,
 			     sp_banks[i].num_bytes);
+	}
 
 #ifdef CONFIG_BLK_DEV_INITRD
 	if (initrd_start) {
@@ -1382,6 +1396,9 @@
 #endif
 	/* Reserve the kernel text/data/bss. */
 	size = (start_pfn << PAGE_SHIFT) - phys_base;
+#ifdef CONFIG_DEBUG_BOOTMEM
+	prom_printf("reserve_bootmem(kernel): base[%lx] size[%lx]\n", phys_base, size);
+#endif
 	reserve_bootmem(phys_base, size);
 	*pages_avail -= PAGE_ALIGN(size) >> PAGE_SHIFT;
 
@@ -1390,6 +1407,10 @@
 	 * in free_all_bootmem.
 	 */
 	size = bootmap_size;
+#ifdef CONFIG_DEBUG_BOOTMEM
+	prom_printf("reserve_bootmem(bootmap): base[%lx] size[%lx]\n",
+		    (bootmap_pfn << PAGE_SHIFT), size);
+#endif
 	reserve_bootmem((bootmap_pfn << PAGE_SHIFT), size);
 	*pages_avail -= PAGE_ALIGN(size) >> PAGE_SHIFT;
 
@@ -1714,6 +1735,9 @@
 	max_mapnr = last_valid_pfn - pfn_base;
 	high_memory = __va(last_valid_pfn << PAGE_SHIFT);
 
+#ifdef CONFIG_DEBUG_BOOTMEM
+	prom_printf("mem_init: Calling free_all_bootmem().\n");
+#endif
 	totalram_pages = num_physpages = free_all_bootmem() - 1;
 
 	/*
diff -Nru a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
--- a/arch/x86_64/Kconfig	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/Kconfig	Sat Jan 24 16:27:49 2004
@@ -68,6 +68,9 @@
 
 	  If unsure, say Y.
 
+config HPET_EMULATE_RTC
+	def_bool HPET_TIMER && RTC=y
+
 config GENERIC_ISA_DMA
 	bool
 	default y
@@ -271,51 +274,7 @@
 
 menu "Power management options"
 
-config PM
-	bool "Power Management support"
-	---help---
-	  "Power Management" means that parts of your computer are shut
-	  off or put into a power conserving "sleep" mode if they are not
-	  being used.  There are two competing standards for doing this: APM
-	  and ACPI.  If you want to use either one, say Y here and then also
-	  to the requisite support below.
-
-	  Power Management is most important for battery powered laptop
-	  computers.
-
-	  Note that, even if you say N here, Linux on the x86 architecture
-	  will issue the hlt instruction if nothing is to be done, thereby
-	  sending the processor to limited sleep and saving power. However
-	  using ACPI will likely save more power.
-
-config SOFTWARE_SUSPEND
-	bool "Software Suspend (EXPERIMENTAL)"
-	depends on EXPERIMENTAL && PM && SWAP
-	---help---
-	  Enable the possibilty of suspending the machine. It doesn't need APM.
-	  You may suspend your machine by 'swsusp' or 'shutdown -z <time>' 
-	  (patch for sysvinit needed). 
-
-	  It creates an image which is saved in your active swaps. On the next
-	  boot, pass the 'resume=/path/to/your/swap/file' option and the kernel
-	  will detect the saved image, restore the memory from
-	  it, and then continue to run as before you suspended.
-	  If you don't want the previous state to continue, use the 'noresume'
-	  kernel option. However, note that your partitions will be fsck'd and
-	  you must re-mkswap your swap partitions/files.
-
-	  Right now you may boot without resuming and then later resume but
-	  in the meantime you cannot use those swap partitions/files which were
-	  involved in suspending. Also in this case there is a risk that buffers
-	  on disk won't match with saved ones.
-
-	  SMP is supported ``as-is''. There's code for it but doesn't work.
-	  There have been problems reported relating to SCSI.
-
-	  This option is close to getting stable. However there is still some
-	  absence of features.
-
-	  For more information take a look at Documentation/power/swsusp.txt.
+source kernel/power/Kconfig
 
 source "drivers/acpi/Kconfig"
 
@@ -336,8 +295,23 @@
 
 # the drivers/pci/msi.c code needs to be fixed first before enabling
 config PCI_USE_VECTOR
-	bool
+	bool "Vector-based interrupt indexing"
+	depends on X86_LOCAL_APIC && NOTWORKING
 	default n
+	help
+	   This replaces the current existing IRQ-based index interrupt scheme
+	   with the vector-base index scheme. The advantages of vector base
+	   over IRQ base are listed below:
+	   1) Support MSI implementation.
+	   2) Support future IOxAPIC hotplug
+
+	   Note that this enables MSI, Message Signaled Interrupt, on all
+	   MSI capable device functions detected if users also install the
+	   MSI patch. Message Signal Interrupt enables an MSI-capable
+	   hardware device to send an inbound Memory Write on its PCI bus
+	   instead of asserting IRQ signal on device IRQ pin.
+
+	   If you don't know what to do here, say N.
 
 source "drivers/pci/Kconfig"
 
@@ -396,51 +370,9 @@
 
 endmenu
 
-source "drivers/base/Kconfig"
-
-source "drivers/mtd/Kconfig"
-
-source "drivers/parport/Kconfig"
-
-source "drivers/block/Kconfig"
-
-source "drivers/ide/Kconfig"
-
-source "drivers/scsi/Kconfig"
-
-source "drivers/md/Kconfig"
-
-source "drivers/telephony/Kconfig"
-
-source "drivers/message/fusion/Kconfig"
-
-source "drivers/ieee1394/Kconfig"
-
-#Currently not 64-bit safe
-#source drivers/message/i2o/Config.in
-source "net/Kconfig"
-
-source "drivers/isdn/Kconfig"
-
-# no support for non IDE/SCSI cdroms as they were all ISA only
-#
-# input before char - char/joystick depends on it. As does USB.
-#
-source "drivers/input/Kconfig"
-
-source "drivers/char/Kconfig"
-
-source "drivers/misc/Kconfig"
-
-source "drivers/media/Kconfig"
-
-source "fs/Kconfig"
-
-source "drivers/video/Kconfig"
-
-source "sound/Kconfig"
+source drivers/Kconfig
 
-source "drivers/usb/Kconfig"
+source fs/Kconfig
 
 source "arch/x86_64/oprofile/Kconfig"
 
@@ -505,6 +437,7 @@
           If you say Y here the resulting kernel image will include
 	  debugging info resulting in a larger kernel image.
 	  Say Y here only if you plan to use gdb to debug the kernel.
+	  Please note that this option requires new binutils.
 	  If you don't debug the kernel, you can say N.
 	  
 config FRAME_POINTER
diff -Nru a/arch/x86_64/Makefile b/arch/x86_64/Makefile
--- a/arch/x86_64/Makefile	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/Makefile	Sat Jan 24 16:27:49 2004
@@ -49,7 +49,7 @@
 # CFLAGS += -finline-limit=2000
 CFLAGS += -Wno-sign-compare
 # don't enable this when you use kgdb:
-ifneq ($(CONFIG_X86_REMOTE_DEBUG),y)
+ifneq ($(CONFIG_DEBUG_INFO),y)
 CFLAGS += -fno-asynchronous-unwind-tables
 endif
 #CFLAGS += $(call check_gcc,-funit-at-a-time,)
diff -Nru a/arch/x86_64/defconfig b/arch/x86_64/defconfig
--- a/arch/x86_64/defconfig	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/defconfig	Sat Jan 24 16:27:49 2004
@@ -9,6 +9,7 @@
 CONFIG_X86_CMPXCHG=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
 CONFIG_GENERIC_ISA_DMA=y
 
 #
@@ -26,7 +27,8 @@
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=18
-# CONFIG_IKCONFIG is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 CONFIG_FUTEX=y
@@ -34,6 +36,7 @@
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -59,7 +62,6 @@
 CONFIG_X86_IO_APIC=y
 CONFIG_X86_LOCAL_APIC=y
 CONFIG_MTRR=y
-# CONFIG_HUGETLB_PAGE is not set
 CONFIG_SMP=y
 # CONFIG_PREEMPT is not set
 CONFIG_K8_NUMA=y
@@ -79,9 +81,9 @@
 #
 # ACPI (Advanced Configuration and Power Interface) Support
 #
-# CONFIG_ACPI_HT is not set
 CONFIG_ACPI=y
 CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_SLEEP=y
 CONFIG_ACPI_SLEEP_PROC_FS=y
 CONFIG_ACPI_AC=y
@@ -94,17 +96,23 @@
 CONFIG_ACPI_TOSHIBA=y
 CONFIG_ACPI_DEBUG=y
 CONFIG_ACPI_BUS=y
-CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
 CONFIG_ACPI_PCI=y
 CONFIG_ACPI_SYSTEM=y
+# CONFIG_ACPI_RELAXED_AML is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
 
 #
 # Bus options (PCI etc.)
 #
 CONFIG_PCI=y
 CONFIG_PCI_DIRECT=y
+# CONFIG_PCI_USE_VECTOR is not set
 # CONFIG_PCI_LEGACY_PROC is not set
 # CONFIG_PCI_NAMES is not set
 # CONFIG_HOTPLUG is not set
@@ -115,6 +123,7 @@
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_IA32_EMULATION=y
+# CONFIG_IA32_AOUT is not set
 CONFIG_COMPAT=y
 CONFIG_UID16=y
 
@@ -179,7 +188,6 @@
 # CONFIG_BLK_DEV_OPTI621 is not set
 # CONFIG_BLK_DEV_RZ1000 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDE_TCQ is not set
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_IDEDMA_ONLYDISK is not set
@@ -246,6 +254,7 @@
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -260,7 +269,7 @@
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
 # CONFIG_SCSI_DC395x is not set
-# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_DEBUG is not set
 
 #
@@ -313,7 +322,12 @@
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
-# CONFIG_IPV6 is not set
+CONFIG_IPV6=y
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_TUNNEL is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
@@ -325,7 +339,9 @@
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
-# CONFIG_LLC is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
 # CONFIG_NET_DIVERT is not set
@@ -358,7 +374,7 @@
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
-# CONFIG_MII is not set
+CONFIG_MII=y
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_NET_VENDOR_3COM is not set
@@ -388,7 +404,6 @@
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
-# CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
 
 #
@@ -421,10 +436,10 @@
 # CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices (depends on LLC=y)
+# Token Ring devices
 #
+# CONFIG_TR is not set
 # CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 
 #
@@ -443,6 +458,11 @@
 # CONFIG_IRDA is not set
 
 #
+# Bluetooth support
+#
+# CONFIG_BT is not set
+
+#
 # ISDN subsystem
 #
 # CONFIG_ISDN_BOOL is not set
@@ -504,6 +524,7 @@
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 # CONFIG_SERIAL_8250_ACPI is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
@@ -520,7 +541,11 @@
 # CONFIG_I2C is not set
 
 #
-# I2C Hardware Sensors Mainboard support
+# I2C Algorithms
+#
+
+#
+# I2C Hardware Bus support
 #
 
 #
@@ -549,7 +574,6 @@
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
 
 #
 # Ftape, the floppy tape device driver
@@ -559,6 +583,7 @@
 # CONFIG_DRM is not set
 # CONFIG_MWAVE is not set
 CONFIG_RAW_DRIVER=y
+CONFIG_MAX_RAW_DEVS=256
 CONFIG_HANGCHECK_TIMER=y
 
 #
@@ -619,10 +644,13 @@
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
 
 #
@@ -647,6 +675,7 @@
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V4 is not set
@@ -670,6 +699,11 @@
 CONFIG_MSDOS_PARTITION=y
 
 #
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
 # Graphics support
 #
 # CONFIG_FB is not set
@@ -707,13 +741,15 @@
 # CONFIG_SOUND_MAESTRO is not set
 # CONFIG_SOUND_MAESTRO3 is not set
 CONFIG_SOUND_ICH=y
-# CONFIG_SOUND_RME96XX is not set
 # CONFIG_SOUND_SONICVIBES is not set
 # CONFIG_SOUND_TRIDENT is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
 # CONFIG_SOUND_VIA82CXXX is not set
 # CONFIG_SOUND_OSS is not set
 # CONFIG_SOUND_ALI5455 is not set
 # CONFIG_SOUND_FORTE is not set
+# CONFIG_SOUND_RME96XX is not set
 # CONFIG_SOUND_AD1980 is not set
 
 #
@@ -723,11 +759,6 @@
 # CONFIG_USB_GADGET is not set
 
 #
-# Bluetooth support
-#
-# CONFIG_BT is not set
-
-#
 # Profiling support
 #
 CONFIG_PROFILING=y
@@ -744,8 +775,6 @@
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_FRAME_POINTER is not set
 # CONFIG_IOMMU_DEBUG is not set
-CONFIG_IOMMU_LEAK=y
-CONFIG_MCE_DEBUG=y
 
 #
 # Security options
@@ -760,4 +789,4 @@
 #
 # Library routines
 #
-# CONFIG_CRC32 is not set
+CONFIG_CRC32=y
diff -Nru a/arch/x86_64/ia32/ia32_aout.c b/arch/x86_64/ia32/ia32_aout.c
--- a/arch/x86_64/ia32/ia32_aout.c	Sat Jan 24 16:27:50 2004
+++ b/arch/x86_64/ia32/ia32_aout.c	Sat Jan 24 16:27:50 2004
@@ -33,11 +33,14 @@
 #include <asm/user32.h>
 
 #undef WARN_OLD
+#undef CORE_DUMP /* probably broken */
 
 extern int ia32_setup_arg_pages(struct linux_binprm *bprm);
 
 static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
 static int load_aout_library(struct file*);
+
+#if CORE_DUMP
 static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file);
 
 /*
@@ -92,11 +95,15 @@
 #endif
 }
 
+#endif
+
 static struct linux_binfmt aout_format = {
 	.module		= THIS_MODULE,
 	.load_binary	= load_aout_binary,
 	.load_shlib	= load_aout_library,
+#if CORE_DUMP
 	.core_dump	= aout_core_dump,
+#endif
 	.min_coredump	= PAGE_SIZE
 };
 
@@ -109,6 +116,7 @@
 	do_brk(start, end - start);
 }
 
+#if CORE_DUMP
 /*
  * These are the only things you should do on a core-file: use only these
  * macros to write out all the necessary info.
@@ -201,6 +209,7 @@
 	set_fs(fs);
 	return has_dumped;
 }
+#endif
 
 /*
  * create_aout_tables() parses the env- and arg-strings in new user
@@ -285,10 +294,11 @@
 	regs->cs = __USER32_CS; 
 	regs->r8 = regs->r9 = regs->r10 = regs->r11 = regs->r12 =
 		regs->r13 = regs->r14 = regs->r15 = 0;
-	set_thread_flag(TIF_IA32); 
 
 	/* OK, This is the point of no return */
 	set_personality(PER_LINUX);
+	set_thread_flag(TIF_IA32); 
+	clear_thread_flag(TIF_ABI_PENDING);
 
 	current->mm->end_code = ex.a_text +
 		(current->mm->start_code = N_TXTADDR(ex));
diff -Nru a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
--- a/arch/x86_64/ia32/ia32_binfmt.c	Sat Jan 24 16:27:48 2004
+++ b/arch/x86_64/ia32/ia32_binfmt.c	Sat Jan 24 16:27:48 2004
@@ -197,6 +197,7 @@
 static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs)
 {	
 	struct pt_regs *pp = (struct pt_regs *)(t->thread.rsp0);
+	--pp;
 	ELF_CORE_COPY_REGS((*elfregs), pp);
 	/* fix wrong segments */ 
 	(*elfregs)[7] = t->thread.ds; 
@@ -214,6 +215,8 @@
 
 	if (!tsk->used_math) 
 		return 0;
+	if (!regs)
+		regs = (struct pt_regs *)tsk->thread.rsp0;
 	--regs;
 	if (tsk == current)
 		unlazy_fpu(tsk);
@@ -250,6 +253,14 @@
 #define ELF_PLATFORM  ("i686")
 #define SET_PERSONALITY(ex, ibcs2)			\
 do {							\
+	unsigned long new_flags = 0;				\
+	if ((ex).e_ident[EI_CLASS] == ELFCLASS32)		\
+		new_flags = _TIF_IA32;				\
+	if ((current_thread_info()->flags & _TIF_IA32)		\
+	    != new_flags)					\
+		set_thread_flag(TIF_ABI_PENDING);		\
+	else							\
+		clear_thread_flag(TIF_ABI_PENDING);		\
 	set_personality((ibcs2)?PER_SVR4:current->personality);	\
 } while (0)
 
@@ -323,7 +334,6 @@
 	me->thread.gsindex = 0;
     me->thread.ds = __USER_DS; 
 	me->thread.es = __USER_DS;
-	set_thread_flag(TIF_IA32); 
 }
 
 int setup_arg_pages(struct linux_binprm *bprm)
@@ -392,7 +402,7 @@
 	down_write(&me->mm->mmap_sem);
 	map_addr = do_mmap(filep, ELF_PAGESTART(addr),
 			   eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr), prot, 
-			   type|MAP_32BIT,
+			   type,
 			   eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr));
 	up_write(&me->mm->mmap_sem);
 	return(map_addr);
diff -Nru a/arch/x86_64/ia32/ia32_signal.c b/arch/x86_64/ia32/ia32_signal.c
--- a/arch/x86_64/ia32/ia32_signal.c	Sat Jan 24 16:27:50 2004
+++ b/arch/x86_64/ia32/ia32_signal.c	Sat Jan 24 16:27:50 2004
@@ -44,10 +44,10 @@
 asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset);
 void signal_fault(struct pt_regs *regs, void *frame, char *where);
 
-static int ia32_copy_siginfo_to_user(siginfo_t32 *to, siginfo_t *from)
+int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from)
 {
 	int err;
-	if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t)))
+	if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t32)))
 		return -EFAULT;
 
 	/* If you change siginfo_t structure, please make sure that
@@ -55,21 +55,18 @@
 		   It should never copy any pad contained in the structure
 		   to avoid security leaks, but must copy the generic
 		   3 ints plus the relevant union member.  */
-
-	if (from->si_code < 0) {
-		err = __put_user(from->si_signo, &to->si_signo);
-		err |= __put_user(from->si_errno, &to->si_errno);
-		err |= __put_user(from->si_code, &to->si_code);
-		err |= __put_user(from->_sifields._rt._pid, &to->_sifields._rt._pid);
-		err |= __put_user(from->_sifields._rt._uid, &to->_sifields._rt._uid);
-		err |= __put_user((u32)(u64)from->_sifields._rt._sigval.sival_ptr,
-				  &to->_sifields._rt._sigval.sival_ptr);
-	} else {
 		err = __put_user(from->si_signo, &to->si_signo);
 		err |= __put_user(from->si_errno, &to->si_errno);
-		err |= __put_user(from->si_code, &to->si_code);
-		/* First 32bits of unions are always present.  */
+ 	err |= __put_user((short)from->si_code, &to->si_code);
+
+	if (from->si_code < 0) {
 		err |= __put_user(from->si_pid, &to->si_pid);
+ 		err |= __put_user(from->si_uid, &to->si_uid);
+ 		err |= __put_user((u32)(u64)from->si_ptr, &to->si_ptr);
+	} else {
+ 		/* First 32bits of unions are always present:
+ 		 * si_pid === si_band === si_tid === si_addr(LS half) */
+		err |= __put_user(from->_sifields._pad[0], &to->_sifields._pad[0]);
 		switch (from->si_code >> 16) {
 		case __SI_FAULT >> 16:
 			break;
@@ -78,18 +75,39 @@
 			err |= __put_user(from->si_stime, &to->si_stime);
 			err |= __put_user(from->si_status, &to->si_status);
 		default:
+		case __SI_KILL >> 16:
 			err |= __put_user(from->si_uid, &to->si_uid);
 			break;
 		case __SI_POLL >> 16:
-			err |= __put_user(from->si_band, &to->si_band); 
 			err |= __put_user(from->si_fd, &to->si_fd); 
 			break;
+		case __SI_TIMER >> 16:
+			err |= __put_user(from->si_overrun, &to->si_overrun); 
+			err |= __put_user((u32)(u64)from->si_ptr, &to->si_ptr);
+			break;
 		/* case __SI_RT: This is not generated by the kernel as of now.  */
 		}
 	}
 	return err;
 }
 
+int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from)
+{
+	int err;
+	if (!access_ok (VERIFY_READ, from, sizeof(siginfo_t32)))
+		return -EFAULT;
+
+	err = __get_user(to->si_signo, &from->si_signo);
+	err |= __get_user(to->si_errno, &from->si_errno);
+	err |= __get_user(to->si_code, &from->si_code);
+
+	err |= __get_user(to->si_pid, &from->si_pid);
+	err |= __get_user(to->si_uid, &from->si_uid);
+	err |= __get_user((u32)(u64)to->si_ptr, &from->si_ptr);
+
+	return err;
+}
+
 asmlinkage long
 sys32_sigsuspend(int history0, int history1, old_sigset_t mask, struct pt_regs regs)
 {
@@ -134,9 +152,9 @@
 	set_fs(seg); 
 	if (ret >= 0 && uoss_ptr)  {
 		if (!access_ok(VERIFY_WRITE,uoss_ptr,sizeof(stack_ia32_t)) ||
-		    __put_user((u32)(u64)uss.ss_sp, &uoss_ptr->ss_sp) ||
-		    __put_user(uss.ss_flags, &uoss_ptr->ss_flags) ||
-		    __put_user(uss.ss_size, &uoss_ptr->ss_size))
+		    __put_user((u32)(u64)uoss.ss_sp, &uoss_ptr->ss_sp) ||
+		    __put_user(uoss.ss_flags, &uoss_ptr->ss_flags) ||
+		    __put_user(uoss.ss_size, &uoss_ptr->ss_size))
 			ret = -EFAULT;
 	} 	
 	return ret;	
@@ -376,7 +394,7 @@
 /*
  * Determine which stack to use..
  */
-static inline void *
+static void *
 get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 {
 	unsigned long rsp;
@@ -386,7 +404,7 @@
 
 	/* This is the X/Open sanctioned signal stack switching.  */
 	if (ka->sa.sa_flags & SA_ONSTACK) {
-		if (! on_sig_stack(rsp))
+		if (sas_ss_flags(rsp) == 0)
 			rsp = current->sas_ss_sp + current->sas_ss_size;
 	}
 
diff -Nru a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
--- a/arch/x86_64/ia32/ia32entry.S	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/ia32/ia32entry.S	Sat Jan 24 16:27:49 2004
@@ -4,6 +4,7 @@
  * Copyright 2000-2002 Andi Kleen, SuSE Labs.
  */		 
 
+#include <asm/dwarf2.h>
 #include <asm/calling.h>
 #include <asm/offset.h>
 #include <asm/current.h>
@@ -45,6 +46,7 @@
  * with the int 0x80 path.	
  */ 	
 ENTRY(ia32_cstar_target)
+	CFI_STARTPROC
 	swapgs
 	movl	%esp,%r8d
 	movq	%gs:pda_kernelstack,%rsp
@@ -105,6 +107,7 @@
 cstar_badarg:
 	movq $-EFAULT,%rax
 	jmp cstar_sysret
+	CFI_ENDPROC
 
 /* 
  * Emulated IA32 system calls via int 0x80. 
@@ -128,6 +131,7 @@
  */ 				
 
 ENTRY(ia32_syscall)
+	CFI_STARTPROC
 	swapgs	
 	sti
 	movl %eax,%eax
@@ -168,6 +172,7 @@
 quiet_ni_syscall:
 	movq $-ENOSYS,%rax
 	ret
+	CFI_ENDPROC
 	
 	.macro PTREGSCALL label, func
 	.globl \label
@@ -188,6 +193,7 @@
 	PTREGSCALL stub32_rt_sigsuspend, sys_rt_sigsuspend
 
 ENTRY(ia32_ptregs_common)
+	CFI_STARTPROC
 	popq %r11
 	SAVE_REST
 	movq %r11, %r15
@@ -198,6 +204,7 @@
 	je   int_ret_from_sys_call /* misbalances the call/ret stack. sorry */
 	pushq %r11
 	ret
+	CFI_ENDPROC
 
 	.data
 	.align 8
@@ -326,7 +333,7 @@
 	.quad stub32_clone		/* 120 */
 	.quad sys_setdomainname
 	.quad sys_uname
-	.quad sys32_modify_ldt
+	.quad sys_modify_ldt
 	.quad sys32_adjtimex
 	.quad sys32_mprotect		/* 125 */
 	.quad compat_sys_sigprocmask
@@ -334,10 +341,10 @@
 	.quad sys_init_module
 	.quad sys_delete_module
 	.quad quiet_ni_syscall		/* 130  get_kernel_syms */
-	.quad ni_syscall	/* quotactl */ 
+	.quad sys32_quotactl		/* quotactl */ 
 	.quad sys_getpgid
 	.quad sys_fchdir
-	.quad ni_syscall	/* bdflush */
+	.quad quiet_ni_syscall	/* bdflush */
 	.quad sys_sysfs		/* 135 */
 	.quad sys_personality
 	.quad ni_syscall	/* for afs_syscall */
@@ -425,8 +432,8 @@
 	.quad sys_madvise
 	.quad sys_getdents64	/* 220 getdents64 */ 
 	.quad compat_sys_fcntl64	
-	.quad sys_ni_syscall	/* tux */
-	.quad sys_ni_syscall    /* security */
+	.quad quiet_ni_syscall		/* tux */
+	.quad quiet_ni_syscall    	/* security */
 	.quad sys_gettid	
 	.quad sys_readahead	/* 225 */
 	.quad sys_setxattr
@@ -454,7 +461,7 @@
 	.quad sys32_io_submit
 	.quad sys_io_cancel
 	.quad sys_fadvise64
-	.quad sys_ni_syscall /* free_huge_pages */
+	.quad quiet_ni_syscall /* free_huge_pages */
 	.quad sys_exit_group /* exit_group */
 	.quad sys_lookup_dcookie
 	.quad sys_epoll_create
diff -Nru a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
--- a/arch/x86_64/ia32/sys_ia32.c	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/ia32/sys_ia32.c	Sat Jan 24 16:27:49 2004
@@ -858,8 +858,13 @@
 
 int sys32_ni_syscall(int call)
 { 
+	struct task_struct *me = current;
+	static char lastcomm[8];
+	if (strcmp(lastcomm, me->comm)) {
 	printk(KERN_INFO "IA32 syscall %d from %s not implemented\n", call,
 	       current->comm);
+		strcpy(lastcomm, me->comm); 
+	} 
 	return -ENOSYS;	       
 } 
 
@@ -1022,84 +1027,6 @@
 	return ret;
 }
 
-siginfo_t32 *
-siginfo64to32(siginfo_t32 *d, siginfo_t *s)
-{
-	memset (d, 0, sizeof(siginfo_t32));
-	d->si_signo = s->si_signo;
-	d->si_errno = s->si_errno;
-	d->si_code = s->si_code;
-	if (s->si_signo >= SIGRTMIN) {
-		d->si_pid = s->si_pid;
-		d->si_uid = s->si_uid;
-		memcpy(&d->si_int, &s->si_int, 
-                       sizeof(siginfo_t) - offsetof(siginfo_t,si_int));
-	} else switch (s->si_signo) {
-	/* XXX: What about POSIX1.b timers */
-	case SIGCHLD:
-		d->si_pid = s->si_pid;
-		d->si_status = s->si_status;
-		d->si_utime = s->si_utime;
-		d->si_stime = s->si_stime;
-		break;
-	case SIGSEGV:
-	case SIGBUS:
-	case SIGFPE:
-	case SIGILL:
-		d->si_addr = (long)(s->si_addr);
-//		d->si_trapno = s->si_trapno;
-		break;
-	case SIGPOLL:
-		d->si_band = s->si_band;
-		d->si_fd = s->si_fd;
-		break;
-	default:
-		d->si_pid = s->si_pid;
-		d->si_uid = s->si_uid;
-		break;
-	}
-	return d;
-}
-
-siginfo_t *
-siginfo32to64(siginfo_t *d, siginfo_t32 *s)
-{
-	d->si_signo = s->si_signo;
-	d->si_errno = s->si_errno;
-	d->si_code = s->si_code;
-	if (s->si_signo >= SIGRTMIN) {
-		d->si_pid = s->si_pid;
-		d->si_uid = s->si_uid;
-		memcpy(&d->si_int,
-                       &s->si_int,
-                       sizeof(siginfo_t) - offsetof(siginfo_t, si_int)); 
-	} else switch (s->si_signo) {
-	/* XXX: What about POSIX1.b timers */
-	case SIGCHLD:
-		d->si_pid = s->si_pid;
-		d->si_status = s->si_status;
-		d->si_utime = s->si_utime;
-		d->si_stime = s->si_stime;
-		break;
-	case SIGSEGV:
-	case SIGBUS:
-	case SIGFPE:
-	case SIGILL:
-		d->si_addr = (void *)A(s->si_addr);
-//		d->si_trapno = s->si_trapno;
-		break;
-	case SIGPOLL:
-		d->si_band = s->si_band;
-		d->si_fd = s->si_fd;
-		break;
-	default:
-		d->si_pid = s->si_pid;
-		d->si_uid = s->si_uid;
-		break;
-	}
-	return d;
-}
-
 extern asmlinkage long
 sys_rt_sigtimedwait(const sigset_t *uthese, siginfo_t *uinfo,
 		    const struct timespec *uts, size_t sigsetsize);
@@ -1114,7 +1041,6 @@
 	int ret;
 	mm_segment_t old_fs = get_fs();
 	siginfo_t info;
-	siginfo_t32 info32;
 		
 	if (copy_from_user (&s32, uthese, sizeof(compat_sigset_t)))
 		return -EFAULT;
@@ -1126,13 +1052,18 @@
 	}
 	if (uts && get_compat_timespec(&t, uts))
 		return -EFAULT;
+	if (uinfo) {
+		/* stop data leak to user space in case of structure fill mismatch
+		 * between sys_rt_sigtimedwait & ia32_copy_siginfo_to_user.
+		 */
+		memset(&info, 0, sizeof(info));
+	}
 	set_fs (KERNEL_DS);
 	ret = sys_rt_sigtimedwait(&s, uinfo ? &info : NULL, uts ? &t : NULL,
 			sigsetsize);
 	set_fs (old_fs);
 	if (ret >= 0 && uinfo) {
-		if (copy_to_user (uinfo, siginfo64to32(&info32, &info),
-				  sizeof(siginfo_t32)))
+		if (ia32_copy_siginfo_to_user(uinfo, &info))
 			return -EFAULT;
 	}
 	return ret;
@@ -1145,14 +1076,11 @@
 sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo)
 {
 	siginfo_t info;
-	siginfo_t32 info32;
 	int ret;
 	mm_segment_t old_fs = get_fs();
 	
-	if (copy_from_user (&info32, uinfo, sizeof(siginfo_t32)))
+	if (ia32_copy_siginfo_from_user(&info, uinfo))
 		return -EFAULT;
-	/* XXX: Is this correct? */
-	siginfo32to64(&info, &info32);
 	set_fs (KERNEL_DS);
 	ret = sys_rt_sigqueueinfo(pid, sig, &info);
 	set_fs (old_fs);
@@ -1289,31 +1217,6 @@
 	return ret;
 }
 
-extern asmlinkage long sys_modify_ldt(int func, void *ptr, 
-				      unsigned long bytecount);
-
-asmlinkage long sys32_modify_ldt(int func, void *ptr, unsigned long bytecount)
-{
-	long ret;
-	if (func == 0x1 || func == 0x11) { 
-		struct user_desc info;
-		mm_segment_t old_fs = get_fs();
-		if (bytecount != sizeof(struct user_desc))
-			return -EINVAL;
-		if (copy_from_user(&info, ptr, sizeof(struct user_desc)))
-			return -EFAULT;
-		/* lm bit was undefined in the 32bit ABI and programs
-		   give it random values. Force it to zero here. */
-		info.lm = 0; 
-		set_fs(KERNEL_DS);
-		ret = sys_modify_ldt(func, &info, bytecount);
-		set_fs(old_fs);
-	}  else { 
-		ret = sys_modify_ldt(func, ptr, bytecount); 
-	}
-	return ret;
-}
-
 /* Handle adjtimex compatibility. */
 
 struct timex32 {
@@ -2001,6 +1904,18 @@
 	static char lastcomm[8];
 	if (strcmp(lastcomm, me->comm)) {
 		printk(KERN_INFO "%s: vm86 mode not supported on 64 bit kernel\n",
+		       me->comm);
+		strcpy(lastcomm, me->comm); 
+	} 
+	return -ENOSYS;
+} 
+
+long sys32_quotactl(void)
+{ 
+	struct task_struct *me = current;
+	static char lastcomm[8];
+	if (strcmp(lastcomm, me->comm)) {
+		printk(KERN_INFO "%s: 32bit quotactl not supported on 64 bit kernel\n",
 		       me->comm);
 		strcpy(lastcomm, me->comm); 
 	} 
diff -Nru a/arch/x86_64/kernel/acpi/sleep.c b/arch/x86_64/kernel/acpi/sleep.c
--- a/arch/x86_64/kernel/acpi/sleep.c	Sat Jan 24 16:27:48 2004
+++ b/arch/x86_64/kernel/acpi/sleep.c	Sat Jan 24 16:27:48 2004
@@ -56,6 +56,7 @@
 
 /* address in low memory of the wakeup routine. */
 unsigned long acpi_wakeup_address = 0;
+unsigned long acpi_video_flags;
 extern char wakeup_start, wakeup_end;
 
 extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
@@ -115,6 +116,22 @@
 		printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
 	printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
 }
+
+static int __init acpi_sleep_setup(char *str)
+{
+	while ((str != NULL) && (*str != '\0')) {
+		if (strncmp(str, "s3_bios", 7) == 0)
+			acpi_video_flags = 1;
+		if (strncmp(str, "s3_mode", 7) == 0)
+			acpi_video_flags |= 2;
+		str = strchr(str, ',');
+		if (str != NULL)
+			str += strspn(str, ", \t");
+	}
+	return 1;
+}
+
+__setup("acpi_sleep=", acpi_sleep_setup);
 
 #endif /*CONFIG_ACPI_SLEEP*/
 
diff -Nru a/arch/x86_64/kernel/acpi/wakeup.S b/arch/x86_64/kernel/acpi/wakeup.S
--- a/arch/x86_64/kernel/acpi/wakeup.S	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/kernel/acpi/wakeup.S	Sat Jan 24 16:27:49 2004
@@ -41,7 +41,19 @@
 	cmpl	$0x12345678, %eax
 	jne	bogus_real_magic
 
+	testl	$1, video_flags - wakeup_code
+	jz	1f
 	lcall   $0xc000,$3
+	movw	%cs, %ax
+	movw	%ax, %ds					# Bios might have played with that
+	movw	%ax, %ss
+1:
+
+	testl	$2, video_flags - wakeup_code
+	jz	1f
+	mov	video_mode - wakeup_code, %ax
+	call	mode_seta
+1:
 
  	movw	$0xb800, %ax
 	movw	%ax,%fs
@@ -250,6 +262,7 @@
 		.quad 0
 real_magic:	.quad 0
 video_mode:	.quad 0
+video_flags:	.quad 0
 
 bogus_real_magic:
 	movb	$0xba,%al	;  outb %al,$0x80		
@@ -382,8 +395,10 @@
 	movl	%eax, saved_efer
 	movl	%edx, saved_efer2
 
-#	movq	saved_videomode, %rdx				# FIXME:	 videomode
-	movq	%rdx, video_mode - wakeup_start (,%rdi)
+	movl	saved_video_mode, %edx
+	movl	%edx, video_mode - wakeup_start (,%rdi)
+	movl	acpi_video_flags, %edx
+	movl	%edx, video_flags - wakeup_start (,%rdi)
 	movq	$0x12345678, real_magic - wakeup_start (,%rdi)
 	movq	$0x123456789abcdef0, %rdx
 	movq	%rdx, saved_magic
diff -Nru a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
--- a/arch/x86_64/kernel/entry.S	Sat Jan 24 16:27:48 2004
+++ b/arch/x86_64/kernel/entry.S	Sat Jan 24 16:27:49 2004
@@ -34,6 +34,7 @@
 #include <asm/smp.h>
 #include <asm/cache.h>
 #include <asm/errno.h>
+#include <asm/dwarf2.h>
 #include <asm/calling.h>
 #include <asm/offset.h>
 #include <asm/msr.h>
@@ -41,7 +42,6 @@
 #include <asm/thread_info.h>
 #include <asm/hw_irq.h>
 #include <asm/errno.h>
-#include <asm/dwarf2.h>
 
 	.code64
 
@@ -82,22 +82,53 @@
 	/* push in order ss, rsp, eflags, cs, rip */
 	xorq %rax, %rax
 	pushq %rax /* ss */
+	CFI_ADJUST_CFA_OFFSET	8
 	pushq %rax /* rsp */
+	CFI_ADJUST_CFA_OFFSET	8
+	CFI_OFFSET	rip,0
 	pushq $(1<<9) /* eflags - interrupts on */
+	CFI_ADJUST_CFA_OFFSET	8
 	pushq $__KERNEL_CS /* cs */
+	CFI_ADJUST_CFA_OFFSET	8
 	pushq \child_rip /* rip */
+	CFI_ADJUST_CFA_OFFSET	8
+	CFI_OFFSET	rip,0
 	pushq	%rax /* orig rax */
+	CFI_ADJUST_CFA_OFFSET	8
 	.endm
 
 	.macro UNFAKE_STACK_FRAME
 	addq $8*6, %rsp
+	CFI_ADJUST_CFA_OFFSET	-(6*8)
 	.endm
 
+	.macro	CFI_DEFAULT_STACK
+	CFI_ADJUST_CFA_OFFSET  (SS)
+	CFI_OFFSET	r15,R15-SS
+	CFI_OFFSET	r14,R14-SS
+	CFI_OFFSET	r13,R13-SS
+	CFI_OFFSET	r12,R12-SS
+	CFI_OFFSET	rbp,RBP-SS
+	CFI_OFFSET	rbx,RBX-SS
+	CFI_OFFSET	r11,R11-SS
+	CFI_OFFSET	r10,R10-SS
+	CFI_OFFSET	r9,R9-SS
+	CFI_OFFSET	r8,R8-SS
+	CFI_OFFSET	rax,RAX-SS
+	CFI_OFFSET	rcx,RCX-SS
+	CFI_OFFSET	rdx,RDX-SS
+	CFI_OFFSET	rsi,RSI-SS
+	CFI_OFFSET	rdi,RDI-SS
+	CFI_OFFSET	rsp,RSP-SS
+	CFI_OFFSET	rip,RIP-SS
+	.endm
 /*
  * A newly forked process directly context switches into this.
  */ 	
 /* rdi:	prev */	
 ENTRY(ret_from_fork)
+	CFI_STARTPROC
+	CFI_DEFAULT_STACK
 	call schedule_tail
 	GET_THREAD_INFO(%rcx)
 	bt $TIF_SYSCALL_TRACE,threadinfo_flags(%rcx)
@@ -115,6 +146,7 @@
 	call syscall_trace
 	GET_THREAD_INFO(%rcx)	
 	jmp rff_action
+	CFI_ENDPROC
 
 /*
  * System call entry. Upto 6 arguments in registers are supported.
@@ -144,6 +176,7 @@
  */ 			 		
 
 ENTRY(system_call)
+	CFI_STARTPROC
 	swapgs
 	movq	%rsp,%gs:pda_oldrsp 
 	movq	%gs:pda_kernelstack,%rsp
@@ -283,6 +316,7 @@
 int_restore_rest:
 	RESTORE_REST
 	jmp int_with_check
+	CFI_ENDPROC
 		
 /* 
  * Certain special system calls that need to save a complete full stack frame.
@@ -303,7 +337,9 @@
 	PTREGSCALL stub_iopl, sys_iopl
 
 ENTRY(ptregscall_common)
+	CFI_STARTPROC
 	popq %r11
+	CFI_ADJUST_CFA_OFFSET	-8
 	SAVE_REST
 	movq %r11, %r15
 	FIXUP_TOP_OF_STACK %r11
@@ -312,10 +348,14 @@
 	movq %r15, %r11
 	RESTORE_REST
 	pushq %r11
+	CFI_ADJUST_CFA_OFFSET	8
 	ret
+	CFI_ENDPROC
 	
 ENTRY(stub_execve)
+	CFI_STARTPROC
 	popq %r11
+	CFI_ADJUST_CFA_OFFSET	-8
 	SAVE_REST
 	movq %r11, %r15
 	FIXUP_TOP_OF_STACK %r11
@@ -330,15 +370,18 @@
 	ret
 
 exec_32bit:
+	CFI_ADJUST_CFA_OFFSET	REST_SKIP
 	movq %rax,RAX(%rsp)
 	RESTORE_REST
 	jmp int_ret_from_sys_call
+	CFI_ENDPROC
 	
 /*
  * sigreturn is special because it needs to restore all registers on return.
  * This cannot be done with SYSRET, so use the IRET return path instead.
  */                
 ENTRY(stub_rt_sigreturn)
+	CFI_STARTPROC
 	addq $8, %rsp		
 	SAVE_REST
 	FIXUP_TOP_OF_STACK %r11
@@ -346,6 +389,7 @@
 	movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer
 	RESTORE_REST
 	jmp int_ret_from_sys_call
+	CFI_ENDPROC
 
 /* 
  * Interrupt entry/exit.
@@ -357,10 +401,20 @@
 
 /* 0(%rsp): interrupt number */ 
 	.macro interrupt func
+	CFI_STARTPROC	simple
+	CFI_DEF_CFA	rsp,(SS-ORIG_RAX)
+	CFI_OFFSET	rsp,(RSP-SS)
+	CFI_OFFSET	rip,(RIP-SS)
 	cld
-#ifdef CONFIG_X86_REMOTE_DEBUG
+#ifdef CONFIG_DEBUG_INFO
 	SAVE_ALL	
 	movq %rsp,%rdi
+	/*
+	 * Setup a stack frame pointer.  This allows gdb to trace
+	 * back to the original stack.
+	 */
+	movq %rsp,%rbp
+	CFI_DEF_CFA_REGISTER	rbp
 #else		
 	SAVE_ARGS
 	leaq -ARGOFFSET(%rsp),%rdi	# arg1 for handler
@@ -382,6 +436,9 @@
 	popq  %rdi
 	cli	
 	subl $1,%gs:pda_irqcount
+#ifdef CONFIG_KGDB
+	movq RBP(%rdi),%rbp
+#endif
 	leaq ARGOFFSET(%rdi),%rsp
 exit_intr:	 	
 	GET_THREAD_INFO(%rcx)
@@ -465,6 +522,7 @@
 	movl $0,threadinfo_preempt_count(%rcx) 
 	jmp exit_intr
 #endif	
+	CFI_ENDPROC
 	
 /*
  * APIC interrupts.
@@ -473,6 +531,7 @@
 	pushq $\num-256
 	interrupt \func
 	jmp ret_from_intr
+	CFI_ENDPROC
 	.endm
 
 #ifdef CONFIG_SMP	
@@ -518,24 +577,43 @@
  * and the exception handler in %rax.	
  */ 		  				
 ENTRY(error_entry)
+	CFI_STARTPROC	simple
+	CFI_DEF_CFA	rsp,(SS-RDI)
+	CFI_REL_OFFSET	rsp,(RSP-RDI)
+	CFI_REL_OFFSET	rip,(RIP-RDI)
 	/* rdi slot contains rax, oldrax contains error code */
 	cld	
 	subq  $14*8,%rsp
+	CFI_ADJUST_CFA_OFFSET	(14*8)
 	movq %rsi,13*8(%rsp)
+	CFI_REL_OFFSET	rsi,RSI
 	movq 14*8(%rsp),%rsi	/* load rax from rdi slot */
 	movq %rdx,12*8(%rsp)
+	CFI_REL_OFFSET	rdx,RDX
 	movq %rcx,11*8(%rsp)
+	CFI_REL_OFFSET	rcx,RCX
 	movq %rsi,10*8(%rsp)	/* store rax */ 
+	CFI_REL_OFFSET	rax,RAX
 	movq %r8, 9*8(%rsp)
+	CFI_REL_OFFSET	r8,R8
 	movq %r9, 8*8(%rsp)
+	CFI_REL_OFFSET	r9,R9
 	movq %r10,7*8(%rsp)
+	CFI_REL_OFFSET	r10,R10
 	movq %r11,6*8(%rsp)
+	CFI_REL_OFFSET	r11,R11
 	movq %rbx,5*8(%rsp) 
+	CFI_REL_OFFSET	rbx,RBX
 	movq %rbp,4*8(%rsp) 
+	CFI_REL_OFFSET	rbp,RBP
 	movq %r12,3*8(%rsp) 
+	CFI_REL_OFFSET	r12,R12
 	movq %r13,2*8(%rsp) 
+	CFI_REL_OFFSET	r13,R13
 	movq %r14,1*8(%rsp) 
+	CFI_REL_OFFSET	r14,R14
 	movq %r15,(%rsp) 
+	CFI_REL_OFFSET	r15,R15
 	xorl %ebx,%ebx	
 	testl $3,CS(%rsp)
 	je  error_kernelspace
@@ -561,6 +639,7 @@
 	swapgs 
 	RESTORE_ARGS 0,8,0						
 	iretq
+	CFI_ENDPROC
 
 error_kernelspace:
 	incl %ebx
@@ -615,6 +694,7 @@
  *	rdi: fn, rsi: arg, rdx: flags
  */
 ENTRY(kernel_thread)
+	CFI_STARTPROC
 	FAKE_STACK_FRAME $child_rip
 	SAVE_ALL
 
@@ -642,6 +722,8 @@
 	RESTORE_ALL
 	UNFAKE_STACK_FRAME
 	ret
+	CFI_ENDPROC
+
 	
 child_rip:
 	/*
@@ -671,6 +753,7 @@
  *	rdi: name, rsi: argv, rdx: envp, fake frame on the stack
  */
 ENTRY(execve)
+	CFI_STARTPROC
 	FAKE_STACK_FRAME $0
 	SAVE_ALL	
 	call sys_execve
@@ -681,6 +764,7 @@
 	RESTORE_ARGS
 	UNFAKE_STACK_FRAME
 	ret
+	CFI_ENDPROC
 
 ENTRY(page_fault)
 	errorentry do_page_fault
@@ -692,6 +776,7 @@
 	zeroentry do_simd_coprocessor_error	
 
 ENTRY(device_not_available)
+	CFI_STARTPROC
 	pushq $-1	#error code
 	SAVE_ALL
 	movl  $1,%ebx
@@ -706,11 +791,13 @@
 	cmoveq %rcx,%rdx
 	call  *%rdx
 	jmp  error_exit
+	CFI_ENDPROC
 
 ENTRY(debug)
 	zeroentry do_debug
 
 ENTRY(nmi)
+	CFI_STARTPROC
 	pushq $-1
 	SAVE_ALL
         /* NMI could happen inside the critical section of a swapgs,
@@ -731,6 +818,7 @@
 	swapgs
 2:	RESTORE_ALL 8
 	iretq
+	CFI_ENDPROC
 	
 ENTRY(int3)
 	zeroentry do_int3	
diff -Nru a/arch/x86_64/kernel/i387.c b/arch/x86_64/kernel/i387.c
--- a/arch/x86_64/kernel/i387.c	Sat Jan 24 16:27:48 2004
+++ b/arch/x86_64/kernel/i387.c	Sat Jan 24 16:27:48 2004
@@ -46,11 +46,6 @@
 	current->used_math = 0;
 }
 
-/*
- * The _current_ task is using the FPU for the first time
- * so initialize it and set the mxcsr to its default.
- * remember the current task has used the FPU.
- */
 void init_fpu(struct task_struct *child)
 {
 	if (child->used_math) { 
diff -Nru a/arch/x86_64/kernel/ldt.c b/arch/x86_64/kernel/ldt.c
--- a/arch/x86_64/kernel/ldt.c	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/kernel/ldt.c	Sat Jan 24 16:27:49 2004
@@ -107,7 +107,6 @@
 		retval = copy_ldt(&mm->context, &old_mm->context);
 		up(&old_mm->context.sem);
 	}
-	rwlock_init(&mm->context.ldtlock);
 	return retval;
 }
 
@@ -216,10 +215,8 @@
 
 	/* Install the new entry ...  */
 install:
-	write_lock(&mm->context.ldtlock); 
 	*lp	= entry_1;
 	*(lp+1)	= entry_2;
-	write_unlock(&mm->context.ldtlock);
 	error = 0;
 
 out_unlock:
diff -Nru a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c
--- a/arch/x86_64/kernel/pci-dma.c	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/kernel/pci-dma.c	Sat Jan 24 16:27:50 2004
@@ -35,6 +35,7 @@
 		BUG_ON(!s->page); 
 			s->dma_address = pci_map_page(hwdev, s->page, s->offset, 
 						      s->length, direction); 
+		s->dma_length = s->length;
 	}
 	return nents;
 }
@@ -53,7 +54,7 @@
 		struct scatterlist *s = &sg[i];
 		BUG_ON(s->page == NULL); 
 		BUG_ON(s->dma_address == 0); 
-		pci_unmap_single(dev, s->dma_address, s->length, dir); 
+		pci_unmap_single(dev, s->dma_address, s->dma_length, dir); 
 	} 
 }
 
diff -Nru a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
--- a/arch/x86_64/kernel/pci-gart.c	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/kernel/pci-gart.c	Sat Jan 24 16:27:49 2004
@@ -382,10 +382,12 @@
 				if (i > 0) 
 					pci_unmap_sg(dev, sg, i, dir); 
 				nents = 0; 
+				sg[0].dma_length = 0;
 				break;
 			}
 		}
 		s->dma_address = addr;
+		s->dma_length = s->length;
 	}
 	flush_gart(dev);
 	return nents;
@@ -412,8 +414,9 @@
 			*sout = *s; 
 			sout->dma_address = iommu_bus_base;
 			sout->dma_address += iommu_page*PAGE_SIZE + s->offset;
+			sout->dma_length = s->length;
 		} else { 
-			sout->length += s->length; 
+			sout->dma_length += s->length; 
 		}
 
 		addr = phys_addr;
@@ -436,6 +439,7 @@
 	if (!need) { 
 		BUG_ON(stopat - start != 1);
 		*sout = sg[start]; 
+		sout->dma_length = sg[start].length; 
 		return 0;
 	} 
 	return __pci_map_cont(sg, start, stopat, sout, pages);
@@ -453,8 +457,6 @@
 	unsigned long pages = 0;
 	int need = 0, nextneed;
 
-	unsigned long size = 0; 
-
 	BUG_ON(dir == PCI_DMA_NONE);
 	if (nents == 0) 
 		return 0;
@@ -466,7 +468,6 @@
 		s->dma_address = addr;
 		BUG_ON(s->length == 0); 
 
-		size += s->length; 
 		nextneed = need_iommu(dev, addr, s->length); 
 
 		/* Handle the previous not yet processed entries */
@@ -493,7 +494,7 @@
 	out++;
 	flush_gart(dev);
 	if (out < nents) 
-		sg[out].length = 0; 
+		sg[out].dma_length = 0; 
 	return out;
 
 error:
@@ -540,9 +541,9 @@
 	int i;
 	for (i = 0; i < nents; i++) { 
 		struct scatterlist *s = &sg[i];
-		if (!s->length) 
+		if (!s->dma_length || !s->length) 
 			break;
-		pci_unmap_single(dev, s->dma_address, s->length, dir);
+		pci_unmap_single(dev, s->dma_address, s->dma_length, dir);
 	}
 }
 
@@ -800,7 +801,8 @@
    merge  Do SG merging. Implies force (experimental)  
    nomerge Don't do SG merging.
    forcesac For SAC mode for masks <40bits  (experimental)
-   fullflush Flush IOMMU on each allocation (for testing)
+   fullflush Flush IOMMU on each allocation (default) 
+   nofullflush Don't use IOMMU fullflush
 */
 __init int iommu_setup(char *opt) 
 { 
@@ -838,6 +840,8 @@
 		    iommu_sac_force = 1;
 	    if (!memcmp(p, "fullflush", 9))
 		    iommu_fullflush = 1;
+	    if (!memcmp(p, "nofullflush", 11))
+		    iommu_fullflush = 0;
 #ifdef CONFIG_IOMMU_LEAK
 	    if (!memcmp(p,"leak", 4)) { 
 		    leak_trace = 1;
diff -Nru a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
--- a/arch/x86_64/kernel/process.c	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/kernel/process.c	Sat Jan 24 16:27:49 2004
@@ -152,20 +152,6 @@
 
 __setup("idle=", idle_setup);
 
-void idle_warning(void) 
-{ 
-	static int warned;
-	if (warned)
-		return; 
-	warned = 1;
-	if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) 
-		BUG();
-	printk(KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n"); 
-	printk(KERN_ERR "******* Working around it, but it will cost you a lot of power\n");
-	printk(KERN_ERR "******* Please consider a BIOS update.\n");
-	printk(KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n");
-} 
-
 /* Prints also some state that isn't saved in the pt_regs */ 
 void __show_regs(struct pt_regs * regs)
 {
@@ -234,6 +220,10 @@
 void flush_thread(void)
 {
 	struct task_struct *tsk = current;
+	struct thread_info *t = current_thread_info();
+
+	if (t->flags & _TIF_ABI_PENDING)
+		t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32);
 
 	tsk->thread.debugreg0 = 0;
 	tsk->thread.debugreg1 = 0;
@@ -439,7 +429,6 @@
 	write_pda(oldrsp, next->userrsp); 
 	write_pda(pcurrent, next_p); 
 	write_pda(kernelstack, (unsigned long)next_p->thread_info + THREAD_SIZE - PDA_STACKOFFSET);
-
 
 	/*
 	 * Now maybe reload the debug registers
diff -Nru a/arch/x86_64/kernel/sys_x86_64.c b/arch/x86_64/kernel/sys_x86_64.c
--- a/arch/x86_64/kernel/sys_x86_64.c	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/kernel/sys_x86_64.c	Sat Jan 24 16:27:49 2004
@@ -65,43 +65,78 @@
 	return error;
 }
 
-unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)
+static void find_start_end(unsigned long flags, unsigned long *begin,
+			   unsigned long *end)
 {
-	struct vm_area_struct *vma;
-	unsigned long end = TASK_SIZE;
-
 #ifdef CONFIG_IA32_EMULATION
 	if (test_thread_flag(TIF_IA32)) { 
-		if (!addr) 
-			addr = TASK_UNMAPPED_32;
-		end = IA32_PAGE_OFFSET; 
+		*begin = TASK_UNMAPPED_32;
+		*end = IA32_PAGE_OFFSET; 
 	} else 
 #endif
 	if (flags & MAP_32BIT) { 
-		/* This is usually used needed to map code in small model, so it needs to 
-		   be in the first 31bit. Limit it to that.
-		   This means we need to move the unmapped base down for this case. This can 
-		   give conflicts with the heap, but we assume that glibc malloc knows how 
-		   to fall back to mmap. Give it 1GB of playground for now. -AK */ 
-		if (!addr) 
-			addr = 0x40000000; 
-		end = 0x80000000;		
+		/* This is usually used needed to map code in small
+		   model, so it needs to be in the first 31bit. Limit
+		   it to that.  This means we need to move the
+		   unmapped base down for this case. This can give
+		   conflicts with the heap, but we assume that glibc
+		   malloc knows how to fall back to mmap. Give it 1GB
+		   of playground for now. -AK */ 
+		*begin = 0x40000000; 
+		*end = 0x80000000;		
 	} else { 
-		if (!addr) 
-			addr = TASK_UNMAPPED_64; 
-		end = TASK_SIZE; 
+		*begin = TASK_UNMAPPED_64; 
+		*end = TASK_SIZE; 
 		}
+} 
+
+unsigned long
+arch_get_unmapped_area(struct file *filp, unsigned long addr,
+		unsigned long len, unsigned long pgoff, unsigned long flags)
+{
+	struct mm_struct *mm = current->mm;
+	struct vm_area_struct *vma;
+	unsigned long start_addr;
+	unsigned long begin, end;
+	
+	find_start_end(flags, &begin, &end); 
 
 	if (len > end)
 		return -ENOMEM;
+
+	if (addr) {
 	addr = PAGE_ALIGN(addr);
+		vma = find_vma(mm, addr);
+		if (end - len >= addr &&
+		    (!vma || addr + len <= vma->vm_start))
+			return addr;
+	}
+	addr = mm->free_area_cache;
+	if (addr < begin) 
+		addr = begin; 
+	start_addr = addr;
 
-	for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {
+full_search:
+	for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
 		/* At this point:  (!vma || addr < vma->vm_end). */
-		if (end - len < addr)
+		if (end - len < addr) {
+			/*
+			 * Start a new search - just in case we missed
+			 * some holes.
+			 */
+			if (start_addr != begin) {
+				start_addr = addr = begin;
+				goto full_search;
+			}
 			return -ENOMEM;
-		if (!vma || addr + len <= vma->vm_start)
+		}
+		if (!vma || addr + len <= vma->vm_start) {
+			/*
+			 * Remember the place where we stopped the search:
+			 */
+			mm->free_area_cache = addr + len;
 			return addr;
+		}
 		addr = vma->vm_end;
 	}
 }
diff -Nru a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
--- a/arch/x86_64/kernel/time.c	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/kernel/time.c	Sat Jan 24 16:27:49 2004
@@ -10,6 +10,7 @@
  *  Copyright (c) 1998  Andrea Arcangeli
  *  Copyright (c) 2002  Vojtech Pavlik
  *  Copyright (c) 2003  Andi Kleen
+ *  RTC support code taken from arch/i386/kernel/timers/time_hpet.c
  *
  */
 
@@ -28,6 +29,7 @@
 #include <asm/vsyscall.h>
 #include <asm/timex.h>
 #include <asm/proto.h>
+#include <asm/hpet.h>
 #include <linux/cpufreq.h>
 #ifdef CONFIG_X86_LOCAL_APIC
 #include <asm/apic.h>
@@ -627,10 +629,10 @@
  * and period also hpet_tick.
  */
 
-	hpet_writel(HPET_T0_ENABLE | HPET_T0_PERIODIC | HPET_T0_SETVAL |
-		    HPET_T0_32BIT, HPET_T0_CFG);
-	hpet_writel(hpet_tick, HPET_T0_CMP);
+	hpet_writel(HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
+		    HPET_TN_32BIT, HPET_T0_CFG);
 	hpet_writel(hpet_tick, HPET_T0_CMP);
+	hpet_writel(hpet_tick, HPET_T0_CMP); /* AK: why twice? */
 
 /*
  * Go!
@@ -733,3 +735,229 @@
 }
 
 __setup("report_lost_ticks", time_setup);
+
+#ifdef CONFIG_HPET_EMULATE_RTC
+/* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET
+ * is enabled, we support RTC interrupt functionality in software.
+ * RTC has 3 kinds of interrupts:
+ * 1) Update Interrupt - generate an interrupt, every sec, when RTC clock
+ *    is updated
+ * 2) Alarm Interrupt - generate an interrupt at a specific time of day
+ * 3) Periodic Interrupt - generate periodic interrupt, with frequencies
+ *    2Hz-8192Hz (2Hz-64Hz for non-root user) (all freqs in powers of 2)
+ * (1) and (2) above are implemented using polling at a frequency of
+ * 64 Hz. The exact frequency is a tradeoff between accuracy and interrupt
+ * overhead. (DEFAULT_RTC_INT_FREQ)
+ * For (3), we use interrupts at 64Hz or user specified periodic
+ * frequency, whichever is higher.
+ */
+#include <linux/mc146818rtc.h>
+#include <linux/rtc.h>
+
+extern irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+
+#define DEFAULT_RTC_INT_FREQ 	64
+#define RTC_NUM_INTS 		1
+
+static unsigned long UIE_on;
+static unsigned long prev_update_sec;
+
+static unsigned long AIE_on;
+static struct rtc_time alarm_time;
+
+static unsigned long PIE_on;
+static unsigned long PIE_freq = DEFAULT_RTC_INT_FREQ;
+static unsigned long PIE_count;
+
+static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */
+
+int is_hpet_enabled(void)
+{
+	return vxtime.hpet_address != 0;
+}
+
+/*
+ * Timer 1 for RTC, we do not use periodic interrupt feature,
+ * even if HPET supports periodic interrupts on Timer 1.
+ * The reason being, to set up a periodic interrupt in HPET, we need to
+ * stop the main counter. And if we do that everytime someone diables/enables
+ * RTC, we will have adverse effect on main kernel timer running on Timer 0.
+ * So, for the time being, simulate the periodic interrupt in software.
+ *
+ * hpet_rtc_timer_init() is called for the first time and during subsequent
+ * interuppts reinit happens through hpet_rtc_timer_reinit().
+ */
+int hpet_rtc_timer_init(void)
+{
+	unsigned int cfg, cnt;
+	unsigned long flags;
+
+	if (!is_hpet_enabled())
+		return 0;
+	/*
+	 * Set the counter 1 and enable the interrupts.
+	 */
+	if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
+		hpet_rtc_int_freq = PIE_freq;
+	else
+		hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
+
+	local_irq_save(flags);
+	cnt = hpet_readl(HPET_COUNTER);
+	cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq);
+	hpet_writel(cnt, HPET_T1_CMP);
+	local_irq_restore(flags);
+
+	cfg = hpet_readl(HPET_T1_CFG);
+	cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT;
+	hpet_writel(cfg, HPET_T1_CFG);
+
+	return 1;
+}
+
+static void hpet_rtc_timer_reinit(void)
+{
+	unsigned int cfg, cnt;
+
+	if (!(PIE_on | AIE_on | UIE_on))
+		return;
+
+	if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
+		hpet_rtc_int_freq = PIE_freq;
+	else
+		hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
+
+	/* It is more accurate to use the comparator value than current count.*/
+	cnt = hpet_readl(HPET_T1_CMP);
+	cnt += hpet_tick*HZ/hpet_rtc_int_freq;
+	hpet_writel(cnt, HPET_T1_CMP);
+
+	cfg = hpet_readl(HPET_T1_CFG);
+	cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT;
+	hpet_writel(cfg, HPET_T1_CFG);
+
+	return;
+}
+
+/*
+ * The functions below are called from rtc driver.
+ * Return 0 if HPET is not being used.
+ * Otherwise do the necessary changes and return 1.
+ */
+int hpet_mask_rtc_irq_bit(unsigned long bit_mask)
+{
+	if (!is_hpet_enabled())
+		return 0;
+
+	if (bit_mask & RTC_UIE)
+		UIE_on = 0;
+	if (bit_mask & RTC_PIE)
+		PIE_on = 0;
+	if (bit_mask & RTC_AIE)
+		AIE_on = 0;
+
+	return 1;
+}
+
+int hpet_set_rtc_irq_bit(unsigned long bit_mask)
+{
+	int timer_init_reqd = 0;
+
+	if (!is_hpet_enabled())
+		return 0;
+
+	if (!(PIE_on | AIE_on | UIE_on))
+		timer_init_reqd = 1;
+
+	if (bit_mask & RTC_UIE) {
+		UIE_on = 1;
+	}
+	if (bit_mask & RTC_PIE) {
+		PIE_on = 1;
+		PIE_count = 0;
+	}
+	if (bit_mask & RTC_AIE) {
+		AIE_on = 1;
+	}
+
+	if (timer_init_reqd)
+		hpet_rtc_timer_init();
+
+	return 1;
+}
+
+int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec)
+{
+	if (!is_hpet_enabled())
+		return 0;
+
+	alarm_time.tm_hour = hrs;
+	alarm_time.tm_min = min;
+	alarm_time.tm_sec = sec;
+
+	return 1;
+}
+
+int hpet_set_periodic_freq(unsigned long freq)
+{
+	if (!is_hpet_enabled())
+		return 0;
+
+	PIE_freq = freq;
+	PIE_count = 0;
+
+	return 1;
+}
+
+int hpet_rtc_dropped_irq(void)
+{
+	if (!is_hpet_enabled())
+		return 0;
+
+	return 1;
+}
+
+irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	struct rtc_time curr_time;
+	unsigned long rtc_int_flag = 0;
+	int call_rtc_interrupt = 0;
+
+	hpet_rtc_timer_reinit();
+
+	if (UIE_on | AIE_on) {
+		rtc_get_rtc_time(&curr_time);
+	}
+	if (UIE_on) {
+		if (curr_time.tm_sec != prev_update_sec) {
+			/* Set update int info, call real rtc int routine */
+			call_rtc_interrupt = 1;
+			rtc_int_flag = RTC_UF;
+			prev_update_sec = curr_time.tm_sec;
+		}
+	}
+	if (PIE_on) {
+		PIE_count++;
+		if (PIE_count >= hpet_rtc_int_freq/PIE_freq) {
+			/* Set periodic int info, call real rtc int routine */
+			call_rtc_interrupt = 1;
+			rtc_int_flag |= RTC_PF;
+			PIE_count = 0;
+		}
+	}
+	if (AIE_on) {
+		if ((curr_time.tm_sec == alarm_time.tm_sec) &&
+		    (curr_time.tm_min == alarm_time.tm_min) &&
+		    (curr_time.tm_hour == alarm_time.tm_hour)) {
+			/* Set alarm int info, call real rtc int routine */
+			call_rtc_interrupt = 1;
+			rtc_int_flag |= RTC_AF;
+		}
+	}
+	if (call_rtc_interrupt) {
+		rtc_int_flag |= (RTC_IRQF | (RTC_NUM_INTS << 8));
+		rtc_interrupt(rtc_int_flag, dev_id, regs);
+	}
+	return IRQ_HANDLED;
+}
+#endif
diff -Nru a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
--- a/arch/x86_64/kernel/traps.c	Sat Jan 24 16:27:48 2004
+++ b/arch/x86_64/kernel/traps.c	Sat Jan 24 16:27:48 2004
@@ -405,9 +405,7 @@
 	if ((regs->cs & 3)  != 0) { 
 		struct task_struct *tsk = current;
 
-		if (exception_trace && !(tsk->ptrace & PT_PTRACED) && 
-		    (tsk->sighand->action[signr-1].sa.sa_handler == SIG_IGN ||
-		    (tsk->sighand->action[signr-1].sa.sa_handler == SIG_DFL)))
+		if (exception_trace && unhandled_signal(tsk, signr))
 			printk(KERN_INFO
 			       "%s[%d] trap %s rip:%lx rsp:%lx error:%lx\n",
 			       tsk->comm, tsk->pid, str,
@@ -491,9 +489,7 @@
 	if ((regs->cs & 3)!=0) { 
 		struct task_struct *tsk = current;
 
-		if (exception_trace && !(tsk->ptrace & PT_PTRACED) && 
-		    (tsk->sighand->action[SIGSEGV-1].sa.sa_handler == SIG_IGN ||
-		    (tsk->sighand->action[SIGSEGV-1].sa.sa_handler == SIG_DFL)))
+		if (exception_trace && unhandled_signal(tsk, SIGSEGV))
 			printk(KERN_INFO
 		       "%s[%d] general protection rip:%lx rsp:%lx error:%lx\n",
 			       tsk->comm, tsk->pid,
@@ -553,6 +549,8 @@
 	unsigned char reason = inb(0x61);
 
 	if (!(reason & 0xc0)) {
+		if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) == NOTIFY_BAD)
+			return;
 #ifdef CONFIG_X86_LOCAL_APIC
 		/*
 		 * Ok, so this is none of the documented NMI sources,
diff -Nru a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
--- a/arch/x86_64/kernel/vmlinux.lds.S	Sat Jan 24 16:27:48 2004
+++ b/arch/x86_64/kernel/vmlinux.lds.S	Sat Jan 24 16:27:48 2004
@@ -3,6 +3,7 @@
  */
 
 #include <asm-generic/vmlinux.lds.h>
+#include <linux/config.h>
 
 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
 OUTPUT_ARCH(i386:x86-64)
@@ -137,7 +138,9 @@
   /* Sections to be discarded */
   /DISCARD/ : {
 	*(.exitcall.exit)
+#ifndef CONFIG_DEBUG_INFO
 	*(.eh_frame)
+#endif
 	}
 
   /* DWARF 2 */
diff -Nru a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c
--- a/arch/x86_64/kernel/x8664_ksyms.c	Sat Jan 24 16:27:48 2004
+++ b/arch/x86_64/kernel/x8664_ksyms.c	Sat Jan 24 16:27:48 2004
@@ -149,13 +149,11 @@
 #undef strncpy
 #undef strchr	
 #undef strcmp 
-#undef bcopy
 #undef strcpy 
 #undef strcat
 
 extern void * memset(void *,int,__kernel_size_t);
 extern size_t strlen(const char *);
-extern void bcopy(const char * src, char * dest, int count);
 extern void * memmove(void * dest,const void *src,size_t count);
 extern char * strcpy(char * dest,const char *src);
 extern int strcmp(const char * cs,const char * ct);
@@ -178,7 +176,6 @@
 EXPORT_SYMBOL_NOVERS(strrchr);
 EXPORT_SYMBOL_NOVERS(strnlen);
 EXPORT_SYMBOL_NOVERS(memscan);
-EXPORT_SYMBOL_NOVERS(bcopy);
 EXPORT_SYMBOL_NOVERS(memcpy);
 EXPORT_SYMBOL_NOVERS(__memcpy);
 
diff -Nru a/arch/x86_64/lib/thunk.S b/arch/x86_64/lib/thunk.S
--- a/arch/x86_64/lib/thunk.S	Sat Jan 24 16:27:49 2004
+++ b/arch/x86_64/lib/thunk.S	Sat Jan 24 16:27:49 2004
@@ -8,6 +8,7 @@
 
 	#include <linux/config.h>
 	#include <linux/linkage.h>
+	#include <asm/dwarf2.h>
 	#include <asm/calling.h>			
 	#include <asm/rwlock.h>
 		
@@ -15,18 +16,22 @@
 	.macro thunk name,func
 	.globl \name
 \name:	
+	CFI_STARTPROC
 	SAVE_ARGS
 	call \func
 	jmp  restore
+	CFI_ENDPROC
 	.endm
 
 	/* rdi:	arg1 ... normal C conventions. rax is passed from C. */ 	
 	.macro thunk_retrax name,func
 	.globl \name
 \name:	
+	CFI_STARTPROC
 	SAVE_ARGS
 	call \func
 	jmp  restore_norax
+	CFI_ENDPROC
 	.endm
 	
 
@@ -43,13 +48,20 @@
 	thunk_retrax __down_failed_trylock,__down_trylock
 	thunk __up_wakeup,__up
 	
+	/* SAVE_ARGS below is used only for the .cfi directives it contains. */
+	CFI_STARTPROC
+	SAVE_ARGS
 restore:
 	RESTORE_ARGS
 	ret	
+	CFI_ENDPROC
 	
+	CFI_STARTPROC
+	SAVE_ARGS
 restore_norax:	
 	RESTORE_ARGS 1
 	ret
+	CFI_ENDPROC
 
 #ifdef CONFIG_SMP
 /* Support for read/write spinlocks. */
diff -Nru a/arch/x86_64/lib/usercopy.c b/arch/x86_64/lib/usercopy.c
--- a/arch/x86_64/lib/usercopy.c	Sat Jan 24 16:27:48 2004
+++ b/arch/x86_64/lib/usercopy.c	Sat Jan 24 16:27:48 2004
@@ -88,7 +88,7 @@
 		"	.quad 1b,2b\n"
 		".previous"
 		: [size8] "=c"(size), [dst] "=&D" (__d0)
-		: [size1] "r"(size & 7), "[size8]" (size / 8), "[dst] "(addr),
+		: [size1] "r"(size & 7), "[size8]" (size / 8), "[dst]"(addr),
 		  [zero] "r" (0UL), [eight] "r" (8UL));
 	return size;
 }
diff -Nru a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
--- a/arch/x86_64/mm/fault.c	Sat Jan 24 16:27:48 2004
+++ b/arch/x86_64/mm/fault.c	Sat Jan 24 16:27:48 2004
@@ -32,6 +32,7 @@
 #include <asm/tlbflush.h>
 #include <asm/proto.h>
 #include <asm/kdebug.h>
+#include <asm-generic/sections.h>
 
 void bust_spinlocks(int yes)
 {
@@ -169,8 +170,45 @@
 	printk("BAD\n");
 }
 
-static inline int unhandled_signal(struct task_struct *tsk, int sig)
+static const char errata93_warning[] = 
+KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n"
+KERN_ERR "******* Working around it, but it may cause SEGVs or burn power.\n"
+KERN_ERR "******* Please consider a BIOS update.\n"
+KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n";
+
+/* Workaround for K8 erratum #93 & buggy BIOS.
+   BIOS SMM functions are required to use a specific workaround
+   to avoid corruption of the 64bit RIP register on C stepping K8. 
+   A lot of BIOS that didn't get tested properly miss this. 
+   The OS sees this as a page fault with the upper 32bits of RIP cleared.
+   Try to work around it here.
+   Note we only handle faults in kernel here. */
+
+static int is_errata93(struct pt_regs *regs, unsigned long address) 
+{
+	static int warned;
+	if (address != regs->rip)
+		return 0;
+	if ((address >> 32) != 0) 
+		return 0;
+	address |= 0xffffffffUL << 32;
+	if ((address >= (u64)_stext && address <= (u64)_etext) || 
+	    (address >= MODULES_VADDR && address <= MODULES_END)) { 
+		if (!warned) {
+			printk(errata93_warning); 		
+			warned = 1;
+		}
+		regs->rip = address;
+		return 1;
+	}
+	return 0;
+} 
+
+int unhandled_signal(struct task_struct *tsk, int sig)
 {
+	/* Warn for strace, but not for gdb */
+	if ((tsk->ptrace & (PT_PTRACED|PT_TRACESYSGOOD)) == PT_PTRACED)
+		return 0;
 	return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) ||
 		(tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
 }
@@ -331,8 +369,7 @@
 		if (is_prefetch(regs, address))
 			return;
 
-		if (exception_trace && !(tsk->ptrace & PT_PTRACED) && 
-		    !unhandled_signal(tsk, SIGSEGV)) { 
+		if (exception_trace && !unhandled_signal(tsk, SIGSEGV)) { 
 		printk(KERN_INFO 
 		       "%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
 					tsk->comm, tsk->pid, address, regs->rip,
@@ -360,8 +397,15 @@
 		return;
 	}
 
+	/* 
+	 * Hall of shame of CPU/BIOS bugs.
+	 */
+
  	if (is_prefetch(regs, address))
  		return;
+
+	if (is_errata93(regs, address))
+		return; 
 
 /*
  * Oops. The kernel tried to access some bad page. We'll have to
diff -Nru a/arch/x86_64/mm/k8topology.c b/arch/x86_64/mm/k8topology.c
--- a/arch/x86_64/mm/k8topology.c	Sat Jan 24 16:27:50 2004
+++ b/arch/x86_64/mm/k8topology.c	Sat Jan 24 16:27:50 2004
@@ -47,7 +47,7 @@
 	struct node nodes[MAXNODE];
 	int nodeid, i, nb; 
 	int found = 0;
-	int nmax; 
+	u32 reg;
 
 	nb = find_northbridge(); 
 	if (nb < 0) 
@@ -55,8 +55,10 @@
 
 	printk(KERN_INFO "Scanning NUMA topology in Northbridge %d\n", nb); 
 
-	nmax = (1 << ((read_pci_config(0, nb, 0, 0x60 ) >> 4) & 3)); 
-	numnodes = nmax;
+	reg = read_pci_config(0, nb, 0, 0x60); 
+	numnodes =  ((reg >> 4) & 7) + 1; 
+
+	printk(KERN_INFO "Number of nodes %d (%x)\n", numnodes, reg);
 
 	memset(&nodes,0,sizeof(nodes)); 
 	prevbase = 0;
@@ -66,10 +68,15 @@
 		base = read_pci_config(0, nb, 1, 0x40 + i*8);
 		limit = read_pci_config(0, nb, 1, 0x44 + i*8);
 
-		nodeid = limit & 3; 
+		nodeid = limit & 7; 
 		if ((base & 3) == 0) { 
-			if (i < nmax) 
+			if (i < numnodes) 
 				printk("Skipping disabled node %d\n", i); 
+			continue;
+		} 
+		if (nodeid >= numnodes) { 
+			printk("Ignoring excess node %d (%x:%x)\n", nodeid, 
+			       base, limit); 
 			continue;
 		} 
 
diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c
--- a/drivers/atm/he.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/atm/he.c	Sat Jan 24 16:27:48 2004
@@ -109,10 +109,6 @@
 #define pci_get_drvdata(pci_dev)	(pci_dev)->driver_data
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,44)
-#define pci_pool_create(a, b, c, d, e)	pci_pool_create(a, b, c, d, e, SLAB_KERNEL)
-#endif
-
 #include "he.h"
 
 #include "suni.h"
@@ -1986,8 +1982,7 @@
 			TBRQ_MULTIPLE(he_dev->tbrq_head) ? " MULTIPLE" : "");
 #ifdef USE_TPD_POOL
 		tpd = NULL;
-		p = &he_dev->outstanding_tpds;
-		while ((p = p->next) != &he_dev->outstanding_tpds) {
+		list_for_each(p, &he_dev->outstanding_tpds) {
 			struct he_tpd *__tpd = list_entry(p, struct he_tpd, entry);
 			if (TPD_ADDR(__tpd->status) == TBRQ_TPD(he_dev->tbrq_head)) {
 				tpd = __tpd;
diff -Nru a/drivers/atm/horizon.c b/drivers/atm/horizon.c
--- a/drivers/atm/horizon.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/atm/horizon.c	Sat Jan 24 16:27:48 2004
@@ -359,8 +359,8 @@
 
 static unsigned short debug = 0;
 static unsigned short vpi_bits = 0;
-static unsigned short max_tx_size = 9000;
-static unsigned short max_rx_size = 9000;
+static int max_tx_size = 9000;
+static int max_rx_size = 9000;
 static unsigned char pci_lat = 0;
 
 /********** access functions **********/
@@ -2898,11 +2898,11 @@
     PRINTK (KERN_ERR, "vpi_bits has been limited to %hu",
 	    vpi_bits = HRZ_MAX_VPI);
   
-  if (max_tx_size > TX_AAL5_LIMIT)
+  if (max_tx_size < 0 || max_tx_size > TX_AAL5_LIMIT)
     PRINTK (KERN_NOTICE, "max_tx_size has been limited to %hu",
 	    max_tx_size = TX_AAL5_LIMIT);
   
-  if (max_rx_size > RX_AAL5_LIMIT)
+  if (max_rx_size < 0 || max_rx_size > RX_AAL5_LIMIT)
     PRINTK (KERN_NOTICE, "max_rx_size has been limited to %hu",
 	    max_rx_size = RX_AAL5_LIMIT);
   
@@ -2914,8 +2914,8 @@
 MODULE_LICENSE("GPL");
 MODULE_PARM(debug, "h");
 MODULE_PARM(vpi_bits, "h");
-MODULE_PARM(max_tx_size, "h");
-MODULE_PARM(max_rx_size, "h");
+MODULE_PARM(max_tx_size, "i");
+MODULE_PARM(max_rx_size, "i");
 MODULE_PARM(pci_lat, "b");
 MODULE_PARM_DESC(debug, "debug bitmap, see .h file");
 MODULE_PARM_DESC(vpi_bits, "number of bits (0..4) to allocate to VPIs");
diff -Nru a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
--- a/drivers/base/firmware_class.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/base/firmware_class.c	Sat Jan 24 16:27:48 2004
@@ -361,7 +361,7 @@
 
 	wait_for_completion(&fw_priv->completion);
 
-	del_timer(&fw_priv->timeout);
+	del_timer_sync(&fw_priv->timeout);
 	fw_remove_class_device(class_dev);
 
 	if (fw_priv->fw->size && !fw_priv->abort) {
diff -Nru a/drivers/block/paride/Kconfig b/drivers/block/paride/Kconfig
--- a/drivers/block/paride/Kconfig	Sat Jan 24 16:27:48 2004
+++ b/drivers/block/paride/Kconfig	Sat Jan 24 16:27:48 2004
@@ -130,7 +130,7 @@
 
 config PARIDE_BPCK6
 	tristate "MicroSolutions backpack (Series 6) protocol"
-	depends on PARIDE
+	depends on PARIDE && !64BIT
 	---help---
 	  This option enables support for the Micro Solutions BACKPACK
 	  parallel port Series 6 IDE protocol.  (Most BACKPACK drives made
diff -Nru a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
--- a/drivers/cdrom/cdrom.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/cdrom/cdrom.c	Sat Jan 24 16:27:48 2004
@@ -493,7 +493,6 @@
 		return 0;
 	}
 
-	printk(KERN_ERR "cdrom: %s: unknown mrw mode page\n", cdi->name);
 	return 1;
 }
 
diff -Nru a/drivers/char/drm/Kconfig b/drivers/char/drm/Kconfig
--- a/drivers/char/drm/Kconfig	Sat Jan 24 16:27:49 2004
+++ b/drivers/char/drm/Kconfig	Sat Jan 24 16:27:49 2004
@@ -64,10 +64,9 @@
 	  module will be called i830.  AGP support is required for this driver
 	  to work.
 
-
 config DRM_MGA
 	tristate "Matrox g200/g400"
-	depends on DRM && AGP
+	depends on DRM && AGP && (!X86_64 || BROKEN) 
 	help
 	  Choose this option if you have a Matrox G200, G400 or G450 graphics
 	  card.  If M is selected, the module will be called mga.  AGP
diff -Nru a/drivers/char/keyboard.c b/drivers/char/keyboard.c
--- a/drivers/char/keyboard.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/char/keyboard.c	Sat Jan 24 16:27:49 2004
@@ -493,9 +493,13 @@
 
 static void fn_dec_console(struct vc_data *vc, struct pt_regs *regs)
 {
-	int i;
- 
-	for (i = fg_console-1; i != fg_console; i--) {
+	int i, cur = fg_console;
+
+	/* Currently switching?  Queue this next switch relative to that. */
+	if (want_console != -1)
+		cur = want_console;
+
+	for (i = cur-1; i != cur; i--) {
 		if (i == -1)
 			i = MAX_NR_CONSOLES-1;
 		if (vc_cons_allocated(i))
@@ -506,9 +510,13 @@
 
 static void fn_inc_console(struct vc_data *vc, struct pt_regs *regs)
 {
-	int i;
+	int i, cur = fg_console;
+
+	/* Currently switching?  Queue this next switch relative to that. */
+	if (want_console != -1)
+		cur = want_console;
 
-	for (i = fg_console+1; i != fg_console; i++) {
+	for (i = cur+1; i != cur; i++) {
 		if (i == MAX_NR_CONSOLES)
 			i = 0;
 		if (vc_cons_allocated(i))
@@ -941,14 +949,14 @@
 	 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
 	 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
 	 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
-	 80, 81, 82, 83, 84, 93, 86, 87, 88, 94, 95, 85,259,375,260, 90,
-	284,285,309,311,312, 91,327,328,329,331,333,335,336,337,338,339,
-	367,288,302,304,350, 89,334,326,116,377,109,111,126,347,348,349,
-	360,261,262,263,298,376,100,101,321,316,373,286,289,102,351,355,
+	 80, 81, 82, 83, 84,118, 86, 87, 88,115,120,119,121,112,123, 92,
+	284,285,309,298,312, 91,327,328,329,331,333,335,336,337,338,339,
+	367,288,302,304,350, 89,334,326,267,126,268,269,125,347,348,349,
+	360,261,262,263,268,376,100,101,321,316,373,286,289,102,351,355,
 	103,104,105,275,287,279,306,106,274,107,294,364,358,363,362,361,
 	291,108,381,281,290,272,292,305,280, 99,112,257,258,359,113,114,
-	264,117,271,374,379,115,125,273,121,123, 92,265,266,267,268,269,
-	120,119,118,277,278,282,283,295,296,297,299,300,301,293,303,307,
+	264,117,271,374,379,265,266, 93, 94, 95, 85,259,375,260, 90,116,
+	377,109,111,277,278,282,283,295,296,297,299,300,301,293,303,307,
 	308,310,313,314,315,317,318,319,320,357,322,323,324,325,276,330,
 	332,340,365,342,343,344,345,346,356,270,341,368,369,370,371,372 };
 
@@ -978,10 +986,10 @@
 			put_queue(vc, 0x1d | up_flag);
 			put_queue(vc, 0x45 | up_flag);
 			return 0;
-		case KEY_LANG1:
+		case KEY_HANGUEL:
 			if (!up_flag) put_queue(vc, 0xf1);
 			return 0;
-		case KEY_LANG2:
+		case KEY_HANJA:
 			if (!up_flag) put_queue(vc, 0xf2);
 			return 0;
 	} 
diff -Nru a/drivers/ide/Makefile b/drivers/ide/Makefile
--- a/drivers/ide/Makefile	Sat Jan 24 16:27:49 2004
+++ b/drivers/ide/Makefile	Sat Jan 24 16:27:49 2004
@@ -8,6 +8,9 @@
 # In the future, some of these should be built conditionally.
 #
 # First come modules that register themselves with the core
+
+EXTRA_CFLAGS				+= -Idrivers/ide
+
 obj-$(CONFIG_BLK_DEV_IDE)		+= pci/
 
 # Core IDE code - must come before legacy
diff -Nru a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
--- a/drivers/ide/pci/pdc202xx_new.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/ide/pci/pdc202xx_new.c	Sat Jan 24 16:27:49 2004
@@ -32,6 +32,11 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
+#ifdef CONFIG_PPC_PMAC
+#include <asm/prom.h>
+#include <asm/pci-bridge.h>
+#endif
+
 #include "pdc202xx_new.h"
 
 #define PDC202_DEBUG_CABLE	0
@@ -513,6 +518,44 @@
 #endif
 }
 
+#ifdef CONFIG_PPC_PMAC
+static void __devinit apple_kiwi_init(struct pci_dev *pdev)
+{
+	struct device_node *np = pci_device_to_OF_node(pdev);
+	unsigned int class_rev = 0;
+	unsigned long mmio;
+	u8 conf;
+
+	if (np == NULL || !device_is_compatible(np, "kiwi-root"))
+		return;
+
+	pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
+	class_rev &= 0xff;
+
+	if (class_rev >= 0x03) {
+		/* Setup chip magic config stuff (from darwin) */
+		pci_read_config_byte(pdev, 0x40, &conf);
+		pci_write_config_byte(pdev, 0x40, conf | 0x01);
+	}
+	mmio = (unsigned long)ioremap(pci_resource_start(pdev, 5),
+				      pci_resource_len(pdev, 5));
+
+	/* Setup some PLL stuffs */
+	switch (pdev->device) {
+	case PCI_DEVICE_ID_PROMISE_20270:
+		writew(0x0d2b, mmio + 0x1202);
+		mdelay(30);
+		break;
+	case PCI_DEVICE_ID_PROMISE_20271:
+		writew(0x0826, mmio + 0x1202);
+		mdelay(30);
+		break;
+	}
+
+	iounmap((void *)mmio);
+}
+#endif /* CONFIG_PPC_PMAC */
+
 static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char *name)
 {
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
@@ -521,6 +564,10 @@
 		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n",
 			name, dev->resource[PCI_ROM_RESOURCE].start);
 	}
+
+#ifdef CONFIG_PPC_PMAC
+	apple_kiwi_init(dev);
+#endif
 
 #if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS)
 	pdc202_devs[n_pdc202_devs++] = dev;
diff -Nru a/drivers/input/joydev.c b/drivers/input/joydev.c
--- a/drivers/input/joydev.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/input/joydev.c	Sat Jan 24 16:27:49 2004
@@ -143,7 +143,7 @@
 
 static void joydev_free(struct joydev *joydev)
 {
-	devfs_remove("js%d", joydev->minor);
+	devfs_remove("input/js%d", joydev->minor);
 	joydev_table[joydev->minor] = NULL;
 	class_simple_device_remove(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + joydev->minor));
 	kfree(joydev);
@@ -291,7 +291,7 @@
 	struct joydev_list *list = file->private_data;
 	struct joydev *joydev = list->joydev;
 	struct input_dev *dev = joydev->handle.dev;
-	int i;
+	int i, j;
 
 	if (!joydev->exist) return -ENODEV;
 
@@ -325,8 +325,14 @@
 		case JSIOCGBUTTONS:
 			return put_user(joydev->nkey, (__u8 *) arg);
 		case JSIOCSCORR:
-			return copy_from_user(joydev->corr, (struct js_corr *) arg,
-						sizeof(struct js_corr) * joydev->nabs) ? -EFAULT : 0;
+			if (copy_from_user(joydev->corr, (struct js_corr *)arg,
+				      sizeof(struct js_corr) * joydev->nabs))
+			    return -EFAULT;
+			for (i = 0; i < joydev->nabs; i++) {
+				j = joydev->abspam[i];
+			        joydev->abs[i] = joydev_correct(dev->abs[j], joydev->corr + i);
+			}
+			return 0;
 		case JSIOCGCORR:
 			return copy_to_user((struct js_corr *) arg, joydev->corr,
 						sizeof(struct js_corr) * joydev->nabs) ? -EFAULT : 0;
@@ -427,6 +433,7 @@
 		j = joydev->abspam[i];
 		if (dev->absmax[j] == dev->absmin[j]) {
 			joydev->corr[i].type = JS_CORR_NONE;
+			joydev->abs[i] = dev->abs[j];
 			continue;
 		}
 		joydev->corr[i].type = JS_CORR_BROKEN;
@@ -444,7 +451,7 @@
 	joydev_table[minor] = joydev;
 	
 	devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
-			S_IFCHR|S_IRUGO|S_IWUSR, "js%d", minor);
+			S_IFCHR|S_IRUGO|S_IWUSR, "input/js%d", minor);
 	class_simple_device_add(input_class, 
 				MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
 				dev->dev, "js%d", minor);
diff -Nru a/drivers/input/keyboard/98kbd.c b/drivers/input/keyboard/98kbd.c
--- a/drivers/input/keyboard/98kbd.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/input/keyboard/98kbd.c	Sat Jan 24 16:27:49 2004
@@ -47,9 +47,9 @@
 	  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 43, 14, 15,
 	 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 41, 26, 28, 30, 31, 32,
 	 33, 34, 35, 36, 37, 38, 39, 40, 27, 44, 45, 46, 47, 48, 49, 50,
-	 51, 52, 53, 12, 57,184,109,104,110,111,103,105,106,108,102,107,
-	 74, 98, 71, 72, 73, 55, 75, 76, 77, 78, 79, 80, 81,117, 82,124,
-	 83,185, 87, 88, 85, 89, 90,  0,  0,  0,  0,  0,  0,  0,102,  0,
+	 51, 52, 53, 12, 57, 92,109,104,110,111,103,105,106,108,102,107,
+	 74, 98, 71, 72, 73, 55, 75, 76, 77, 78, 79, 80, 81,117, 82,121,
+	 83, 94, 87, 88,183,184,185,  0,  0,  0,  0,  0,  0,  0,102,  0,
 	 99,133, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,  0,  0,  0,  0,
 	 54, 58, 42, 56, 29
 };
diff -Nru a/drivers/input/keyboard/amikbd.c b/drivers/input/keyboard/amikbd.c
--- a/drivers/input/keyboard/amikbd.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/input/keyboard/amikbd.c	Sat Jan 24 16:27:49 2004
@@ -48,8 +48,8 @@
 static unsigned char amikbd_keycode[0x78] = {
 	 41,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 43,  0, 82,
 	 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,  0, 79, 80, 81,
-	 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,  0,  0, 75, 76, 77,
-	  0, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,  0, 83, 71, 72, 73,
+	 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 43,  0, 75, 76, 77,
+	 86, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,  0, 83, 71, 72, 73,
 	 57, 14, 15, 96, 28,  1,111,  0,  0,  0, 74,  0,103,108,106,105,
 	 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,179,180, 98, 55, 78,138,
 	 42, 54, 58, 29, 56,100,125,126
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/input/keyboard/atkbd.c	Sat Jan 24 16:27:49 2004
@@ -38,7 +38,7 @@
 static int atkbd_set = 2;
 module_param_named(set, atkbd_set, int, 0);
 MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3, 4)");
-#if defined(__i386__) || defined (__x86_64__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__hppa__)
 static int atkbd_reset;
 #else
 static int atkbd_reset = 1;
@@ -57,15 +57,19 @@
  * are loadable via an userland utility.
  */
 
+#if defined(__hppa__)
+#include "hpps2atkbd.h"
+#else
+
 static unsigned char atkbd_set2_keycode[512] = {
 
 	  0, 67, 65, 63, 61, 59, 60, 88,  0, 68, 66, 64, 62, 15, 41,117,
-	  0, 56, 42,182, 29, 16,  2,  0,  0,  0, 44, 31, 30, 17,  3,  0,
-	  0, 46, 45, 32, 18,  5,  4,186,  0, 57, 47, 33, 20, 19,  6, 85,
-	  0, 49, 48, 35, 34, 21,  7, 89,  0,  0, 50, 36, 22,  8,  9, 90,
+	  0, 56, 42, 93, 29, 16,  2,  0,  0,  0, 44, 31, 30, 17,  3,  0,
+	  0, 46, 45, 32, 18,  5,  4, 95,  0, 57, 47, 33, 20, 19,  6,183,
+	  0, 49, 48, 35, 34, 21,  7,184,  0,  0, 50, 36, 22,  8,  9,185,
 	  0, 51, 37, 23, 24, 11, 10,  0,  0, 52, 53, 38, 39, 25, 12,  0,
-	  0,181, 40,  0, 26, 13,  0,  0, 58, 54, 28, 27,  0, 43,  0,194,
-	  0, 86,193,192,184,  0, 14,185,  0, 79,182, 75, 71,124,  0,  0,
+	  0, 89, 40,  0, 26, 13,  0,  0, 58, 54, 28, 27,  0, 43,  0, 85,
+	  0, 86, 91, 90, 92,  0, 14, 94,  0, 79,124, 75, 71,121,  0,  0,
 	 82, 83, 80, 76, 77, 72,  1, 69, 87, 78, 81, 74, 55, 73, 70, 99,
 
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
@@ -80,6 +84,8 @@
 	  0,  0,  0, 65, 99,
 };
 
+#endif
+
 static unsigned char atkbd_set3_keycode[512] = {
 
 	  0,  0,  0,  0,  0,  0,  0, 59,  1,138,128,129,130, 15, 41, 60,
@@ -87,11 +93,11 @@
 	134, 46, 45, 32, 18,  5,  4, 63,135, 57, 47, 33, 20, 19,  6, 64,
 	136, 49, 48, 35, 34, 21,  7, 65,137,100, 50, 36, 22,  8,  9, 66,
 	125, 51, 37, 23, 24, 11, 10, 67,126, 52, 53, 38, 39, 25, 12, 68,
-	113,114, 40, 84, 26, 13, 87, 99, 97, 54, 28, 27, 43, 84, 88, 70,
+	113,114, 40, 43, 26, 13, 87, 99, 97, 54, 28, 27, 43, 43, 88, 70,
 	108,105,119,103,111,107, 14,110,  0, 79,106, 75, 71,109,102,104,
-	 82, 83, 80, 76, 77, 72, 69, 98,  0, 96, 81,  0, 78, 73, 55, 85,
+	 82, 83, 80, 76, 77, 72, 69, 98,  0, 96, 81,  0, 78, 73, 55,183,
 
-	 89, 90, 91, 92, 74,185,184,182,  0,  0,  0,125,126,127,112,  0,
+	184,185,186,187, 74, 94, 92, 93,  0,  0,  0,125,126,127,112,  0,
 	  0,139,150,163,165,115,152,150,166,140,160,154,113,114,167,168,
 	148,149,147,140
 };
@@ -246,10 +252,10 @@
 			atkbd->release = 1;
 			goto out;
 		case ATKBD_RET_HANGUEL:
-			atkbd_report_key(&atkbd->dev, regs, KEY_LANG1, 3);
+			atkbd_report_key(&atkbd->dev, regs, KEY_HANGUEL, 3);
 			goto out;
 		case ATKBD_RET_HANJA:
-			atkbd_report_key(&atkbd->dev, regs, KEY_LANG2, 3);
+			atkbd_report_key(&atkbd->dev, regs, KEY_HANJA, 3);
 			goto out;
 		case ATKBD_RET_ERR:
 			printk(KERN_WARNING "atkbd.c: Keyboard on %s reports too many keys pressed.\n", serio->phys);
@@ -272,6 +278,11 @@
 				atkbd->release ? "released" : "pressed",
 				atkbd->translated ? "translated" : "raw", 
 				atkbd->set, code, serio->phys);
+			if (atkbd->translated && atkbd->set == 2 && code == 0x7a)
+				printk(KERN_WARNING "atkbd.c: This is an XFree86 bug. It shouldn't access"
+					" hardware directly.\n");
+			else
+				printk(KERN_WARNING "atkbd.c: Use 'setkeycodes %s%02x <keycode>' to make it known.\n",						code & 0x80 ? "e0" : "", code & 0x7f);
 			break;
 		default:
 			value = atkbd->release ? 0 :
@@ -338,6 +349,10 @@
 
 	if (command == ATKBD_CMD_RESET_BAT)
 		timeout = 2000000; /* 2 sec */
+
+	if (receive && param)
+		for (i = 0; i < receive; i++)
+			atkbd->cmdbuf[(receive - 1) - i] = param[i];
 	
 	if (command & 0xff)
 		if (atkbd_sendbyte(atkbd, command & 0xff))
@@ -390,7 +405,7 @@
 		 133, 149, 167, 182, 200, 217, 232, 250, 270, 303, 333, 370, 400, 435, 470, 500 };
 	const short delay[4] =
 		{ 250, 500, 750, 1000 };
-	char param[2];
+	unsigned char param[2];
 	int i, j;
 
 	if (!atkbd->write)
@@ -400,9 +415,9 @@
 
 		case EV_LED:
 
-			*param = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0)
-			       | (test_bit(LED_NUML,    dev->led) ? 2 : 0)
-			       | (test_bit(LED_CAPSL,   dev->led) ? 4 : 0);
+			param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0)
+			         | (test_bit(LED_NUML,    dev->led) ? 2 : 0)
+			         | (test_bit(LED_CAPSL,   dev->led) ? 4 : 0);
 		        atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS);
 
 			if (atkbd->set == 4) {
@@ -461,6 +476,7 @@
  * should make sure we don't try to set the LEDs on it.
  */
 
+	param[0] = param[1] = 0xa5;	/* initialize with invalid values */
 	if (atkbd_command(atkbd, param, ATKBD_CMD_GETID)) {
 
 /*
@@ -479,6 +495,11 @@
 		return -1;
 	atkbd->id = (param[0] << 8) | param[1];
 
+	if (atkbd->id == 0xaca1 && atkbd->translated) {
+		printk(KERN_ERR "atkbd.c: NCD terminal keyboards are only supported on non-translating\n");
+		printk(KERN_ERR "atkbd.c: controllers. Use i8042.direct=1 to disable translation.\n");
+		return -1;
+	}
 
 	return 0;
 }
@@ -662,6 +683,7 @@
 
 		if (atkbd_probe(atkbd)) {
 			serio_close(serio);
+			serio->private = NULL;
 			kfree(atkbd);
 			return;
 		}
diff -Nru a/drivers/input/keyboard/hpps2atkbd.h b/drivers/input/keyboard/hpps2atkbd.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/input/keyboard/hpps2atkbd.h	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,105 @@
+/*
+ * drivers/input/keyboard/hpps2atkbd.h
+ *
+ * Copyright (c) 2004 Helge Deller <deller@gmx.de>
+ * Copyright (c) 2002 Laurent Canet <canetl@esiee.fr>
+ * Copyright (c) 2002 Thibaut Varene <varenet@esiee.fr>
+ *
+ * based on linux-2.4's hp_mouse.c & hp_keyb.c
+ * 	Copyright (c) 1999 Alex deVries <adevries@thepuffingroup.com>
+ *	Copyright (c) 1999-2000 Philipp Rumpf <prumpf@tux.org>
+ *	Copyright (c) 2000 Xavier Debacker <debackex@esiee.fr>
+ *	Copyright (c) 2000-2001 Thomas Marteau <marteaut@esiee.fr>
+ *
+ * HP PS/2 AT-compatible Keyboard, found in PA/RISC Workstations
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+
+#define KBD_UNKNOWN 0
+
+/* Raw SET 2 scancode table */
+
+#if 0
+	/* conflicting keys between a RDI Precisionbook keyboard and a normal HP keyboard */
+        keytable[0x07] = KEY_F1;        /* KEY_F12      */
+        keytable[0x11] = KEY_LEFTCTRL;  /* KEY_LEFTALT  */
+        keytable[0x14] = KEY_CAPSLOCK;  /* KEY_LEFTCTRL */
+        keytable[0x61] = KEY_LEFT;      /* KEY_102ND    */
+#endif
+
+
+static unsigned char atkbd_set2_keycode[512] = {
+
+	/* 00 */  KBD_UNKNOWN,  KEY_F9,        KBD_UNKNOWN,   KEY_F5,        KEY_F3,        KEY_F1,       KEY_F2,        KEY_F1,
+	/* 08 */  KEY_ESC,      KEY_F10,       KEY_F8,        KEY_F6,        KEY_F4,        KEY_TAB,      KEY_GRAVE,     KEY_F2,
+	/* 10 */  KBD_UNKNOWN,  KEY_LEFTCTRL,  KEY_LEFTSHIFT, KBD_UNKNOWN,   KEY_CAPSLOCK,  KEY_Q,        KEY_1,         KEY_F3,
+	/* 18 */  KBD_UNKNOWN,  KEY_LEFTALT,   KEY_Z,         KEY_S,         KEY_A,         KEY_W,        KEY_2,         KEY_F4,
+	/* 20 */  KBD_UNKNOWN,  KEY_C,         KEY_X,         KEY_D,         KEY_E,         KEY_4,        KEY_3,         KEY_F5,
+	/* 28 */  KBD_UNKNOWN,  KEY_SPACE,     KEY_V,         KEY_F,         KEY_T,         KEY_R,        KEY_5,         KEY_F6,
+	/* 30 */  KBD_UNKNOWN,  KEY_N,         KEY_B,         KEY_H,         KEY_G,         KEY_Y,        KEY_6,         KEY_F7,
+	/* 38 */  KBD_UNKNOWN,  KEY_RIGHTALT,  KEY_M,         KEY_J,         KEY_U,         KEY_7,        KEY_8,         KEY_F8,
+	/* 40 */  KBD_UNKNOWN,  KEY_COMMA,     KEY_K,         KEY_I,         KEY_O,         KEY_0,        KEY_9,         KEY_F9,
+	/* 48 */  KBD_UNKNOWN,  KEY_DOT,       KEY_SLASH,     KEY_L,         KEY_SEMICOLON, KEY_P,        KEY_MINUS,     KEY_F10,
+	/* 50 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KEY_APOSTROPHE,KBD_UNKNOWN,   KEY_LEFTBRACE, KEY_EQUAL,    KEY_F11,       KEY_SYSRQ,
+	/* 58 */  KEY_CAPSLOCK, KEY_RIGHTSHIFT,KEY_ENTER,     KEY_RIGHTBRACE,KEY_BACKSLASH, KEY_BACKSLASH,KEY_F12,       KEY_SCROLLLOCK,
+	/* 60 */  KEY_DOWN,     KEY_LEFT,      KEY_PAUSE,     KEY_UP,        KEY_DELETE,    KEY_END,      KEY_BACKSPACE, KEY_INSERT,
+	/* 68 */  KBD_UNKNOWN,  KEY_KP1,       KEY_RIGHT,     KEY_KP4,       KEY_KP7,       KEY_PAGEDOWN, KEY_HOME,      KEY_PAGEUP,
+	/* 70 */  KEY_KP0,      KEY_KPDOT,     KEY_KP2,       KEY_KP5,       KEY_KP6,       KEY_KP8,      KEY_ESC,       KEY_NUMLOCK,
+	/* 78 */  KEY_F11,      KEY_KPPLUS,    KEY_KP3,       KEY_KPMINUS,   KEY_KPASTERISK,KEY_KP9,      KEY_SCROLLLOCK,KEY_103RD,
+	/* 80 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 88 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 90 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 98 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* a0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* a8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* b0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* b8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* c0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* c8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* d0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* d8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* e0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* e8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* f0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* f8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+
+	/* These are offset for escaped keycodes: */
+
+	/* 00 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KEY_F7,        KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 08 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KEY_LEFTMETA,  KEY_RIGHTMETA, KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 10 */  KBD_UNKNOWN,  KEY_RIGHTALT,  KBD_UNKNOWN,   KBD_UNKNOWN,   KEY_RIGHTCTRL, KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 18 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 20 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 28 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 30 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 38 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 40 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 48 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KEY_KPSLASH,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 50 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 58 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KEY_KPENTER,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 60 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 68 */  KBD_UNKNOWN,  KEY_END,       KBD_UNKNOWN,   KEY_LEFT,      KEY_HOME,      KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 70 */  KEY_INSERT,   KEY_DELETE,    KEY_DOWN,      KBD_UNKNOWN,   KEY_RIGHT,     KEY_UP,       KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 78 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KEY_PAGEDOWN,  KBD_UNKNOWN,   KEY_SYSRQ,     KEY_PAGEUP,   KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 80 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 88 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 90 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* 98 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* a0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* a8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* b0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* b8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* c0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* c8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* d0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* d8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* e0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* e8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* f0 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,
+	/* f8 */  KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,   KBD_UNKNOWN,  KBD_UNKNOWN,   KBD_UNKNOWN
+
+};
diff -Nru a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c
--- a/drivers/input/keyboard/maple_keyb.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/input/keyboard/maple_keyb.c	Sat Jan 24 16:27:48 2004
@@ -20,13 +20,13 @@
 	  0,  0,  0,  0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
 	 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44,  2,  3,
 	  4,  5,  6,  7,  8,  9, 10, 11, 28,  1, 14, 15, 57, 12, 13, 26,
-	 27, 43, 84, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
+	 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
 	 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106,
 	105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71,
-	 72, 73, 82, 83, 86,127,116,117, 85, 89, 90, 91, 92, 93, 94, 95,
-	120,121,122,123,134,138,130,132,128,129,131,137,133,135,136,113,
-	115,114,  0,  0,  0,124,  0,181,182,183,184,185,186,187,188,189,
-	190,191,192,193,194,195,196,197,198,  0,  0,  0,  0,  0,  0,  0,
+	 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190,
+	191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113,
+	115,114,  0,  0,  0,121,  0, 89, 93,124, 92, 94, 95,  0,  0,  0,
+	122,123, 90, 91, 85,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
diff -Nru a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c
--- a/drivers/input/mouse/logips2pp.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/input/mouse/logips2pp.c	Sat Jan 24 16:27:49 2004
@@ -150,7 +150,7 @@
 	static int logitech_wheel[] = { 52, 53, 75, 76, 80, 81, 83, 88, 112, -1 };
 	static int logitech_ps2pp[] = { 12, 13, 40, 41, 42, 43, 50, 51, 52, 53, 73, 75,
 						76, 80, 81, 83, 88, 96, 97, 112, -1 };
-	static int logitech_mx[] = { 112, -1 };
+	static int logitech_mx[] = { 61, 112, -1 };
 
 	psmouse->vendor = "Logitech";
 	psmouse->model = ((param[0] >> 4) & 0x07) | ((param[0] << 3) & 0x78);
diff -Nru a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/input/mouse/psmouse-base.c	Sat Jan 24 16:27:48 2004
@@ -121,6 +121,19 @@
 	if (psmouse->state == PSMOUSE_IGNORE)
 		goto out;
 
+	if (flags & (SERIO_PARITY|SERIO_TIMEOUT)) {
+		if (psmouse->state == PSMOUSE_ACTIVATED)
+			printk(KERN_WARNING "psmouse.c: bad data from KBC -%s%s\n",
+				flags & SERIO_TIMEOUT ? " timeout" : "",
+				flags & SERIO_PARITY ? " bad parity" : "");
+		if (psmouse->acking) {
+			psmouse->ack = -1;
+			psmouse->acking = 0;
+		}
+		psmouse->pktcnt = 0;
+		goto out;
+	}
+
 	if (psmouse->acking) {
 		switch (data) {
 			case PSMOUSE_RET_ACK:
@@ -231,6 +244,11 @@
 	if (command == PSMOUSE_CMD_RESET_BAT)
                 timeout = 4000000; /* 4 sec */
 
+	/* initialize cmdbuf with preset values from param */
+	if (receive)
+	   for (i = 0; i < receive; i++)
+		psmouse->cmdbuf[(receive - 1) - i] = param[i];
+
 	if (command & 0xff)
 		if (psmouse_sendbyte(psmouse, command & 0xff))
 			return (psmouse->cmdcnt = 0) - 1;
@@ -241,8 +259,9 @@
 
 	while (psmouse->cmdcnt && timeout--) {
 	
-		if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_RESET_BAT)
-			timeout = 100000;
+		if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_RESET_BAT &&
+				timeout > 100000) /* do not run in a endless loop */
+			timeout = 100000; /* 1 sec */
 
 		if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_GETID &&
 		    psmouse->cmdbuf[1] != 0xab && psmouse->cmdbuf[1] != 0xac) {
@@ -410,7 +429,7 @@
  * in case of an IntelliMouse in 4-byte mode or 0x04 for IM Explorer.
  */
 
-	param[0] = param[1] = 0xa5;
+	param[0] = 0xa5;
 
 	if (psmouse_command(psmouse, param, PSMOUSE_CMD_GETID))
 		return -1;
@@ -574,12 +593,14 @@
 	serio->private = psmouse;
 	if (serio_open(serio, dev)) {
 		kfree(psmouse);
+		serio->private = NULL;
 		return;
 	}
 
 	if (psmouse_probe(psmouse) <= 0) {
 		serio_close(serio);
 		kfree(psmouse);
+		serio->private = NULL;
 		return;
 	}
 	
diff -Nru a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
--- a/drivers/input/mouse/psmouse.h	Sat Jan 24 16:27:49 2004
+++ b/drivers/input/mouse/psmouse.h	Sat Jan 24 16:27:49 2004
@@ -67,6 +67,7 @@
 int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command);
 
 extern int psmouse_smartscroll;
+extern unsigned int psmouse_rate;
 extern unsigned int psmouse_resetafter;
 
 #endif /* _PSMOUSE_H */
diff -Nru a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
--- a/drivers/input/mouse/synaptics.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/input/mouse/synaptics.c	Sat Jan 24 16:27:48 2004
@@ -214,7 +214,9 @@
 {
 	struct synaptics_data *priv = psmouse->private;
 
-	mode |= SYN_BIT_ABSOLUTE_MODE | SYN_BIT_HIGH_RATE;
+	mode |= SYN_BIT_ABSOLUTE_MODE;
+	if (psmouse_rate >= 80)
+		mode |= SYN_BIT_HIGH_RATE;
 	if (SYN_ID_MAJOR(priv->identity) >= 4)
 		mode |= SYN_BIT_DISABLE_GESTURE;
 	if (SYN_CAP_EXTENDED(priv->capabilities))
diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
--- a/drivers/input/serio/i8042.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/input/serio/i8042.c	Sat Jan 24 16:27:48 2004
@@ -377,65 +377,63 @@
 	unsigned long flags;
 	unsigned char str, data;
 	unsigned int dfl;
-	struct {
-		int data;
-		int str;
-	} buffer[I8042_BUFFER_SIZE];
-	int i, j = 0;
+	int ret;
 
 	spin_lock_irqsave(&i8042_lock, flags);
-
-	while (j < I8042_BUFFER_SIZE && 
-	    (buffer[j].str = i8042_read_status()) & I8042_STR_OBF)
-		buffer[j++].data = i8042_read_data();
-
+	str = i8042_read_status();
+	data = i8042_read_data();
 	spin_unlock_irqrestore(&i8042_lock, flags);
 
-	for (i = 0; i < j; i++) {
-
-		str = buffer[i].str;
-		data = buffer[i].data;
-
-		dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) |
-		      ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0);
-
-		if (i8042_mux_values[0].exists && (str & I8042_STR_AUXDATA)) {
-
-			if (str & I8042_STR_MUXERR) {
-				switch (data) {
-					case 0xfd:
-					case 0xfe: dfl = SERIO_TIMEOUT; break;
-					case 0xff: dfl = SERIO_PARITY; break;
-				}
-				data = 0xfe;
-			} else dfl = 0;
-
-			dbg("%02x <- i8042 (interrupt, aux%d, %d%s%s)",
-				data, (str >> 6), irq, 
-				dfl & SERIO_PARITY ? ", bad parity" : "",
-				dfl & SERIO_TIMEOUT ? ", timeout" : "");
-
-			serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl, regs);
-			continue;
-		}
+	if (~str & I8042_STR_OBF) {
+		if (irq) dbg("Interrupt %d, without any data", irq);
+		ret = 0;
+		goto out;
+	}
+
+	dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) |
+	      ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0);
+
+	if (i8042_mux_values[0].exists && (str & I8042_STR_AUXDATA)) {
+
+		if (str & I8042_STR_MUXERR) {
+			switch (data) {
+				case 0xfd:
+				case 0xfe: dfl = SERIO_TIMEOUT; break;
+				case 0xff: dfl = SERIO_PARITY; break;
+			}
+			data = 0xfe;
+		} else dfl = 0;
 
-		dbg("%02x <- i8042 (interrupt, %s, %d%s%s)",
-			data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", irq, 
+		dbg("%02x <- i8042 (interrupt, aux%d, %d%s%s)",
+			data, (str >> 6), irq, 
 			dfl & SERIO_PARITY ? ", bad parity" : "",
 			dfl & SERIO_TIMEOUT ? ", timeout" : "");
 
-		if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) {
-			serio_interrupt(&i8042_aux_port, data, dfl, regs);
-			continue;
-		}
+		serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl, regs);
+		
+		goto irq_ret;
+	}
 
-		if (!i8042_kbd_values.exists)
-			continue;
+	dbg("%02x <- i8042 (interrupt, %s, %d%s%s)",
+		data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", irq, 
+		dfl & SERIO_PARITY ? ", bad parity" : "",
+		dfl & SERIO_TIMEOUT ? ", timeout" : "");
 
-		serio_interrupt(&i8042_kbd_port, data, dfl, regs);
+	if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) {
+		serio_interrupt(&i8042_aux_port, data, dfl, regs);
+		goto irq_ret;
 	}
 
-	return IRQ_RETVAL(j);
+	if (!i8042_kbd_values.exists)
+		goto irq_ret;
+
+	serio_interrupt(&i8042_kbd_port, data, dfl, regs);
+
+irq_ret:
+	ret = 1;
+out:
+	mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
+	return IRQ_RETVAL(ret);
 }
 
 /*
@@ -519,17 +517,8 @@
 
 static int __init i8042_check_mux(struct i8042_values *values)
 {
-	static int i8042_check_mux_cookie;
 	unsigned char mux_version;
 
-/*
- * Check if AUX irq is available.
- */
-	if (request_irq(values->irq, i8042_interrupt, SA_SHIRQ,
-				"i8042", &i8042_check_mux_cookie))
-                return -1;
-	free_irq(values->irq, &i8042_check_mux_cookie);
-
 	if (i8042_enable_mux_mode(values, &mux_version))
 		return -1;
 
@@ -635,6 +624,7 @@
 
 	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
 		printk(KERN_WARNING "i8042.c: Can't write CTR while registering.\n");
+		values->exists = 0;
 		return -1; 
 	}
 
@@ -653,7 +643,6 @@
 static void i8042_timer_func(unsigned long data)
 {
 	i8042_interrupt(0, NULL, NULL);
-	mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
 }
 
 
@@ -666,8 +655,6 @@
 static int i8042_controller_init(void)
 {
 
-	if (i8042_noaux)
-		i8042_nomux = 1;
 /*
  * Test the i8042. We need to know if it thinks it's working correctly
  * before doing anything else.
@@ -939,6 +926,9 @@
 
 	dbg_init();
 
+	init_timer(&i8042_timer);
+	i8042_timer.function = i8042_timer_func;
+
 	if (i8042_platform_init())
 		return -EBUSY;
 
@@ -951,20 +941,18 @@
 	if (i8042_dumbkbd)
 		i8042_kbd_port.write = NULL;
 
-	for (i = 0; i < 4; i++)
-		i8042_init_mux_values(i8042_mux_values + i, i8042_mux_port + i, i);
-
-	if (!i8042_nomux && !i8042_check_mux(&i8042_aux_values))
-		for (i = 0; i < 4; i++)
-			i8042_port_register(i8042_mux_values + i, i8042_mux_port + i);
-	else 
-		if (!i8042_noaux && !i8042_check_aux(&i8042_aux_values))
+	if (!i8042_noaux && !i8042_check_aux(&i8042_aux_values)) {
+		if (!i8042_nomux && !i8042_check_mux(&i8042_aux_values))
+			for (i = 0; i < 4; i++) {
+				i8042_init_mux_values(i8042_mux_values + i, i8042_mux_port + i, i);
+				i8042_port_register(i8042_mux_values + i, i8042_mux_port + i);
+			}
+		else
 			i8042_port_register(&i8042_aux_values, &i8042_aux_port);
+	}
 
 	i8042_port_register(&i8042_kbd_values, &i8042_kbd_port);
 
-	init_timer(&i8042_timer);
-	i8042_timer.function = i8042_timer_func;
 	mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
 
         if (sysdev_class_register(&kbc_sysclass) == 0) {
diff -Nru a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
--- a/drivers/macintosh/adbhid.c	Sat Jan 24 16:27:50 2004
+++ b/drivers/macintosh/adbhid.c	Sat Jan 24 16:27:50 2004
@@ -69,8 +69,8 @@
 	 22, 26, 23, 25, 28, 38, 36, 40, 37, 39, 43, 51, 53, 49, 50, 52,
 	 15, 57, 41, 14, 96,  1, 29,125, 42, 58, 56,105,106,108,103,  0,
 	  0, 83,  0, 55,  0, 78,  0, 69,  0,  0,  0, 98, 96,  0, 74,  0,
-	  0,117, 82, 79, 80, 81, 75, 76, 77, 71,  0, 72, 73,183,181,124,
-	 63, 64, 65, 61, 66, 67,191, 87,190, 99,  0, 70,  0, 68,101, 88,
+	  0,117, 82, 79, 80, 81, 75, 76, 77, 71,  0, 72, 73,124, 89,121,
+	 63, 64, 65, 61, 66, 67,123, 87,122, 99,  0, 70,  0, 68,101, 88,
 	  0,119,110,102,104,111, 62,107, 60,109, 59, 54,100, 97,126,116
 };
 
diff -Nru a/drivers/md/Kconfig b/drivers/md/Kconfig
--- a/drivers/md/Kconfig	Sat Jan 24 16:27:48 2004
+++ b/drivers/md/Kconfig	Sat Jan 24 16:27:48 2004
@@ -124,19 +124,13 @@
 	  RAID-5, RAID-6 distributes the syndromes across the drives
 	  in one of the available parity distribution methods.
 
-	  RAID-6 currently requires a specially patched version of
-	  mdadm; the patch is available at:
-
-	  ftp://ftp.kernel.org/pub/linux/kernel/people/hpa/
-
-	  ... and the mdadm source code at ...
+	  RAID-6 requires mdadm-1.5.0 or later, available at:
 
 	  ftp://ftp.kernel.org/pub/linux/utils/raid/mdadm/
 
 	  If you want to use such a RAID-6 set, say Y.  To compile
 	  this code as a module, choose M here: the module will be
 	  called raid6.
-
 
 	  If unsure, say N.
 
diff -Nru a/drivers/md/md.c b/drivers/md/md.c
--- a/drivers/md/md.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/md/md.c	Sat Jan 24 16:27:48 2004
@@ -3106,7 +3106,8 @@
 {
 	if (!mddev->safemode) return;
 	if (mddev->safemode == 2 &&
-	    (atomic_read(&mddev->writes_pending) || mddev->in_sync))
+	    (atomic_read(&mddev->writes_pending) || mddev->in_sync ||
+		    mddev->recovery_cp != MaxSector))
 		return; /* avoid the lock */
 	mddev_lock_uninterruptible(mddev);
 	if (mddev->safemode && !atomic_read(&mddev->writes_pending) &&
diff -Nru a/drivers/md/raid6.h b/drivers/md/raid6.h
--- a/drivers/md/raid6.h	Sat Jan 24 16:27:50 2004
+++ b/drivers/md/raid6.h	Sat Jan 24 16:27:50 2004
@@ -20,6 +20,7 @@
 
 #include <linux/module.h>
 #include <linux/stddef.h>
+#include <linux/compiler.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -45,11 +46,15 @@
 #else /* ! __KERNEL__ */
 /* Used for testing in user space */
 
-#include <stddef.h>
-#include <sys/types.h>
-#include <inttypes.h>
 #include <errno.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <stddef.h>
 #include <sys/mman.h>
+#include <sys/types.h>
+
+/* Not standard, but glibc defines it */
+#define BITS_PER_LONG __WORDSIZE
 
 typedef uint8_t  u8;
 typedef uint16_t u16;
@@ -63,26 +68,12 @@
 
 #define __init
 #define __exit
+#define __attribute_const__ __attribute__((const))
 
 #define preempt_enable()
 #define preempt_disable()
 
 #endif /* __KERNEL__ */
-
-/* Change this from BITS_PER_LONG if there is something better... */
-#if BITS_PER_LONG == 64
-# define NBYTES(x) ((x) * 0x0101010101010101UL)
-# define NSIZE  8
-# define NSHIFT 3
-# define NSTRING "64"
-typedef u64 unative_t;
-#else
-# define NBYTES(x) ((x) * 0x01010101U)
-# define NSIZE  4
-# define NSHIFT 2
-# define NSTRING "32"
-typedef u32 unative_t;
-#endif
 
 /* Routine choices */
 struct raid6_calls {
diff -Nru a/drivers/md/raid6algos.c b/drivers/md/raid6algos.c
--- a/drivers/md/raid6algos.c	Sat Jan 24 16:27:50 2004
+++ b/drivers/md/raid6algos.c	Sat Jan 24 16:27:50 2004
@@ -29,6 +29,7 @@
 extern const struct raid6_calls raid6_intx4;
 extern const struct raid6_calls raid6_intx8;
 extern const struct raid6_calls raid6_intx16;
+extern const struct raid6_calls raid6_intx32;
 extern const struct raid6_calls raid6_mmxx1;
 extern const struct raid6_calls raid6_mmxx2;
 extern const struct raid6_calls raid6_sse1x1;
@@ -46,7 +47,7 @@
 	&raid6_intx16,
 	&raid6_intx32,
 #endif
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__)
 	&raid6_mmxx1,
 	&raid6_mmxx2,
 	&raid6_sse1x1,
@@ -55,6 +56,8 @@
 	&raid6_sse2x2,
 #endif
 #if defined(__x86_64__)
+	&raid6_sse2x1,
+	&raid6_sse2x2,
 	&raid6_sse2x4,
 #endif
 	NULL
diff -Nru a/drivers/md/raid6int.uc b/drivers/md/raid6int.uc
--- a/drivers/md/raid6int.uc	Sat Jan 24 16:27:50 2004
+++ b/drivers/md/raid6int.uc	Sat Jan 24 16:27:50 2004
@@ -1,6 +1,6 @@
 /* -*- linux-c -*- ------------------------------------------------------- *
  *
- *   Copyright 2002 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2002-2004 H. Peter Anvin - All Rights Reserved
  *
  *   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
@@ -15,17 +15,69 @@
  *
  * $#-way unrolled portable integer math RAID-6 instruction set
  *
- * This file is postprocessed using unroller.pl
+ * This file is postprocessed using unroll.pl
  */
 
 #include "raid6.h"
 
 /*
+ * This is the C data type to use
+ */
+
+/* Change this from BITS_PER_LONG if there is something better... */
+#if BITS_PER_LONG == 64
+# define NBYTES(x) ((x) * 0x0101010101010101UL)
+# define NSIZE  8
+# define NSHIFT 3
+# define NSTRING "64"
+typedef u64 unative_t;
+#else
+# define NBYTES(x) ((x) * 0x01010101U)
+# define NSIZE  4
+# define NSHIFT 2
+# define NSTRING "32"
+typedef u32 unative_t;
+#endif
+
+
+
+/*
  * IA-64 wants insane amounts of unrolling.  On other architectures that
  * is just a waste of space.
  */
+#if ($# <= 8) || defined(__ia64__)
+
+
+/*
+ * These sub-operations are separate inlines since they can sometimes be
+ * specially optimized using architecture-specific hacks.
+ */
+
+/*
+ * The SHLBYTE() operation shifts each byte left by 1, *not*
+ * rolling over into the next byte
+ */
+static inline __attribute_const__ unative_t SHLBYTE(unative_t v)
+{
+	unative_t vv;
+
+	vv = (v << 1) & NBYTES(0xfe);
+	return vv;
+}
+
+/*
+ * The MASK() operation returns 0xFF in any byte for which the high
+ * bit is 1, 0x00 for any byte for which the high bit is 0.
+ */
+static inline __attribute_const__ unative_t MASK(unative_t v)
+{
+	unative_t vv;
+
+	vv = v & NBYTES(0x80);
+	vv = (vv << 1) - (vv >> 7); /* Overflow on the top bit is OK */
+	return vv;
+}
 
-#if ($# <= 8) || defined(_ia64__)
 
 static void raid6_int$#_gen_syndrome(int disks, size_t bytes, void **ptrs)
 {
@@ -44,9 +96,8 @@
 		for ( z = z0-1 ; z >= 0 ; z-- ) {
 			wd$$ = *(unative_t *)&dptr[z][d+$$*NSIZE];
 			wp$$ ^= wd$$;
-			w2$$ = wq$$ & NBYTES(0x80);
-			w1$$ = (wq$$ << 1) & NBYTES(0xfe);
-			w2$$ = (w2$$ << 1) - (w2$$ >> 7);
+			w2$$ = MASK(wq$$);
+			w1$$ = SHLBYTE(wq$$);
 			w2$$ &= NBYTES(0x1d);
 			w1$$ ^= w2$$;
 			wq$$ = w1$$ ^ wd$$;
diff -Nru a/drivers/md/raid6mmx.c b/drivers/md/raid6mmx.c
--- a/drivers/md/raid6mmx.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/md/raid6mmx.c	Sat Jan 24 16:27:48 2004
@@ -16,7 +16,7 @@
  * MMX implementation of RAID-6 syndrome functions
  */
 
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__)
 
 #include "raid6.h"
 #include "raid6x86.h"
diff -Nru a/drivers/md/raid6recov.c b/drivers/md/raid6recov.c
--- a/drivers/md/raid6recov.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/md/raid6recov.c	Sat Jan 24 16:27:48 2004
@@ -117,7 +117,7 @@
 		} else {
 			/* data+Q failure.  Reconstruct data from P,
 			   then rebuild syndrome. */
-			/* FIX */
+			/* NOT IMPLEMENTED - equivalent to RAID-5 */
 		}
 	} else {
 		if ( failb == disks-2 ) {
diff -Nru a/drivers/md/raid6sse1.c b/drivers/md/raid6sse1.c
--- a/drivers/md/raid6sse1.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/md/raid6sse1.c	Sat Jan 24 16:27:48 2004
@@ -21,7 +21,7 @@
  * worthwhile as a separate implementation.
  */
 
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__)
 
 #include "raid6.h"
 #include "raid6x86.h"
diff -Nru a/drivers/md/raid6test/Makefile b/drivers/md/raid6test/Makefile
--- a/drivers/md/raid6test/Makefile	Sat Jan 24 16:27:48 2004
+++ b/drivers/md/raid6test/Makefile	Sat Jan 24 16:27:48 2004
@@ -3,10 +3,11 @@
 # from userspace.
 #
 
-CC	= gcc
-CFLAGS	= -I.. -O2 -g -march=i686
-LD	= ld
-PERL	= perl
+CC	 = gcc
+OPTFLAGS = -O2			# Adjust as desired
+CFLAGS	 = -I.. -g $(OPTFLAGS)
+LD	 = ld
+PERL	 = perl
 
 .c.o:
 	$(CC) $(CFLAGS) -c -o $@ $<
@@ -17,12 +18,10 @@
 %.uc: ../%.uc
 	cp -f $< $@
 
-%.pl: ../%.pl
-	cp -f $< $@
-
 all:	raid6.o raid6test
 
 raid6.o: raid6int1.o raid6int2.o raid6int4.o raid6int8.o raid6int16.o \
+	 raid6int32.o \
 	 raid6mmx.o raid6sse1.o raid6sse2.o \
 	 raid6recov.o raid6algos.o \
 	 raid6tables.o
@@ -31,20 +30,23 @@
 raid6test: raid6.o test.c
 	$(CC) $(CFLAGS) -o raid6test $^
 
-raid6int1.c: raid6int.uc unroller.pl
-	$(PERL) ./unroller.pl 1 < raid6int.uc > $@
+raid6int1.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 1 < raid6int.uc > $@
+
+raid6int2.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 2 < raid6int.uc > $@
 
-raid6int2.c: raid6int.uc unroller.pl
-	$(PERL) ./unroller.pl 2 < raid6int.uc > $@
+raid6int4.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 4 < raid6int.uc > $@
 
-raid6int4.c: raid6int.uc unroller.pl
-	$(PERL) ./unroller.pl 4 < raid6int.uc > $@
+raid6int8.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 8 < raid6int.uc > $@
 
-raid6int8.c: raid6int.uc unroller.pl
-	$(PERL) ./unroller.pl 8 < raid6int.uc > $@
+raid6int16.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 16 < raid6int.uc > $@
 
-raid6int16.c: raid6int.uc unroller.pl
-	$(PERL) ./unroller.pl 16 < raid6int.uc > $@
+raid6int32.c: raid6int.uc ../unroll.pl
+	$(PERL) ../unroll.pl 32 < raid6int.uc > $@
 
 raid6tables.c: mktables
 	./mktables > raid6tables.c
diff -Nru a/drivers/md/raid6test/test.c b/drivers/md/raid6test/test.c
--- a/drivers/md/raid6test/test.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/md/raid6test/test.c	Sat Jan 24 16:27:48 2004
@@ -73,14 +73,19 @@
 					erra = memcmp(data[i], recovi, PAGE_SIZE);
 					errb = memcmp(data[j], recovj, PAGE_SIZE);
 
-					printf("algo=%-8s  faila=%3d(%c)  failb=%3d(%c)  %s\n",
-					       raid6_call.name,
-					       i, (i==NDISKS-2)?'P':'D',
-					       j, (j==NDISKS-1)?'Q':(j==NDISKS-2)?'P':'D',
-					       (!erra && !errb) ? "OK" :
-					       !erra ? "ERRB" :
-					       !errb ? "ERRA" :
-					       "ERRAB");
+					if ( i < NDISKS-2 && j == NDISKS-1 ) {
+						/* We don't implement the DQ failure scenario, since it's
+						   equivalent to a RAID-5 failure (XOR, then recompute Q) */
+					} else {
+						printf("algo=%-8s  faila=%3d(%c)  failb=%3d(%c)  %s\n",
+						       raid6_call.name,
+						       i, (i==NDISKS-2)?'P':'D',
+						       j, (j==NDISKS-1)?'Q':(j==NDISKS-2)?'P':'D',
+						       (!erra && !errb) ? "OK" :
+						       !erra ? "ERRB" :
+						       !errb ? "ERRA" :
+						       "ERRAB");
+					}
 
 					dataptrs[i] = data[i];
 					dataptrs[j] = data[j];
diff -Nru a/drivers/md/raid6x86.h b/drivers/md/raid6x86.h
--- a/drivers/md/raid6x86.h	Sat Jan 24 16:27:49 2004
+++ b/drivers/md/raid6x86.h	Sat Jan 24 16:27:49 2004
@@ -1,7 +1,7 @@
 #ident "$Id: raid6x86.h,v 1.3 2002/12/12 22:41:27 hpa Exp $"
 /* ----------------------------------------------------------------------- *
  *
- *   Copyright 2002 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2002-2004 H. Peter Anvin - All Rights Reserved
  *
  *   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
@@ -22,54 +22,75 @@
 
 #if defined(__i386__) || defined(__x86_64__)
 
+#ifdef __x86_64__
+
 typedef struct {
 	unsigned int fsave[27];
-	unsigned int cr0;
-} raid6_mmx_save_t;
+	unsigned long cr0;
+} raid6_mmx_save_t __attribute__((aligned(16)));
 
 /* N.B.: For SSE we only save %xmm0-%xmm7 even for x86-64, since
    the code doesn't know about the additional x86-64 registers */
-/* The +3 is so we can make sure the area is aligned properly */
 typedef struct {
-	unsigned int sarea[8*4+3];
+	unsigned int sarea[8*4];
 	unsigned int cr0;
 } raid6_sse_save_t __attribute__((aligned(16)));
 
-#ifdef __x86_64__
-
 /* This is for x86-64-specific code which uses all 16 XMM registers */
 typedef struct {
-	unsigned int sarea[16*4+3];
-	unsigned int cr0;
+	unsigned int sarea[16*4];
+	unsigned long cr0;
 } raid6_sse16_save_t __attribute__((aligned(16)));
 
+/* On x86-64 the stack is 16-byte aligned */
+#define SAREA(x) (x->sarea)
+
+#else /* __i386__ */
+
+typedef struct {
+	unsigned int fsave[27];
+	unsigned long cr0;
+} raid6_mmx_save_t;
+
+/* On i386, the stack is only 8-byte aligned, but SSE requires 16-byte
+   alignment.  The +3 is so we have the slack space to manually align
+   a properly-sized area correctly.  */
+typedef struct {
+	unsigned int sarea[8*4+3];
+	unsigned long cr0;
+} raid6_sse_save_t;
+
+#define SAREA(x) ((unsigned int *)((((unsigned long)&(x)->sarea)+15) & ~15))
+
 #endif
 
 #ifdef __KERNEL__ /* Real code */
 
- static inline u32 raid6_get_fpu(void)
+/* Note: %cr0 is 32 bits on i386 and 64 bits on x86-64 */
+
+static inline unsigned long raid6_get_fpu(void)
 {
-	u32 cr0;
+	unsigned long cr0;
 
 	preempt_disable();
-	asm volatile("movl %%cr0,%0 ; clts" : "=r" (cr0));
+	asm volatile("mov %%cr0,%0 ; clts" : "=r" (cr0));
 	return cr0;
 }
 
-static inline void raid6_put_fpu(u32 cr0)
+static inline void raid6_put_fpu(unsigned long cr0)
 {
-	asm volatile("movl %0,%%cr0" : : "r" (cr0));
+	asm volatile("mov %0,%%cr0" : : "r" (cr0));
 	preempt_enable();
 }
 
 #else /* Dummy code for user space testing */
 
-static inline u32 raid6_get_fpu(void)
+static inline unsigned long raid6_get_fpu(void)
 {
 	return 0xf00ba6;
 }
 
-static inline void raid6_put_fpu(u32 cr0)
+static inline void raid6_put_fpu(unsigned long cr0)
 {
 	(void)cr0;
 }
@@ -90,13 +111,8 @@
 
 static inline void raid6_before_sse(raid6_sse_save_t *s)
 {
-#ifdef __x86_64__
-	unsigned int *rsa = s->sarea;
-#else
-	/* On i386 the save area may not be aligned */
-	unsigned int *rsa =
-		(unsigned int *)((((unsigned long)&s->sarea)+15) & ~15);
-#endif
+	unsigned int *rsa = SAREA(s);
+
 	s->cr0 = raid6_get_fpu();
 
 	asm volatile("movaps %%xmm0,%0" : "=m" (rsa[0]));
@@ -111,13 +127,8 @@
 
 static inline void raid6_after_sse(raid6_sse_save_t *s)
 {
-#ifdef __x86_64__
-	unsigned int *rsa = s->sarea;
-#else
-	/* On i386 the save area may not be aligned */
-	unsigned int *rsa =
-		(unsigned int *)((((unsigned long)&s->sarea)+15) & ~15);
-#endif
+	unsigned int *rsa = SAREA(s);
+
 	asm volatile("movaps %0,%%xmm0" : : "m" (rsa[0]));
 	asm volatile("movaps %0,%%xmm1" : : "m" (rsa[4]));
 	asm volatile("movaps %0,%%xmm2" : : "m" (rsa[8]));
@@ -132,13 +143,8 @@
 
 static inline void raid6_before_sse2(raid6_sse_save_t *s)
 {
-#ifdef __x86_64__
-	unsigned int *rsa = &s->sarea;
-#else
-	/* On i386 the save area may not be aligned */
-	unsigned int *rsa =
-		(unsigned int *)((((unsigned long)&s->sarea)+15) & ~15);
-#endif
+	unsigned int *rsa = SAREA(s);
+
 	s->cr0 = raid6_get_fpu();
 
 	asm volatile("movdqa %%xmm0,%0" : "=m" (rsa[0]));
@@ -153,13 +159,8 @@
 
 static inline void raid6_after_sse2(raid6_sse_save_t *s)
 {
-#ifdef __x86_64__
-	unsigned int *rsa = s->sarea;
-#else
-	/* On i386 the save area may not be aligned */
-	unsigned int *rsa =
-		(unsigned int *)((((unsigned long)&s->sarea)+15) & ~15);
-#endif
+	unsigned int *rsa = SAREA(s);
+
 	asm volatile("movdqa %0,%%xmm0" : : "m" (rsa[0]));
 	asm volatile("movdqa %0,%%xmm1" : : "m" (rsa[4]));
 	asm volatile("movdqa %0,%%xmm2" : : "m" (rsa[8]));
@@ -174,9 +175,9 @@
 
 #ifdef __x86_64__
 
-static inline raid6_before_sse16(raid6_sse16_save_t *s)
+static inline void raid6_before_sse16(raid6_sse16_save_t *s)
 {
-	unsigned int *rsa = s->sarea;
+	unsigned int *rsa = SAREA(s);
 
 	s->cr0 = raid6_get_fpu();
 
@@ -198,9 +199,9 @@
 	asm volatile("movdqa %%xmm15,%0" : "=m" (rsa[60]));
 }
 
-static inline raid6_after_sse16(raid6_sse16_save_t *s)
+static inline void raid6_after_sse16(raid6_sse16_save_t *s)
 {
-	unsigned int *rsa = s->sarea;
+	unsigned int *rsa = SAREA(s);
 
 	asm volatile("movdqa %0,%%xmm0" : : "m" (rsa[0]));
 	asm volatile("movdqa %0,%%xmm1" : : "m" (rsa[4]));
diff -Nru a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c	Sat Jan 24 16:27:49 2004
@@ -30,6 +30,7 @@
 #include <linux/version.h>
 #include <linux/interrupt.h>
 #include <linux/firmware.h>
+#include <linux/init.h>
 
 #include "dmxdev.h"
 #include "dvb_demux.h"
@@ -1145,7 +1146,7 @@
 		    0x00, 0x00, 0x00, 0x00,
 		    0x61, 0x00 };
 	u8 b1[] = { 0x61 };
-	u8 b[ARM_PACKET_SIZE];
+	u8 *b;
 	char idstring[21];
 	u8 *firmware = NULL;
 	size_t firmware_size = 0;
@@ -1202,6 +1203,10 @@
 	trans_count = 0;
 	j = 0;
 
+	b = kmalloc(ARM_PACKET_SIZE, GFP_KERNEL);
+	if (b == NULL)
+		return -ENOMEM;
+
 	for (i = 0; i < firmware_size; i += COMMAND_PACKET_SIZE) {
 		size = firmware_size - i;
 		if (size > COMMAND_PACKET_SIZE)
@@ -1228,6 +1233,8 @@
 	}
 
 	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+
+	kfree(b);
 
 	return result;
 }
diff -Nru a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
--- a/drivers/media/video/w9966.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/media/video/w9966.c	Sat Jan 24 16:27:48 2004
@@ -875,6 +875,7 @@
 	unsigned char addr = 0xa0;	// ECP, read, CCD-transfer, 00000
 	unsigned char* dest = (unsigned char*)buf;
 	unsigned long dleft = count;
+	unsigned char *tbuf;
 	
 	// Why would anyone want more than this??
 	if (count > cam->width * cam->height * 2)
@@ -894,25 +895,33 @@
 		w9966_pdev_release(cam);
 		return -EFAULT;
 	}
-	
+
+	tbuf = kmalloc(W9966_RBUFFER, GFP_KERNEL);
+	if (tbuf == NULL) {
+		count = -ENOMEM;
+		goto out;
+	}
+
 	while(dleft > 0)
 	{
 		unsigned long tsize = (dleft > W9966_RBUFFER) ? W9966_RBUFFER : dleft;
-		unsigned char tbuf[W9966_RBUFFER];
 	
 		if (parport_read(cam->pport, tbuf, tsize) < tsize) {
-			w9966_pdev_release(cam);
-			return -EFAULT;
+			count = -EFAULT;
+			goto out;
 		}
 		if (copy_to_user(dest, tbuf, tsize) != 0) {
-			w9966_pdev_release(cam);
-			return -EFAULT;
+			count = -EFAULT;
+			goto out;
 		}
 		dest += tsize;
 		dleft -= tsize;
 	}
-	
+
 	w9966_wReg(cam, 0x01, 0x18);	// Disable capture
+
+out:
+	kfree(tbuf);
 	w9966_pdev_release(cam);
 
 	return count;
diff -Nru a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig
--- a/drivers/message/i2o/Kconfig	Sat Jan 24 16:27:48 2004
+++ b/drivers/message/i2o/Kconfig	Sat Jan 24 16:27:48 2004
@@ -3,7 +3,7 @@
 
 config I2O
 	tristate "I2O support"
-	depends on PCI
+	depends on PCI && !64BIT
 	---help---
 	  The Intelligent Input/Output (I2O) architecture allows hardware
 	  drivers to be split into two parts: an operating system specific
diff -Nru a/drivers/net/8139cp.c b/drivers/net/8139cp.c
--- a/drivers/net/8139cp.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/net/8139cp.c	Sat Jan 24 16:27:49 2004
@@ -615,8 +615,10 @@
 		if (cpr16(IntrStatus) & cp_rx_intr_mask)
 			goto rx_status_loop;
 
-		netif_rx_complete(dev);
+		local_irq_disable();
 		cpw16_f(IntrMask, cp_intr_mask);
+		__netif_rx_complete(dev);
+		local_irq_enable();
 
 		return 0;	/* done */
 	}
@@ -643,6 +645,12 @@
 
 	spin_lock(&cp->lock);
 
+	/* close possible race's with dev_close */
+	if (unlikely(!netif_running(dev))) {
+		cpw16(IntrMask, 0);
+		goto out;
+	}
+
 	if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) {
 		if (netif_rx_schedule_prep(dev)) {
 			cpw16_f(IntrMask, cp_norx_intr_mask);
@@ -664,7 +672,7 @@
 
 		/* TODO: reset hardware */
 	}
-
+out:
 	spin_unlock(&cp->lock);
 	return IRQ_HANDLED;
 }
diff -Nru a/drivers/net/dummy.c b/drivers/net/dummy.c
--- a/drivers/net/dummy.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/net/dummy.c	Sat Jan 24 16:27:49 2004
@@ -112,7 +112,7 @@
 	return err;
 }
 
-static void __exit dummy_free_one(int index) 
+static void dummy_free_one(int index)
 {
 	unregister_netdev(dummies[index]);
 	free_netdev(dummies[index]);
diff -Nru a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
--- a/drivers/net/irda/Kconfig	Sat Jan 24 16:27:49 2004
+++ b/drivers/net/irda/Kconfig	Sat Jan 24 16:27:49 2004
@@ -65,6 +65,75 @@
 	  dongles you will have to start irattach like this:
 	  "irattach -d tekram".
 
+config LITELINK_DONGLE
+	tristate "Parallax LiteLink dongle"
+	depends on DONGLE && IRDA
+	help
+	  Say Y here if you want to build support for the Parallax Litelink
+	  dongle.  To compile it as a module, choose M here.  The Parallax
+	  dongle attaches to the normal 9-pin serial port connector, and can
+	  currently only be used by IrTTY.  To activate support for Parallax
+	  dongles you will have to start irattach like this:
+	  "irattach -d litelink".
+
+config MA600_DONGLE
+	tristate "Mobile Action MA600 dongle"
+	depends on DONGLE && IRDA && EXPERIMENTAL
+	help
+	  Say Y here if you want to build support for the Mobile Action MA600
+	  dongle.  To compile it as a module, choose M here. The MA600 dongle
+	  attaches to the normal 9-pin serial port connector, and can
+	  currently only be used by IrTTY.  The driver should also support
+	  the MA620 USB version of the dongle, if the integrated USB-to-RS232
+	  converter is supported by usbserial. To activate support for
+	  MA600 dongle you will have to start irattach like this:
+	  "irattach -d ma600".
+
+config GIRBIL_DONGLE
+	tristate "Greenwich GIrBIL dongle"
+	depends on DONGLE && IRDA && EXPERIMENTAL
+	help
+	  Say Y here if you want to build support for the Greenwich GIrBIL
+	  dongle.  If you want to compile it as a module, choose M here.
+	  The Greenwich dongle attaches to the normal 9-pin serial port
+	  connector, and can currently only be used by IrTTY.  To activate
+	  support for Greenwich dongles you will have to start irattach
+	  like this: "irattach -d girbil".
+
+config MCP2120_DONGLE
+	tristate "Microchip MCP2120"
+	depends on DONGLE && IRDA && EXPERIMENTAL
+	help
+	  Say Y here if you want to build support for the Microchip MCP2120
+	  dongle.  If you want to compile it as a module, choose M here.
+	  The MCP2120 dongle attaches to the normal 9-pin serial port
+	  connector, and can currently only be used by IrTTY.  To activate
+	  support for MCP2120 dongles you will have to start irattach
+	  like this: "irattach -d mcp2120".
+
+	  You must build this dongle yourself.  For more information see:
+	  <http://www.eyetap.org/~tangf/irda_sir_linux.html>
+
+config OLD_BELKIN_DONGLE
+	tristate "Old Belkin dongle"
+	depends on DONGLE && IRDA && EXPERIMENTAL
+	help
+	  Say Y here if you want to build support for the Adaptec Airport 1000
+	  and 2000 dongles.  If you want to compile it as a module, choose
+	  M here. Some information is contained in the comments
+	  at the top of <file:drivers/net/irda/old_belkin.c>.
+
+config ACT200L_DONGLE
+	tristate "ACTiSYS IR-200L dongle"
+	depends on DONGLE && IRDA && EXPERIMENTAL
+	help
+	  Say Y here if you want to build support for the ACTiSYS IR-200L
+	  dongle. If you want to compile it as a module, choose M here.
+	  The ACTiSYS IR-200L dongle attaches to the normal 9-pin serial
+	  port connector, and can currently only be used by IrTTY.
+	  To activate support for ACTiSYS IR-200L dongle you will have to
+	  start irattach like this: "irattach -d act200l".
+
 comment "Old SIR device drivers"
 
 config IRPORT_SIR
@@ -130,7 +199,7 @@
 	  dongles you will have to start irattach like this:
 	  "irattach -d tekram".
 
-config GIRBIL_DONGLE
+config GIRBIL_DONGLE_OLD
 	tristate "Greenwich GIrBIL dongle"
 	depends on DONGLE_OLD && IRDA
 	help
@@ -141,7 +210,7 @@
 	  dongles you will have to insert "irattach -d girbil" in the
 	  /etc/irda/drivers script.
 
-config LITELINK_DONGLE
+config LITELINK_DONGLE_OLD
 	tristate "Parallax LiteLink dongle"
 	depends on DONGLE_OLD && IRDA
 	help
@@ -152,7 +221,7 @@
 	  dongles you will have to start irattach like this:
 	  "irattach -d litelink".
 
-config MCP2120_DONGLE
+config MCP2120_DONGLE_OLD
 	tristate "Microchip MCP2120"
 	depends on DONGLE_OLD && IRDA
 	help
@@ -166,7 +235,7 @@
 	  You must build this dongle yourself.  For more information see:
 	  <http://www.eyetap.org/~tangf/irda_sir_linux.html>
 
-config OLD_BELKIN_DONGLE
+config OLD_BELKIN_DONGLE_OLD
 	tristate "Old Belkin dongle"
 	depends on DONGLE_OLD && IRDA
 	help
@@ -175,11 +244,7 @@
 	  will be called old_belkin.  Some information is contained in the
 	  comments at the top of <file:drivers/net/irda/old_belkin.c>.
 
-config EP7211_IR
-	tristate "EP7211 I/R support"
-	depends on DONGLE_OLD && ARCH_EP7211 && IRDA
-
-config ACT200L_DONGLE
+config ACT200L_DONGLE_OLD
 	tristate "ACTiSYS IR-200L dongle (EXPERIMENTAL)"
 	depends on DONGLE_OLD && EXPERIMENTAL && IRDA
 	help
@@ -190,7 +255,7 @@
 	  ACTiSYS IR-200L dongles you will have to start irattach like this:
 	  "irattach -d act200l".
 
-config MA600_DONGLE
+config MA600_DONGLE_OLD
 	tristate "Mobile Action MA600 dongle (EXPERIMENTAL)"
 	depends on DONGLE_OLD && EXPERIMENTAL && IRDA
 	---help---
@@ -205,6 +270,10 @@
 
 	  There is a pre-compiled module on
 	  <http://engsvr.ust.hk/~eetwl95/download/ma600-2.4.x.tar.gz>
+
+config EP7211_IR
+	tristate "EP7211 I/R support"
+	depends on DONGLE_OLD && ARCH_EP7211 && IRDA
 
 comment "FIR device drivers"
 
diff -Nru a/drivers/net/irda/Makefile b/drivers/net/irda/Makefile
--- a/drivers/net/irda/Makefile	Sat Jan 24 16:27:49 2004
+++ b/drivers/net/irda/Makefile	Sat Jan 24 16:27:49 2004
@@ -21,20 +21,26 @@
 obj-$(CONFIG_ESI_DONGLE_OLD)		+= esi.o
 obj-$(CONFIG_TEKRAM_DONGLE_OLD)	+= tekram.o
 obj-$(CONFIG_ACTISYS_DONGLE_OLD)	+= actisys.o
-obj-$(CONFIG_GIRBIL_DONGLE)	+= girbil.o
-obj-$(CONFIG_LITELINK_DONGLE)	+= litelink.o
-obj-$(CONFIG_OLD_BELKIN_DONGLE)	+= old_belkin.o
+obj-$(CONFIG_GIRBIL_DONGLE_OLD)	+= girbil.o
+obj-$(CONFIG_LITELINK_DONGLE_OLD)	+= litelink.o
+obj-$(CONFIG_OLD_BELKIN_DONGLE_OLD)	+= old_belkin.o
+obj-$(CONFIG_MCP2120_DONGLE_OLD)	+= mcp2120.o
+obj-$(CONFIG_ACT200L_DONGLE_OLD)	+= act200l.o
+obj-$(CONFIG_MA600_DONGLE_OLD)	+= ma600.o
 obj-$(CONFIG_EP7211_IR)		+= ep7211_ir.o
-obj-$(CONFIG_MCP2120_DONGLE)	+= mcp2120.o
 obj-$(CONFIG_AU1000_FIR)	+= au1k_ir.o
-obj-$(CONFIG_ACT200L_DONGLE)	+= act200l.o
-obj-$(CONFIG_MA600_DONGLE)	+= ma600.o
 # New SIR drivers
 obj-$(CONFIG_IRTTY_SIR)		+= irtty-sir.o	sir-dev.o
 # New dongles drivers for new SIR drivers
 obj-$(CONFIG_ESI_DONGLE)	+= esi-sir.o
 obj-$(CONFIG_TEKRAM_DONGLE)	+= tekram-sir.o
 obj-$(CONFIG_ACTISYS_DONGLE)	+= actisys-sir.o
+obj-$(CONFIG_LITELINK_DONGLE)	+= litelink-sir.o
+obj-$(CONFIG_GIRBIL_DONGLE)	+= girbil-sir.o
+obj-$(CONFIG_OLD_BELKIN_DONGLE)	+= old_belkin-sir.o
+obj-$(CONFIG_MCP2120_DONGLE)	+= mcp2120-sir.o
+obj-$(CONFIG_ACT200L_DONGLE)	+= act200l-sir.o
+obj-$(CONFIG_MA600_DONGLE)	+= ma600-sir.o
 
 # The SIR helper module
 sir-dev-objs := sir_core.o sir_dev.o sir_dongle.o sir_kthread.o
diff -Nru a/drivers/net/irda/act200l-sir.c b/drivers/net/irda/act200l-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/act200l-sir.c	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,258 @@
+/*********************************************************************
+ *
+ * Filename:      act200l.c
+ * Version:       0.8
+ * Description:   Implementation for the ACTiSYS ACT-IR200L dongle
+ * Status:        Experimental.
+ * Author:        SHIMIZU Takuya <tshimizu@ga2.so-net.ne.jp>
+ * Created at:    Fri Aug  3 17:35:42 2001
+ * Modified at:   Fri Aug 17 10:22:40 2001
+ * Modified by:   SHIMIZU Takuya <tshimizu@ga2.so-net.ne.jp>
+ *
+ *     Copyright (c) 2001 SHIMIZU Takuya, All Rights Reserved.
+ *
+ *     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.
+ *
+ ********************************************************************/
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <net/irda/irda.h>
+
+#include "sir-dev.h"
+
+static int act200l_reset(struct sir_dev *dev);
+static int act200l_open(struct sir_dev *dev);
+static int act200l_close(struct sir_dev *dev);
+static int act200l_change_speed(struct sir_dev *dev, unsigned speed);
+
+/* Regsiter 0: Control register #1 */
+#define ACT200L_REG0    0x00
+#define ACT200L_TXEN    0x01 /* Enable transmitter */
+#define ACT200L_RXEN    0x02 /* Enable receiver */
+
+/* Register 1: Control register #2 */
+#define ACT200L_REG1    0x10
+#define ACT200L_LODB    0x01 /* Load new baud rate count value */
+#define ACT200L_WIDE    0x04 /* Expand the maximum allowable pulse */
+
+/* Register 4: Output Power register */
+#define ACT200L_REG4    0x40
+#define ACT200L_OP0     0x01 /* Enable LED1C output */
+#define ACT200L_OP1     0x02 /* Enable LED2C output */
+#define ACT200L_BLKR    0x04
+
+/* Register 5: Receive Mode register */
+#define ACT200L_REG5    0x50
+#define ACT200L_RWIDL   0x01 /* fixed 1.6us pulse mode */
+
+/* Register 6: Receive Sensitivity register #1 */
+#define ACT200L_REG6    0x60
+#define ACT200L_RS0     0x01 /* receive threshold bit 0 */
+#define ACT200L_RS1     0x02 /* receive threshold bit 1 */
+
+/* Register 7: Receive Sensitivity register #2 */
+#define ACT200L_REG7    0x70
+#define ACT200L_ENPOS   0x04 /* Ignore the falling edge */
+
+/* Register 8,9: Baud Rate Dvider register #1,#2 */
+#define ACT200L_REG8    0x80
+#define ACT200L_REG9    0x90
+
+#define ACT200L_2400    0x5f
+#define ACT200L_9600    0x17
+#define ACT200L_19200   0x0b
+#define ACT200L_38400   0x05
+#define ACT200L_57600   0x03
+#define ACT200L_115200  0x01
+
+/* Register 13: Control register #3 */
+#define ACT200L_REG13   0xd0
+#define ACT200L_SHDW    0x01 /* Enable access to shadow registers */
+
+/* Register 15: Status register */
+#define ACT200L_REG15   0xf0
+
+/* Register 21: Control register #4 */
+#define ACT200L_REG21   0x50
+#define ACT200L_EXCK    0x02 /* Disable clock output driver */
+#define ACT200L_OSCL    0x04 /* oscillator in low power, medium accuracy mode */
+
+static struct dongle_driver act200l = {
+	.owner		= THIS_MODULE,
+	.driver_name	= "ACTiSYS ACT-IR200L",
+	.type		= IRDA_ACT200L_DONGLE,
+	.open		= act200l_open,
+	.close		= act200l_close,
+	.reset		= act200l_reset,
+	.set_speed	= act200l_change_speed,
+};
+
+int __init act200l_init(void)
+{
+	return irda_register_dongle(&act200l);
+}
+
+void __exit act200l_cleanup(void)
+{
+	irda_unregister_dongle(&act200l);
+}
+
+static int act200l_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+
+	/* Power on the dongle */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Set the speeds we can accept */
+	qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
+	qos->min_turn_time.bits = 0x03;
+	irda_qos_bits_to_value(qos);
+
+	/* irda thread waits 50 msec for power settling */
+
+	return 0;
+}
+
+static int act200l_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+
+	/* Power off the dongle */
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+/*
+ * Function act200l_change_speed (dev, speed)
+ *
+ *    Set the speed for the ACTiSYS ACT-IR200L type dongle.
+ *
+ */
+static int act200l_change_speed(struct sir_dev *dev, unsigned speed)
+{
+	u8 control[3];
+	int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+
+	/* Clear DTR and set RTS to enter command mode */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
+
+	switch (speed) {
+	default:
+		ret = -EINVAL;
+		/* fall through */
+	case 9600:
+		control[0] = ACT200L_REG8 |  (ACT200L_9600       & 0x0f);
+		control[1] = ACT200L_REG9 | ((ACT200L_9600 >> 4) & 0x0f);
+		break;
+	case 19200:
+		control[0] = ACT200L_REG8 |  (ACT200L_19200       & 0x0f);
+		control[1] = ACT200L_REG9 | ((ACT200L_19200 >> 4) & 0x0f);
+		break;
+	case 38400:
+		control[0] = ACT200L_REG8 |  (ACT200L_38400       & 0x0f);
+		control[1] = ACT200L_REG9 | ((ACT200L_38400 >> 4) & 0x0f);
+		break;
+	case 57600:
+		control[0] = ACT200L_REG8 |  (ACT200L_57600       & 0x0f);
+		control[1] = ACT200L_REG9 | ((ACT200L_57600 >> 4) & 0x0f);
+		break;
+	case 115200:
+		control[0] = ACT200L_REG8 |  (ACT200L_115200       & 0x0f);
+		control[1] = ACT200L_REG9 | ((ACT200L_115200 >> 4) & 0x0f);
+		break;
+	}
+	control[2] = ACT200L_REG1 | ACT200L_LODB | ACT200L_WIDE;
+
+	/* Write control bytes */
+	sirdev_raw_write(dev, control, 3);
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(5));
+
+	/* Go back to normal mode */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	dev->speed = speed;
+	return ret;
+}
+
+/*
+ * Function act200l_reset (driver)
+ *
+ *    Reset the ACTiSYS ACT-IR200L type dongle.
+ */
+
+#define ACT200L_STATE_WAIT1_RESET	(SIRDEV_STATE_DONGLE_RESET+1)
+#define ACT200L_STATE_WAIT2_RESET	(SIRDEV_STATE_DONGLE_RESET+2)
+
+static int act200l_reset(struct sir_dev *dev)
+{
+	unsigned state = dev->fsm.substate;
+	unsigned delay = 0;
+	u8 control[9] = {
+		ACT200L_REG15,
+		ACT200L_REG13 | ACT200L_SHDW,
+		ACT200L_REG21 | ACT200L_EXCK | ACT200L_OSCL,
+		ACT200L_REG13,
+		ACT200L_REG7  | ACT200L_ENPOS,
+		ACT200L_REG6  | ACT200L_RS0  | ACT200L_RS1,
+		ACT200L_REG5  | ACT200L_RWIDL,
+		ACT200L_REG4  | ACT200L_OP0  | ACT200L_OP1 | ACT200L_BLKR,
+		ACT200L_REG0  | ACT200L_TXEN | ACT200L_RXEN
+	};
+	int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
+
+	switch (state) {
+	case SIRDEV_STATE_DONGLE_RESET:
+		/* Reset the dongle : set RTS low for 25 ms */
+		sirdev_set_dtr_rts(dev, TRUE, FALSE);
+		state = ACT200L_STATE_WAIT1_RESET;
+		delay = 50;
+		break;
+
+	case ACT200L_STATE_WAIT1_RESET:
+		/* Clear DTR and set RTS to enter command mode */
+		sirdev_set_dtr_rts(dev, FALSE, TRUE);
+
+		udelay(25);			/* better wait for some short while */
+
+		/* Write control bytes */
+		sirdev_raw_write(dev, control, sizeof(control));
+		state = ACT200L_STATE_WAIT2_RESET;
+		delay = 15;
+		break;
+
+	case ACT200L_STATE_WAIT2_RESET:
+		/* Go back to normal mode */
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
+		dev->speed = 9600;
+		break;
+	default:
+		ERROR("%s(), unknown state %d\n", __FUNCTION__, state);
+		ret = -1;
+		break;
+	}
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
+}
+
+MODULE_AUTHOR("SHIMIZU Takuya <tshimizu@ga2.so-net.ne.jp>");
+MODULE_DESCRIPTION("ACTiSYS ACT-IR200L dongle driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-10"); /* IRDA_ACT200L_DONGLE */
+
+module_init(act200l_init);
+module_exit(act200l_cleanup);
diff -Nru a/drivers/net/irda/actisys-sir.c b/drivers/net/irda/actisys-sir.c
--- a/drivers/net/irda/actisys-sir.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/net/irda/actisys-sir.c	Sat Jan 24 16:27:49 2004
@@ -65,7 +65,7 @@
 
 /* These are the baudrates supported, in the order available */
 /* Note : the 220L doesn't support 38400, but we will fix that below */
-static __u32 baud_rates[] = { 9600, 19200, 57600, 115200, 38400 };
+static unsigned baud_rates[] = { 9600, 19200, 57600, 115200, 38400 };
 
 #define MAX_SPEEDS (sizeof(baud_rates)/sizeof(baud_rates[0]))
 
@@ -118,7 +118,7 @@
 {
 	struct qos_info *qos = &dev->qos;
 
-	dev->set_dtr_rts(dev, TRUE, TRUE);
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
 
 	/* Set the speeds we can accept */
 	qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
@@ -130,13 +130,15 @@
 	qos->min_turn_time.bits = 0x7f; /* Needs 0.01 ms */
 	irda_qos_bits_to_value(qos);
 
+	/* irda thread waits 50 msec for power settling */
+
 	return 0;
 }
 
 static int actisys_close(struct sir_dev *dev)
 {
 	/* Power off the dongle */
-	dev->set_dtr_rts(dev, FALSE, FALSE);
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
 
 	return 0;
 }
@@ -174,23 +176,25 @@
 	 * Now, we can set the speed requested. Send RTS pulses until we
          * reach the target speed 
 	 */
-	for (i=0; i<MAX_SPEEDS; i++) {
+	for (i = 0; i < MAX_SPEEDS; i++) {
 		if (speed == baud_rates[i]) {
-			dev->speed = baud_rates[i];
+			dev->speed = speed;
 			break;
 		}
 		/* Set RTS low for 10 us */
-		dev->set_dtr_rts(dev, TRUE, FALSE);
+		sirdev_set_dtr_rts(dev, TRUE, FALSE);
 		udelay(MIN_DELAY);
 
 		/* Set RTS high for 10 us */
-		dev->set_dtr_rts(dev, TRUE, TRUE);
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
 		udelay(MIN_DELAY);
 	}
 
 	/* Check if life is sweet... */
-	if (i >= MAX_SPEEDS)
-		ret = -1;  /* This should not happen */
+	if (i >= MAX_SPEEDS) {
+		actisys_reset(dev);
+		ret = -EINVAL;  /* This should not happen */
+	}
 
 	/* Basta lavoro, on se casse d'ici... */
 	return ret;
@@ -221,11 +225,11 @@
 static int actisys_reset(struct sir_dev *dev)
 {
 	/* Reset the dongle : set DTR low for 10 us */
-	dev->set_dtr_rts(dev, FALSE, TRUE);
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
 	udelay(MIN_DELAY);
 
 	/* Go back to normal mode */
-	dev->set_dtr_rts(dev, TRUE, TRUE);
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
 	
 	dev->speed = 9600;	/* That's the default */
 
diff -Nru a/drivers/net/irda/esi-sir.c b/drivers/net/irda/esi-sir.c
--- a/drivers/net/irda/esi-sir.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/net/irda/esi-sir.c	Sat Jan 24 16:27:49 2004
@@ -68,11 +68,14 @@
 {
 	struct qos_info *qos = &dev->qos;
 
+	/* Power up and set dongle to 9600 baud */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
+
 	qos->baud_rate.bits &= IR_9600|IR_19200|IR_115200;
 	qos->min_turn_time.bits = 0x01; /* Needs at least 10 ms */
 	irda_qos_bits_to_value(qos);
 
-	/* shouldn't we do set_dtr_rts(FALSE, TRUE) here (power up at 9600)? */
+	/* irda thread waits 50 msec for power settling */
 
 	return 0;
 }
@@ -80,7 +83,7 @@
 static int esi_close(struct sir_dev *dev)
 {
 	/* Power off dongle */
-	dev->set_dtr_rts(dev, FALSE, FALSE);
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
 
 	return 0;
 }
@@ -88,11 +91,13 @@
 /*
  * Function esi_change_speed (task)
  *
- *    Set the speed for the Extended Systems JetEye PC ESI-9680 type dongle
+ * Set the speed for the Extended Systems JetEye PC ESI-9680 type dongle
+ * Apparently (see old esi-driver) no delays are needed here...
  *
  */
 static int esi_change_speed(struct sir_dev *dev, unsigned speed)
 {
+	int ret = 0;
 	int dtr, rts;
 	
 	switch (speed) {
@@ -104,6 +109,7 @@
 		dtr = rts = TRUE;
 		break;
 	default:
+		ret = -EINVAL;
 		speed = 9600;
 		/* fall through */
 	case 9600:
@@ -113,12 +119,10 @@
 	}
 
 	/* Change speed of dongle */
-	dev->set_dtr_rts(dev, dtr, rts);
+	sirdev_set_dtr_rts(dev, dtr, rts);
 	dev->speed = speed;
 
-	/* do we need some delay for power stabilization? */
-
-	return 0;
+	return ret;
 }
 
 /*
@@ -129,9 +133,18 @@
  */
 static int esi_reset(struct sir_dev *dev)
 {
-	dev->set_dtr_rts(dev, FALSE, FALSE);
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	/* Hm, the old esi-driver left the dongle unpowered relying on
+	 * the following speed change to repower. This might work for
+	 * the esi because we only need the modem lines. However, now the
+	 * general rule is reset must bring the dongle to some working
+	 * well-known state because speed change might write to registers.
+	 * The old esi-driver didn't any delay here - let's hope it' fine.
+	 */
 
-	/* Hm, probably repower to 9600 and some delays? */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
+	dev->speed = 9600;
 
 	return 0;
 }
diff -Nru a/drivers/net/irda/girbil-sir.c b/drivers/net/irda/girbil-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/girbil-sir.c	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,258 @@
+/*********************************************************************
+ *
+ * Filename:      girbil.c
+ * Version:       1.2
+ * Description:   Implementation for the Greenwich GIrBIL dongle
+ * Status:        Experimental.
+ * Author:        Dag Brattli <dagb@cs.uit.no>
+ * Created at:    Sat Feb  6 21:02:33 1999
+ * Modified at:   Fri Dec 17 09:13:20 1999
+ * Modified by:   Dag Brattli <dagb@cs.uit.no>
+ *
+ *     Copyright (c) 1999 Dag Brattli, All Rights Reserved.
+ *     
+ *     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.
+ * 
+ *     Neither Dag Brattli nor University of Tromsø admit liability nor
+ *     provide warranty for any of this software. This material is
+ *     provided "AS-IS" and at no charge.
+ *
+ ********************************************************************/
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <net/irda/irda.h>
+
+#include "sir-dev.h"
+
+static int girbil_reset(struct sir_dev *dev);
+static int girbil_open(struct sir_dev *dev);
+static int girbil_close(struct sir_dev *dev);
+static int girbil_change_speed(struct sir_dev *dev, unsigned speed);
+
+/* Control register 1 */
+#define GIRBIL_TXEN    0x01 /* Enable transmitter */
+#define GIRBIL_RXEN    0x02 /* Enable receiver */
+#define GIRBIL_ECAN    0x04 /* Cancel self emmited data */
+#define GIRBIL_ECHO    0x08 /* Echo control characters */
+
+/* LED Current Register (0x2) */
+#define GIRBIL_HIGH    0x20
+#define GIRBIL_MEDIUM  0x21
+#define GIRBIL_LOW     0x22
+
+/* Baud register (0x3) */
+#define GIRBIL_2400    0x30
+#define GIRBIL_4800    0x31
+#define GIRBIL_9600    0x32
+#define GIRBIL_19200   0x33
+#define GIRBIL_38400   0x34
+#define GIRBIL_57600   0x35
+#define GIRBIL_115200  0x36
+
+/* Mode register (0x4) */
+#define GIRBIL_IRDA    0x40
+#define GIRBIL_ASK     0x41
+
+/* Control register 2 (0x5) */
+#define GIRBIL_LOAD    0x51 /* Load the new baud rate value */
+
+static struct dongle_driver girbil = {
+	.owner		= THIS_MODULE,
+	.driver_name	= "Greenwich GIrBIL",
+	.type		= IRDA_GIRBIL_DONGLE,
+	.open		= girbil_open,
+	.close		= girbil_close,
+	.reset		= girbil_reset,
+	.set_speed	= girbil_change_speed,
+};
+
+int __init girbil_init(void)
+{
+	return irda_register_dongle(&girbil);
+}
+
+void __exit girbil_cleanup(void)
+{
+	irda_unregister_dongle(&girbil);
+}
+
+static int girbil_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power on dongle */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
+	qos->min_turn_time.bits = 0x03;
+	irda_qos_bits_to_value(qos);
+
+	/* irda thread waits 50 msec for power settling */
+
+	return 0;
+}
+
+static int girbil_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power off dongle */
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+/*
+ * Function girbil_change_speed (dev, speed)
+ *
+ *    Set the speed for the Girbil type dongle.
+ *
+ */
+
+#define GIRBIL_STATE_WAIT_SPEED	(SIRDEV_STATE_DONGLE_SPEED + 1)
+
+static int girbil_change_speed(struct sir_dev *dev, unsigned speed)
+{
+	unsigned state = dev->fsm.substate;
+	unsigned delay = 0;
+	u8 control[2];
+	static int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* dongle alread reset - port and dongle at default speed */
+
+	switch(state) {
+
+	case SIRDEV_STATE_DONGLE_SPEED:
+
+		/* Set DTR and Clear RTS to enter command mode */
+		sirdev_set_dtr_rts(dev, FALSE, TRUE);
+
+		udelay(25);		/* better wait a little while */
+
+		ret = 0;
+		switch (speed) {
+		default:
+			ret = -EINVAL;
+			/* fall through */
+		case 9600:
+			control[0] = GIRBIL_9600;
+			break;
+		case 19200:
+			control[0] = GIRBIL_19200;
+			break;
+		case 34800:
+			control[0] = GIRBIL_38400;
+			break;
+		case 57600:
+			control[0] = GIRBIL_57600;
+			break;
+		case 115200:
+			control[0] = GIRBIL_115200;
+			break;
+		}
+		control[1] = GIRBIL_LOAD;
+	
+		/* Write control bytes */
+		sirdev_raw_write(dev, control, 2);
+
+		dev->speed = speed;
+
+		state = GIRBIL_STATE_WAIT_SPEED;
+		delay = 100;
+		break;
+
+	case GIRBIL_STATE_WAIT_SPEED:
+		/* Go back to normal mode */
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+		udelay(25);		/* better wait a little while */
+		break;
+
+	default:
+		ERROR("%s - undefined state %d\n", __FUNCTION__, state);
+		ret = -EINVAL;
+		break;
+	}
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
+}
+
+/*
+ * Function girbil_reset (driver)
+ *
+ *      This function resets the girbil dongle.
+ *
+ *      Algorithm:
+ *    	  0. set RTS, and wait at least 5 ms
+ *        1. clear RTS
+ */
+
+
+#define GIRBIL_STATE_WAIT1_RESET	(SIRDEV_STATE_DONGLE_RESET + 1)
+#define GIRBIL_STATE_WAIT2_RESET	(SIRDEV_STATE_DONGLE_RESET + 2)
+#define GIRBIL_STATE_WAIT3_RESET	(SIRDEV_STATE_DONGLE_RESET + 3)
+
+static int girbil_reset(struct sir_dev *dev)
+{
+	unsigned state = dev->fsm.substate;
+	unsigned delay = 0;
+	u8 control = GIRBIL_TXEN | GIRBIL_RXEN;
+	int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	switch (state) {
+	case SIRDEV_STATE_DONGLE_RESET:
+		/* Reset dongle */
+		sirdev_set_dtr_rts(dev, TRUE, FALSE);
+		/* Sleep at least 5 ms */
+		delay = 20;
+		state = GIRBIL_STATE_WAIT1_RESET;
+		break;
+
+	case GIRBIL_STATE_WAIT1_RESET:
+		/* Set DTR and clear RTS to enter command mode */
+		sirdev_set_dtr_rts(dev, FALSE, TRUE);
+		delay = 20;
+		state = GIRBIL_STATE_WAIT2_RESET;
+		break;
+
+	case GIRBIL_STATE_WAIT2_RESET:
+		/* Write control byte */
+		sirdev_raw_write(dev, &control, 1);
+		delay = 20;
+		state = GIRBIL_STATE_WAIT3_RESET;
+		break;
+
+	case GIRBIL_STATE_WAIT3_RESET:
+		/* Go back to normal mode */
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
+		dev->speed = 9600;
+		break;
+
+	default:
+		ERROR("%s(), undefined state %d\n", __FUNCTION__, state);
+		ret = -1;
+		break;
+	}
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
+}
+
+MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
+MODULE_DESCRIPTION("Greenwich GIrBIL dongle driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-4"); /* IRDA_GIRBIL_DONGLE */
+
+module_init(girbil_init);
+module_exit(girbil_cleanup);
diff -Nru a/drivers/net/irda/litelink-sir.c b/drivers/net/irda/litelink-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/litelink-sir.c	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,209 @@
+/*********************************************************************
+ *                
+ * Filename:      litelink.c
+ * Version:       1.1
+ * Description:   Driver for the Parallax LiteLink dongle
+ * Status:        Stable
+ * Author:        Dag Brattli <dagb@cs.uit.no>
+ * Created at:    Fri May  7 12:50:33 1999
+ * Modified at:   Fri Dec 17 09:14:23 1999
+ * Modified by:   Dag Brattli <dagb@cs.uit.no>
+ * 
+ *     Copyright (c) 1999 Dag Brattli, All Rights Reserved.
+ *     
+ *     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
+ *     
+ ********************************************************************/
+
+/*
+ * Modified at:   Thu Jan 15 2003
+ * Modified by:   Eugene Crosser <crosser@average.org>
+ *
+ * Convert to "new" IRDA infrastructure for kernel 2.6
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <net/irda/irda.h>
+
+#include "sir-dev.h"
+
+#define MIN_DELAY 25      /* 15 us, but wait a little more to be sure */
+#define MAX_DELAY 10000   /* 1 ms */
+
+static int litelink_open(struct sir_dev *dev);
+static int litelink_close(struct sir_dev *dev);
+static int litelink_change_speed(struct sir_dev *dev, unsigned speed);
+static int litelink_reset(struct sir_dev *dev);
+
+/* These are the baudrates supported - 9600 must be last one! */
+static unsigned baud_rates[] = { 115200, 57600, 38400, 19200, 9600 };
+
+static struct dongle_driver litelink = {
+	.owner		= THIS_MODULE,
+	.driver_name	= "Parallax LiteLink",
+	.type		= IRDA_LITELINK_DONGLE,
+	.open		= litelink_open,
+	.close		= litelink_close,
+	.reset		= litelink_reset,
+	.set_speed	= litelink_change_speed,
+};
+
+int __init litelink_sir_init(void)
+{
+	return irda_register_dongle(&litelink);
+}
+
+void __exit litelink_sir_cleanup(void)
+{
+	irda_unregister_dongle(&litelink);
+}
+
+static int litelink_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power up dongle */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Set the speeds we can accept */
+	qos->baud_rate.bits &= IR_115200|IR_57600|IR_38400|IR_19200|IR_9600;
+	qos->min_turn_time.bits = 0x7f; /* Needs 0.01 ms */
+	irda_qos_bits_to_value(qos);
+
+	/* irda thread waits 50 msec for power settling */
+
+	return 0;
+}
+
+static int litelink_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power off dongle */
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+/*
+ * Function litelink_change_speed (task)
+ *
+ *    Change speed of the Litelink dongle. To cycle through the available 
+ *    baud rates, pulse RTS low for a few ms.  
+ */
+static int litelink_change_speed(struct sir_dev *dev, unsigned speed)
+{
+        int i;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* dongle already reset by irda-thread - current speed (dongle and
+	 * port) is the default speed (115200 for litelink!)
+	 */
+
+	/* Cycle through avaiable baudrates until we reach the correct one */
+	for (i = 0; baud_rates[i] != speed; i++) {
+
+		/* end-of-list reached due to invalid speed request */
+		if (baud_rates[i] == 9600)
+			break;
+
+		/* Set DTR, clear RTS */
+		sirdev_set_dtr_rts(dev, FALSE, TRUE);
+
+		/* Sleep a minimum of 15 us */
+		udelay(MIN_DELAY);
+
+		/* Set DTR, Set RTS */
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+		/* Sleep a minimum of 15 us */
+		udelay(MIN_DELAY);
+        }
+
+	dev->speed = baud_rates[i];
+
+	/* invalid baudrate should not happen - but if, we return -EINVAL and
+	 * the dongle configured for 9600 so the stack has a chance to recover
+	 */
+
+	return (dev->speed == speed) ? 0 : -EINVAL;
+}
+
+/*
+ * Function litelink_reset (task)
+ *
+ *      Reset the Litelink type dongle.
+ *
+ */
+static int litelink_reset(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* probably the power-up can be dropped here, but with only
+	 * 15 usec delay it's not worth the risk unless somebody with
+	 * the hardware confirms it doesn't break anything...
+	 */
+
+	/* Power on dongle */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Sleep a minimum of 15 us */
+	udelay(MIN_DELAY);
+
+	/* Clear RTS to reset dongle */
+	sirdev_set_dtr_rts(dev, TRUE, FALSE);
+
+	/* Sleep a minimum of 15 us */
+	udelay(MIN_DELAY);
+
+	/* Go back to normal mode */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Sleep a minimum of 15 us */
+	udelay(MIN_DELAY);
+
+	/* This dongles speed defaults to 115200 bps */
+	dev->speed = 115200;
+
+	return 0;
+}
+
+MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
+MODULE_DESCRIPTION("Parallax Litelink dongle driver");	
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-5"); /* IRDA_LITELINK_DONGLE */
+
+/*
+ * Function init_module (void)
+ *
+ *    Initialize Litelink module
+ *
+ */
+module_init(litelink_sir_init);
+
+/*
+ * Function cleanup_module (void)
+ *
+ *    Cleanup Litelink module
+ *
+ */
+module_exit(litelink_sir_cleanup);
diff -Nru a/drivers/net/irda/ma600-sir.c b/drivers/net/irda/ma600-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/ma600-sir.c	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,268 @@
+/*********************************************************************
+ *                
+ * Filename:      ma600.c
+ * Version:       0.1
+ * Description:   Implementation of the MA600 dongle
+ * Status:        Experimental.
+ * Author:        Leung <95Etwl@alumni.ee.ust.hk> http://www.engsvr.ust/~eetwl95
+ * Created at:    Sat Jun 10 20:02:35 2000
+ * Modified at:   Sat Aug 16 09:34:13 2003
+ * Modified by:   Martin Diehl <mad@mdiehl.de> (modified for new sir_dev)
+ *
+ * Note: very thanks to Mr. Maru Wang <maru@mobileaction.com.tw> for providing 
+ *       information on the MA600 dongle
+ * 
+ *     Copyright (c) 2000 Leung, All Rights Reserved.
+ *      
+ *     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
+ *     
+ ********************************************************************/
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+
+#include <net/irda/irda.h>
+
+#include "sir-dev.h"
+
+static int ma600_open(struct sir_dev *);
+static int ma600_close(struct sir_dev *);
+static int ma600_change_speed(struct sir_dev *, unsigned);
+static int ma600_reset(struct sir_dev *);
+
+/* control byte for MA600 */
+#define MA600_9600	0x00
+#define MA600_19200	0x01
+#define MA600_38400	0x02
+#define MA600_57600	0x03
+#define MA600_115200	0x04
+#define MA600_DEV_ID1	0x05
+#define MA600_DEV_ID2	0x06
+#define MA600_2400	0x08
+
+static struct dongle_driver ma600 = {
+	.owner          = THIS_MODULE,
+	.driver_name    = "MA600",
+	.type           = IRDA_MA600_DONGLE,
+	.open           = ma600_open,
+	.close          = ma600_close,
+	.reset          = ma600_reset,
+	.set_speed      = ma600_change_speed,
+};
+
+
+int __init ma600_sir_init(void)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+	return irda_register_dongle(&ma600);
+}
+
+void __exit ma600_sir_cleanup(void)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+	irda_unregister_dongle(&ma600);
+}
+
+/*
+	Power on:
+		(0) Clear RTS and DTR for 1 second
+		(1) Set RTS and DTR for 1 second
+		(2) 9600 bps now
+	Note: assume RTS, DTR are clear before
+*/
+static int ma600_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Explicitly set the speeds we can accept */
+	qos->baud_rate.bits &= IR_2400|IR_9600|IR_19200|IR_38400
+				|IR_57600|IR_115200;
+	/* Hm, 0x01 means 10ms - for >= 1ms we would need 0x07 */
+	qos->min_turn_time.bits = 0x01;		/* Needs at least 1 ms */	
+	irda_qos_bits_to_value(qos);
+
+	/* irda thread waits 50 msec for power settling */
+
+	return 0;
+}
+
+static int ma600_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power off dongle */
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+static __u8 get_control_byte(__u32 speed)
+{
+	__u8 byte;
+
+	switch (speed) {
+	default:
+	case 115200:
+		byte = MA600_115200;
+		break;
+	case 57600:
+		byte = MA600_57600;
+		break;
+	case 38400:
+		byte = MA600_38400;
+		break;
+	case 19200:
+		byte = MA600_19200;
+		break;
+	case 9600:
+		byte = MA600_9600;
+		break;
+	case 2400:
+		byte = MA600_2400;
+		break;
+	}
+
+	return byte;
+}
+
+/*
+ * Function ma600_change_speed (dev, speed)
+ *
+ *    Set the speed for the MA600 type dongle.
+ *
+ *    The dongle has already been reset to a known state (dongle default)
+ *    We cycle through speeds by pulsing RTS low and then high.
+ */
+
+/*
+ * Function ma600_change_speed (dev, speed)
+ *
+ *    Set the speed for the MA600 type dongle.
+ *
+ *    Algorithm
+ *    1. Reset (already done by irda thread state machine)
+ *    2. clear RTS, set DTR and wait for 1ms
+ *    3. send Control Byte to the MA600 through TXD to set new baud rate
+ *       wait until the stop bit of Control Byte is sent (for 9600 baud rate, 
+ *       it takes about 10 msec)
+ *    4. set RTS, set DTR (return to NORMAL Operation)
+ *    5. wait at least 10 ms, new setting (baud rate, etc) takes effect here 
+ *       after
+ */
+
+/* total delays are only about 20ms - let's just sleep for now to
+ * avoid the state machine complexity before we get things working
+ */
+
+static int ma600_change_speed(struct sir_dev *dev, unsigned speed)
+{
+	u8	byte;
+	
+	IRDA_DEBUG(2, "%s(), speed=%d (was %d)\n", __FUNCTION__,
+		speed, dev->speed);
+
+	/* dongle already reset, dongle and port at default speed (9600) */
+
+	/* Set RTS low for 1 ms */
+	sirdev_set_dtr_rts(dev, TRUE, FALSE);
+	mdelay(1);
+
+	/* Write control byte */
+	byte = get_control_byte(speed);
+	sirdev_raw_write(dev, &byte, sizeof(byte));
+
+	/* Wait at least 10ms: fake wait_until_sent - 10 bits at 9600 baud*/
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(15));		/* old ma600 uses 15ms */
+
+#if 1
+	/* read-back of the control byte. ma600 is the first dongle driver
+	 * which uses this so there might be some unidentified issues.
+	 * Disable this in case of problems with readback.
+	 */
+
+	sirdev_raw_read(dev, &byte, sizeof(byte));
+	if (byte != get_control_byte(speed))  {
+		WARNING("%s(): bad control byte read-back %02x != %02x\n",
+			__FUNCTION__, (unsigned) byte,
+			(unsigned) get_control_byte(speed));
+		return -1;
+	}
+	else
+		IRDA_DEBUG(2, "%s() control byte write read OK\n", __FUNCTION__);
+#endif
+
+	/* Set DTR, Set RTS */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Wait at least 10ms */
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(10));
+
+	/* dongle is now switched to the new speed */
+	dev->speed = speed;
+
+	return 0;
+}
+
+/*
+ * Function ma600_reset (dev)
+ *
+ *      This function resets the ma600 dongle.
+ *
+ *      Algorithm:
+ *    	  0. DTR=0, RTS=1 and wait 10 ms
+ *    	  1. DTR=1, RTS=1 and wait 10 ms
+ *        2. 9600 bps now
+ */
+
+/* total delays are only about 20ms - let's just sleep for now to
+ * avoid the state machine complexity before we get things working
+ */
+
+int ma600_reset(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Reset the dongle : set DTR low for 10 ms */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(10));
+
+	/* Go back to normal mode */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(10));
+
+	dev->speed = 9600;      /* That's the dongle-default */
+
+	return 0;
+}
+
+MODULE_AUTHOR("Leung <95Etwl@alumni.ee.ust.hk> http://www.engsvr.ust/~eetwl95");
+MODULE_DESCRIPTION("MA600 dongle driver version 0.1");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-11"); /* IRDA_MA600_DONGLE */
+		
+module_init(ma600_sir_init);
+module_exit(ma600_sir_cleanup);
+
diff -Nru a/drivers/net/irda/mcp2120-sir.c b/drivers/net/irda/mcp2120-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/mcp2120-sir.c	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,230 @@
+/*********************************************************************
+ *            
+ *    
+ * Filename:      mcp2120.c
+ * Version:       1.0
+ * Description:   Implementation for the MCP2120 (Microchip)
+ * Status:        Experimental.
+ * Author:        Felix Tang (tangf@eyetap.org)
+ * Created at:    Sun Mar 31 19:32:12 EST 2002
+ * Based on code by:   Dag Brattli <dagb@cs.uit.no>
+ * 
+ *     Copyright (c) 2002 Felix Tang, All Rights Reserved.
+ *      
+ *     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.
+ *  
+ ********************************************************************/
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <net/irda/irda.h>
+
+#include "sir-dev.h"
+
+static int mcp2120_reset(struct sir_dev *dev);
+static int mcp2120_open(struct sir_dev *dev);
+static int mcp2120_close(struct sir_dev *dev);
+static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed);
+
+#define MCP2120_9600    0x87
+#define MCP2120_19200   0x8B
+#define MCP2120_38400   0x85
+#define MCP2120_57600   0x83
+#define MCP2120_115200  0x81
+
+#define MCP2120_COMMIT  0x11
+
+static struct dongle_driver mcp2120 = {
+	.owner		= THIS_MODULE,
+	.driver_name	= "Microchip MCP2120",
+	.type		= IRDA_MCP2120_DONGLE,
+	.open		= mcp2120_open,
+	.close		= mcp2120_close,
+	.reset		= mcp2120_reset,
+	.set_speed	= mcp2120_change_speed,
+};
+
+int __init mcp2120_init(void)
+{
+	return irda_register_dongle(&mcp2120);
+}
+
+void __exit mcp2120_cleanup(void)
+{
+	irda_unregister_dongle(&mcp2120);
+}
+
+static int mcp2120_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* seems no explicit power-on required here and reset switching it on anyway */
+
+	qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
+	qos->min_turn_time.bits = 0x01;
+	irda_qos_bits_to_value(qos);
+
+	return 0;
+}
+
+static int mcp2120_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power off dongle */
+        /* reset and inhibit mcp2120 */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+	// sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+/*
+ * Function mcp2120_change_speed (dev, speed)
+ *
+ *    Set the speed for the MCP2120.
+ *
+ */
+
+#define MCP2120_STATE_WAIT_SPEED	(SIRDEV_STATE_DONGLE_SPEED+1)
+
+static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed)
+{
+	unsigned state = dev->fsm.substate;
+	unsigned delay = 0;
+	u8 control[2];
+	static int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	switch (state) {
+	case SIRDEV_STATE_DONGLE_SPEED:
+		/* Set DTR to enter command mode */
+		sirdev_set_dtr_rts(dev, TRUE, FALSE);
+                udelay(500);
+
+		ret = 0;
+		switch (speed) {
+		default:
+			speed = 9600;
+			ret = -EINVAL;
+			/* fall through */
+		case 9600:
+			control[0] = MCP2120_9600;
+                        //printk("mcp2120 9600\n");
+			break;
+		case 19200:
+			control[0] = MCP2120_19200;
+                        //printk("mcp2120 19200\n");
+			break;
+		case 34800:
+			control[0] = MCP2120_38400;
+                        //printk("mcp2120 38400\n");
+			break;
+		case 57600:
+			control[0] = MCP2120_57600;
+                        //printk("mcp2120 57600\n");
+			break;
+		case 115200:
+                        control[0] = MCP2120_115200;
+                        //printk("mcp2120 115200\n");
+			break;
+		}
+		control[1] = MCP2120_COMMIT;
+	
+		/* Write control bytes */
+		sirdev_raw_write(dev, control, 2);
+		dev->speed = speed;
+
+		state = MCP2120_STATE_WAIT_SPEED;
+		delay = 100;
+                //printk("mcp2120_change_speed: dongle_speed\n");
+		break;
+
+	case MCP2120_STATE_WAIT_SPEED:
+		/* Go back to normal mode */
+		sirdev_set_dtr_rts(dev, FALSE, FALSE);
+                //printk("mcp2120_change_speed: mcp_wait\n");
+		break;
+
+	default:
+		ERROR("%s(), undefine state %d\n", __FUNCTION__, state);
+		ret = -EINVAL;
+		break;
+	}
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
+}
+
+/*
+ * Function mcp2120_reset (driver)
+ *
+ *      This function resets the mcp2120 dongle.
+ *      
+ *      Info: -set RTS to reset mcp2120
+ *            -set DTR to set mcp2120 software command mode
+ *            -mcp2120 defaults to 9600 baud after reset
+ *
+ *      Algorithm:
+ *      0. Set RTS to reset mcp2120.
+ *      1. Clear RTS and wait for device reset timer of 30 ms (max).
+ *      
+ */
+
+#define MCP2120_STATE_WAIT1_RESET	(SIRDEV_STATE_DONGLE_RESET+1)
+#define MCP2120_STATE_WAIT2_RESET	(SIRDEV_STATE_DONGLE_RESET+2)
+
+static int mcp2120_reset(struct sir_dev *dev)
+{
+	unsigned state = dev->fsm.substate;
+	unsigned delay = 0;
+	int ret = 0;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	switch (state) {
+	case SIRDEV_STATE_DONGLE_RESET:
+                //printk("mcp2120_reset: dongle_reset\n");
+		/* Reset dongle by setting RTS*/
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
+		state = MCP2120_STATE_WAIT1_RESET;
+		delay = 50;
+		break;
+
+	case MCP2120_STATE_WAIT1_RESET:
+                //printk("mcp2120_reset: mcp2120_wait1\n");
+                /* clear RTS and wait for at least 30 ms. */
+		sirdev_set_dtr_rts(dev, FALSE, FALSE);
+		state = MCP2120_STATE_WAIT2_RESET;
+		delay = 50;
+		break;
+
+	case MCP2120_STATE_WAIT2_RESET:
+                //printk("mcp2120_reset mcp2120_wait2\n");
+		/* Go back to normal mode */
+		sirdev_set_dtr_rts(dev, FALSE, FALSE);
+		break;
+
+	default:
+		ERROR("%s(), undefined state %d\n", __FUNCTION__, state);
+		ret = -EINVAL;
+		break;
+	}
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
+}
+
+MODULE_AUTHOR("Felix Tang <tangf@eyetap.org>");
+MODULE_DESCRIPTION("Microchip MCP2120");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-9"); /* IRDA_MCP2120_DONGLE */
+
+module_init(mcp2120_init);
+module_exit(mcp2120_cleanup);
diff -Nru a/drivers/net/irda/old_belkin-sir.c b/drivers/net/irda/old_belkin-sir.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/net/irda/old_belkin-sir.c	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,156 @@
+/*********************************************************************
+ *                
+ * Filename:      old_belkin.c
+ * Version:       1.1
+ * Description:   Driver for the Belkin (old) SmartBeam dongle
+ * Status:        Experimental...
+ * Author:        Jean Tourrilhes <jt@hpl.hp.com>
+ * Created at:    22/11/99
+ * Modified at:   Fri Dec 17 09:13:32 1999
+ * Modified by:   Dag Brattli <dagb@cs.uit.no>
+ * 
+ *     Copyright (c) 1999 Jean Tourrilhes, All Rights Reserved.
+ *     
+ *     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
+ *     
+ ********************************************************************/
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <net/irda/irda.h>
+// #include <net/irda/irda_device.h>
+
+#include "sir-dev.h"
+
+/*
+ * Belkin is selling a dongle called the SmartBeam.
+ * In fact, there is two hardware version of this dongle, of course with
+ * the same name and looking the exactly same (grrr...).
+ * I guess that I've got the old one, because inside I don't have
+ * a jumper for IrDA/ASK...
+ *
+ * As far as I can make it from info on their web site, the old dongle 
+ * support only 9600 b/s, which make our life much simpler as far as
+ * the driver is concerned, but you might not like it very much ;-)
+ * The new SmartBeam does 115 kb/s, and I've not tested it...
+ *
+ * Belkin claim that the correct driver for the old dongle (in Windows)
+ * is the generic Parallax 9500a driver, but the Linux LiteLink driver
+ * fails for me (probably because Linux-IrDA doesn't rate fallback),
+ * so I created this really dumb driver...
+ *
+ * In fact, this driver doesn't do much. The only thing it does is to
+ * prevent Linux-IrDA to use any other speed than 9600 b/s ;-) This
+ * driver is called "old_belkin" so that when the new SmartBeam is supported
+ * its driver can be called "belkin" instead of "new_belkin".
+ *
+ * Note : this driver was written without any info/help from Belkin,
+ * so a lot of info here might be totally wrong. Blame me ;-)
+ */
+
+static int old_belkin_open(struct sir_dev *dev);
+static int old_belkin_close(struct sir_dev *dev);
+static int old_belkin_change_speed(struct sir_dev *dev, unsigned speed);
+static int old_belkin_reset(struct sir_dev *dev);
+
+static struct dongle_driver old_belkin = {
+	.owner		= THIS_MODULE,
+	.driver_name	= "Old Belkin SmartBeam",
+	.type		= IRDA_OLD_BELKIN_DONGLE,
+	.open		= old_belkin_open,
+	.close		= old_belkin_close,
+	.reset		= old_belkin_reset,
+	.set_speed	= old_belkin_change_speed,
+};
+
+int __init old_belkin_init(void)
+{
+	return irda_register_dongle(&old_belkin);
+}
+
+void __exit old_belkin_cleanup(void)
+{
+	irda_unregister_dongle(&old_belkin);
+}
+
+static int old_belkin_open(struct sir_dev *dev)
+{
+	struct qos_info *qos = &dev->qos;
+
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power on dongle */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
+	/* Not too fast, please... */
+	qos->baud_rate.bits &= IR_9600;
+	/* Needs at least 10 ms (totally wild guess, can do probably better) */
+	qos->min_turn_time.bits = 0x01;
+	irda_qos_bits_to_value(qos);
+
+	/* irda thread waits 50 msec for power settling */
+
+	return 0;
+}
+
+static int old_belkin_close(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* Power off dongle */
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	return 0;
+}
+
+/*
+ * Function old_belkin_change_speed (task)
+ *
+ *    With only one speed available, not much to do...
+ */
+static int old_belkin_change_speed(struct sir_dev *dev, unsigned speed)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	dev->speed = 9600;
+	return (speed==dev->speed) ? 0 : -EINVAL;
+}
+
+/*
+ * Function old_belkin_reset (task)
+ *
+ *      Reset the Old-Belkin type dongle.
+ *
+ */
+static int old_belkin_reset(struct sir_dev *dev)
+{
+	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+
+	/* This dongles speed "defaults" to 9600 bps ;-) */
+	dev->speed = 9600;
+
+	return 0;
+}
+
+MODULE_AUTHOR("Jean Tourrilhes <jt@hpl.hp.com>");
+MODULE_DESCRIPTION("Belkin (old) SmartBeam dongle driver");	
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("irda-dongle-7"); /* IRDA_OLD_BELKIN_DONGLE */
+
+module_init(old_belkin_init);
+module_exit(old_belkin_cleanup);
diff -Nru a/drivers/net/irda/sir-dev.h b/drivers/net/irda/sir-dev.h
--- a/drivers/net/irda/sir-dev.h	Sat Jan 24 16:27:49 2004
+++ b/drivers/net/irda/sir-dev.h	Sat Jan 24 16:27:49 2004
@@ -121,15 +121,17 @@
 extern void sirdev_write_complete(struct sir_dev *dev);
 extern int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count);
 
+/* low level helpers for SIR device/dongle setup */
+extern int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len);
+extern int sirdev_raw_read(struct sir_dev *dev, char *buf, int len);
+extern int sirdev_set_dtr_rts(struct sir_dev *dev, int dtr, int rts);
+
 /* not exported */
 
 extern int sirdev_get_dongle(struct sir_dev *self, IRDA_DONGLE type);
 extern int sirdev_put_dongle(struct sir_dev *self);
 
-extern int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len);
-extern int sirdev_raw_read(struct sir_dev *dev, char *buf, int len);
 extern void sirdev_enable_rx(struct sir_dev *dev);
-
 extern int sirdev_schedule_request(struct sir_dev *dev, int state, unsigned param);
 extern int __init irda_thread_create(void);
 extern void __exit irda_thread_join(void);
@@ -195,10 +197,6 @@
 	const struct sir_driver * drv;
 	void *priv;
 
-	/* dongle callbacks to the SIR device */
-	int (*read)(struct sir_dev *, char *buf, int len);
-	int (*write)(struct sir_dev *, const char *buf, int len);
-	int (*set_dtr_rts)(struct sir_dev *, int dtr, int rts);
 };
 
 #endif	/* IRDA_SIR_H */
diff -Nru a/drivers/net/irda/sir_core.c b/drivers/net/irda/sir_core.c
--- a/drivers/net/irda/sir_core.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/net/irda/sir_core.c	Sat Jan 24 16:27:48 2004
@@ -37,6 +37,10 @@
 EXPORT_SYMBOL(sirdev_write_complete);
 EXPORT_SYMBOL(sirdev_receive);
 
+EXPORT_SYMBOL(sirdev_raw_write);
+EXPORT_SYMBOL(sirdev_raw_read);
+EXPORT_SYMBOL(sirdev_set_dtr_rts);
+
 static int __init sir_core_init(void)
 {
 	return irda_thread_create();
diff -Nru a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c
--- a/drivers/net/irda/sir_dev.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/net/irda/sir_dev.c	Sat Jan 24 16:27:49 2004
@@ -117,6 +117,14 @@
 	return count;
 }
 
+int sirdev_set_dtr_rts(struct sir_dev *dev, int dtr, int rts)
+{
+	int ret = -ENXIO;
+	if (dev->drv->set_dtr_rts != 0)
+		ret =  dev->drv->set_dtr_rts(dev, dtr, rts);
+	return ret;
+}
+	
 /**********************************************************************/
 
 /* called from client driver - likely with bh-context - to indicate
diff -Nru a/drivers/net/irda/sir_dongle.c b/drivers/net/irda/sir_dongle.c
--- a/drivers/net/irda/sir_dongle.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/net/irda/sir_dongle.c	Sat Jan 24 16:27:48 2004
@@ -102,12 +102,6 @@
 		err = -ESTALE;
 		goto out_unlock;	/* rmmod already pending */
 	}
-
-	/* Initialize dongle driver callbacks */
-	dev->read        = sirdev_raw_read;
-	dev->write       = sirdev_raw_write;
-	dev->set_dtr_rts = dev->drv->set_dtr_rts;
-
 	dev->dongle_drv = drv;
 
 	if (!drv->open  ||  (err=drv->open(dev))!=0)
diff -Nru a/drivers/net/irda/sir_kthread.c b/drivers/net/irda/sir_kthread.c
--- a/drivers/net/irda/sir_kthread.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/net/irda/sir_kthread.c	Sat Jan 24 16:27:49 2004
@@ -311,15 +311,9 @@
 			break;
 
 		case SIRDEV_STATE_SET_DTR_RTS:
-			if (dev->drv->set_dtr_rts) {
-				int	dtr, rts;
-
-				dtr = (fsm->param&0x02) ? TRUE : FALSE;
-				rts = (fsm->param&0x01) ? TRUE : FALSE;
-				ret = dev->drv->set_dtr_rts(dev,dtr,rts);
-			}
-			else
-				ret = -EINVAL;
+			ret = sirdev_set_dtr_rts(dev,
+				(fsm->param&0x02) ? TRUE : FALSE,
+				(fsm->param&0x01) ? TRUE : FALSE);
 			next_state = SIRDEV_STATE_DONE;
 			break;
 
diff -Nru a/drivers/net/irda/tekram-sir.c b/drivers/net/irda/tekram-sir.c
--- a/drivers/net/irda/tekram-sir.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/net/irda/tekram-sir.c	Sat Jan 24 16:27:48 2004
@@ -34,7 +34,7 @@
 
 MODULE_PARM(tekram_delay, "i");
 MODULE_PARM_DESC(tekram_delay, "tekram dongle write complete delay");
-static int tekram_delay = 50;		/* default is 50 ms */
+static int tekram_delay = 150;		/* default is 150 ms */
 
 static int tekram_open(struct sir_dev *);
 static int tekram_close(struct sir_dev *);
@@ -61,8 +61,10 @@
 
 int __init tekram_sir_init(void)
 {
-	if (tekram_delay < 1  ||  tekram_delay>500)
+	if (tekram_delay < 1  ||  tekram_delay > 500)
 		tekram_delay = 200;
+	IRDA_DEBUG(1, "%s - using %d ms delay\n",
+		tekram.driver_name, tekram_delay);
 	return irda_register_dongle(&tekram);
 }
 
@@ -77,7 +79,8 @@
 
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
-	dev->set_dtr_rts(dev, TRUE, TRUE);
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
+
 	qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
 	qos->min_turn_time.bits = 0x01; /* Needs at least 10 ms */	
 	irda_qos_bits_to_value(qos);
@@ -92,7 +95,7 @@
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
 	/* Power off dongle */
-	dev->set_dtr_rts(dev, FALSE, FALSE);
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
 
 	return 0;
 }
@@ -122,19 +125,20 @@
 
 static int tekram_change_speed(struct sir_dev *dev, unsigned speed)
 {
+	unsigned state = dev->fsm.substate;
 	unsigned delay = 0;
-	unsigned next_state = dev->fsm.substate;
 	u8 byte;
+	static int ret = 0;
 	
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
-	switch(dev->fsm.substate) {
-
+	switch(state) {
 	case SIRDEV_STATE_DONGLE_SPEED:
 
 		switch (speed) {
 		default:
 			speed = 9600;
+			ret = -EINVAL;
 			/* fall thru */
 		case 9600:
 			byte = TEKRAM_PW|TEKRAM_9600;
@@ -154,36 +158,34 @@
 		}
 
 		/* Set DTR, Clear RTS */
-		dev->set_dtr_rts(dev, TRUE, FALSE);
+		sirdev_set_dtr_rts(dev, TRUE, FALSE);
 	
 		/* Wait at least 7us */
 		udelay(14);
 
 		/* Write control byte */
-		dev->write(dev, &byte, 1);
+		sirdev_raw_write(dev, &byte, 1);
 		
 		dev->speed = speed;
 
-		next_state = TEKRAM_STATE_WAIT_SPEED;
-		delay = tekram_delay;		/* default: 50 ms */
+		state = TEKRAM_STATE_WAIT_SPEED;
+		delay = tekram_delay;
 		break;
 
 	case TEKRAM_STATE_WAIT_SPEED:
 		/* Set DTR, Set RTS */
-		dev->set_dtr_rts(dev, TRUE, TRUE);
-
+		sirdev_set_dtr_rts(dev, TRUE, TRUE);
 		udelay(50);
-
-		return 0;
+		break;
 
 	default:
-		ERROR("%s - undefined state\n", __FUNCTION__);
-		return -EINVAL;
+		ERROR("%s - undefined state %d\n", __FUNCTION__, state);
+		ret = -EINVAL;
+		break;
 	}
 
-	dev->fsm.substate = next_state;
-
-	return delay;
+	dev->fsm.substate = state;
+	return (delay > 0) ? delay : ret;
 }
 
 /*
@@ -200,43 +202,26 @@
  *         operation
  */
 
-
-#define TEKRAM_STATE_WAIT_RESET	(SIRDEV_STATE_DONGLE_RESET + 1)
-
 static int tekram_reset(struct sir_dev *dev)
 {
-	unsigned delay = 0;
-	unsigned next_state = dev->fsm.substate;
-
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
-	switch(dev->fsm.substate) {
-
-	case SIRDEV_STATE_DONGLE_RESET:
-		/* Clear DTR, Set RTS */
-		dev->set_dtr_rts(dev, FALSE, TRUE); 
+	/* Clear DTR, Set RTS */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE); 
 
-		next_state = TEKRAM_STATE_WAIT_RESET;
-		delay = 1;		/* Should sleep 1 ms */
-		break;
+	/* Should sleep 1 ms */
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout(MSECS_TO_JIFFIES(1));
 
-	case TEKRAM_STATE_WAIT_RESET:
-		/* Set DTR, Set RTS */
-		dev->set_dtr_rts(dev, TRUE, TRUE);
+	/* Set DTR, Set RTS */
+	sirdev_set_dtr_rts(dev, TRUE, TRUE);
 	
-		/* Wait at least 50 us */
-		udelay(75);
+	/* Wait at least 50 us */
+	udelay(75);
 
-		return 0;
+	dev->speed = 9600;
 
-	default:
-		ERROR("%s - undefined state\n", __FUNCTION__);
-		return -EINVAL;
-	}
-
-	dev->fsm.substate = next_state;
-
-	return delay;
+	return 0;
 }
 
 MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
diff -Nru a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
--- a/drivers/net/tulip/xircom_cb.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/net/tulip/xircom_cb.c	Sat Jan 24 16:27:49 2004
@@ -342,6 +342,11 @@
 	printk("tx status 0x%08x 0x%08x \n",card->tx_buffer[0],card->tx_buffer[4]);
 	printk("rx status 0x%08x 0x%08x \n",card->rx_buffer[0],card->rx_buffer[4]);
 #endif	
+	/* Handle shared irq and hotplug */
+	if (status == 0 || status == 0xffffffff) {
+		spin_unlock(&card->lock);
+		return IRQ_NONE;
+	}
 
 	if (link_status_changed(card)) {
 		int newlink;
diff -Nru a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
--- a/drivers/pcmcia/ds.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/pcmcia/ds.c	Sat Jan 24 16:27:49 2004
@@ -51,6 +51,8 @@
 #include <linux/list.h>
 #include <linux/workqueue.h>
 
+#include <asm/atomic.h>
+
 #include <pcmcia/version.h>
 #include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
@@ -95,10 +97,12 @@
     int			event_head, event_tail;
     event_t		event[MAX_EVENTS];
     struct user_info_t	*next;
+    struct pcmcia_bus_socket *socket;
 } user_info_t;
 
 /* Socket state information */
 struct pcmcia_bus_socket {
+	atomic_t		refcount;
 	client_handle_t		handle;
 	int			state;
 	user_info_t		*user;
@@ -106,13 +110,13 @@
 	wait_queue_head_t	queue, request;
 	struct work_struct	removal;
 	socket_bind_t		*bind;
-	struct device		*socket_dev;
 	struct pcmcia_socket	*parent;
 };
 
 #define SOCKET_PRESENT		0x01
 #define SOCKET_BUSY		0x02
 #define SOCKET_REMOVAL_PENDING	0x10
+#define SOCKET_DEAD		0x80
 
 /*====================================================================*/
 
@@ -137,6 +141,24 @@
 static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info);
 static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr);
 
+static void pcmcia_put_bus_socket(struct pcmcia_bus_socket *s)
+{
+	if (atomic_dec_and_test(&s->refcount))
+		kfree(s);
+}
+
+static struct pcmcia_bus_socket *pcmcia_get_bus_socket(int nr)
+{
+	struct pcmcia_bus_socket *s;
+
+	s = get_socket_info_by_nr(nr);
+	if (s) {
+		WARN_ON(atomic_read(&s->refcount) == 0);
+		atomic_inc(&s->refcount);
+	}
+	return s;
+}
+
 /**
  * pcmcia_register_driver - register a PCMCIA driver with the bus core
  *
@@ -230,13 +252,10 @@
     if (s->state & SOCKET_BUSY)
 	s->req_pending = 1;
     handle_event(s, event);
-    if (s->req_pending > 0) {
-	interruptible_sleep_on(&s->request);
-	if (signal_pending(current))
-	    return CS_IN_USE;
-	else
-	    return s->req_result;
-    }
+    if (wait_event_interruptible(s->request, s->req_pending <= 0))
+        return CS_IN_USE;
+    if (s->state & SOCKET_BUSY)
+        return s->req_result;
     return CS_SUCCESS;
 }
 
@@ -501,7 +520,7 @@
 
     DEBUG(0, "ds_open(socket %d)\n", i);
 
-    s = get_socket_info_by_nr(i);
+    s = pcmcia_get_bus_socket(i);
     if (!s)
 	    return -ENODEV;
 
@@ -517,6 +536,7 @@
     user->event_tail = user->event_head = 0;
     user->next = s->user;
     user->user_magic = USER_MAGIC;
+    user->socket = s;
     s->user = user;
     file->private_data = user;
     
@@ -529,23 +549,23 @@
 
 static int ds_release(struct inode *inode, struct file *file)
 {
-    socket_t i = iminor(inode);
     struct pcmcia_bus_socket *s;
     user_info_t *user, **link;
 
-    DEBUG(0, "ds_release(socket %d)\n", i);
-
-    s = get_socket_info_by_nr(i);
-    if (!s)
-	    return 0;
+    DEBUG(0, "ds_release(socket %d)\n", iminor(inode));
 
     user = file->private_data;
     if (CHECK_USER(user))
 	goto out;
 
+    s = user->socket;
+
     /* Unlink user data structure */
-    if ((file->f_flags & O_ACCMODE) != O_RDONLY)
+    if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
 	s->state &= ~SOCKET_BUSY;
+	s->req_pending = 0;
+	wake_up_interruptible(&s->request);
+    }
     file->private_data = NULL;
     for (link = &s->user; *link; link = &(*link)->next)
 	if (*link == user) break;
@@ -554,6 +574,7 @@
     *link = user->next;
     user->user_magic = 0;
     kfree(user);
+    pcmcia_put_bus_socket(s);
 out:
     return 0;
 } /* ds_release */
@@ -563,30 +584,28 @@
 static ssize_t ds_read(struct file *file, char *buf,
 		       size_t count, loff_t *ppos)
 {
-    socket_t i = iminor(file->f_dentry->d_inode);
     struct pcmcia_bus_socket *s;
     user_info_t *user;
+    int ret;
 
-    DEBUG(2, "ds_read(socket %d)\n", i);
+    DEBUG(2, "ds_read(socket %d)\n", iminor(inode));
     
     if (count < 4)
 	return -EINVAL;
 
-    s = get_socket_info_by_nr(i);
-    if (!s)
-	    return -ENODEV;
-
     user = file->private_data;
     if (CHECK_USER(user))
 	return -EIO;
     
-    if (queue_empty(user)) {
-	interruptible_sleep_on(&s->queue);
-	if (signal_pending(current))
-	    return -EINTR;
-    }
+    s = user->socket;
+    if (s->state & SOCKET_DEAD)
+        return -EIO;
+
+    ret = wait_event_interruptible(s->queue, !queue_empty(user));
+    if (ret == 0)
+	ret = put_user(get_queued_event(user), (int *)buf) ? -EFAULT : 4;
 
-    return put_user(get_queued_event(user), (int *)buf) ? -EFAULT : 4;
+    return ret;
 } /* ds_read */
 
 /*====================================================================*/
@@ -594,25 +613,24 @@
 static ssize_t ds_write(struct file *file, const char *buf,
 			size_t count, loff_t *ppos)
 {
-    socket_t i = iminor(file->f_dentry->d_inode);
     struct pcmcia_bus_socket *s;
     user_info_t *user;
 
-    DEBUG(2, "ds_write(socket %d)\n", i);
+    DEBUG(2, "ds_write(socket %d)\n", iminor(inode));
     
     if (count != 4)
 	return -EINVAL;
     if ((file->f_flags & O_ACCMODE) == O_RDONLY)
 	return -EBADF;
 
-    s = get_socket_info_by_nr(i);
-    if (!s)
-	    return -ENODEV;
-
     user = file->private_data;
     if (CHECK_USER(user))
 	return -EIO;
 
+    s = user->socket;
+    if (s->state & SOCKET_DEAD)
+        return -EIO;
+
     if (s->req_pending) {
 	s->req_pending--;
 	get_user(s->req_result, (int *)buf);
@@ -629,19 +647,19 @@
 /* No kernel lock - fine */
 static u_int ds_poll(struct file *file, poll_table *wait)
 {
-    socket_t i = iminor(file->f_dentry->d_inode);
     struct pcmcia_bus_socket *s;
     user_info_t *user;
 
-    DEBUG(2, "ds_poll(socket %d)\n", i);
+    DEBUG(2, "ds_poll(socket %d)\n", iminor(inode));
     
-    s = get_socket_info_by_nr(i);
-    if (!s)
-	    return POLLERR;
-
     user = file->private_data;
     if (CHECK_USER(user))
 	return POLLERR;
+    s = user->socket;
+    /*
+     * We don't check for a dead socket here since that
+     * will send cardmgr into an endless spin.
+     */
     poll_wait(file, &s->queue, wait);
     if (!queue_empty(user))
 	return POLLIN | POLLRDNORM;
@@ -653,17 +671,21 @@
 static int ds_ioctl(struct inode * inode, struct file * file,
 		    u_int cmd, u_long arg)
 {
-    socket_t i = iminor(inode);
     struct pcmcia_bus_socket *s;
     u_int size;
     int ret, err;
     ds_ioctl_arg_t buf;
+    user_info_t *user;
 
-    DEBUG(2, "ds_ioctl(socket %d, %#x, %#lx)\n", i, cmd, arg);
+    DEBUG(2, "ds_ioctl(socket %d, %#x, %#lx)\n", iminor(inode), cmd, arg);
     
-    s = get_socket_info_by_nr(i);
-    if (!s)
-	    return -ENODEV;
+    user = file->private_data;
+    if (CHECK_USER(user))
+	return -EIO;
+
+    s = user->socket;
+    if (s->state & SOCKET_DEAD)
+        return -EIO;
     
     size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
     if (size > sizeof(ds_ioctl_arg_t)) return -EINVAL;
@@ -833,6 +855,7 @@
 	if(!s)
 		return -ENOMEM;
 	memset(s, 0, sizeof(struct pcmcia_bus_socket));
+	atomic_set(&s->refcount, 1);
     
 	/*
 	 * Ugly. But we want to wait for the socket threads to have started up.
@@ -845,7 +868,6 @@
 	init_waitqueue_head(&s->request);
 
 	/* initialize data */
-	s->socket_dev = socket->dev.dev;
 	INIT_WORK(&s->removal, handle_removal, s);
 	s->parent = socket;
 
@@ -894,7 +916,8 @@
 
 	pcmcia_deregister_client(socket->pcmcia->handle);
 
-	kfree(socket->pcmcia);
+	socket->pcmcia->state |= SOCKET_DEAD;
+	pcmcia_put_bus_socket(socket->pcmcia);
 	socket->pcmcia = NULL;
 
 	return;
diff -Nru a/drivers/pnp/Kconfig b/drivers/pnp/Kconfig
--- a/drivers/pnp/Kconfig	Sat Jan 24 16:27:49 2004
+++ b/drivers/pnp/Kconfig	Sat Jan 24 16:27:49 2004
@@ -6,6 +6,7 @@
 
 config PNP
 	bool "Plug and Play support"
+	depends on ISA
 	---help---
 	  Plug and Play (PnP) is a standard for peripherals which allows those
 	  peripherals to be configured by software, e.g. assign IRQ's or other
diff -Nru a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
--- a/drivers/scsi/Kconfig	Sat Jan 24 16:27:49 2004
+++ b/drivers/scsi/Kconfig	Sat Jan 24 16:27:49 2004
@@ -1390,7 +1390,7 @@
 
 config SCSI_NSP32
 	tristate "Workbit NinjaSCSI-32Bi/UDE support"
-	depends on PCI && SCSI
+	depends on PCI && SCSI && !64BIT
 	help
 	  This is support for the Workbit NinjaSCSI-32Bi/UDE PCI/Cardbus
 	  SCSI host adapter. Please read the SCSI-HOWTO, available from
@@ -1563,7 +1563,7 @@
 	  If you have the BSC Oktagon SCSI disk controller for the Amiga, say
 	  Y to this question.  If you're in doubt about whether you have one,
 	  see the picture at
-	  <http://amiga.multigraph.com/photos/oktagon.html>.
+	  <http://amiga.resource.cx/exp/search.pl?product=oktagon>.
 
 config ATARI_SCSI
 	tristate "Atari native SCSI support"
diff -Nru a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
--- a/drivers/scsi/aacraid/aacraid.h	Sat Jan 24 16:27:48 2004
+++ b/drivers/scsi/aacraid/aacraid.h	Sat Jan 24 16:27:48 2004
@@ -525,7 +525,15 @@
 	char *	vname;
 	char *	model;
 	u16	channels;
+	int	quirks;
 };
+/*
+ * Some adapter firmware needs communication memory 
+ * below 2gig. This tells the init function to set the
+ * dma mask such that fib memory will be allocated where the
+ * adapter firmware can get to it.
+ */
+#define AAC_QUIRK_31BIT	1
 
 /*
  *	The adapter interface specs all queues to be located in the same
diff -Nru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
--- a/drivers/scsi/aacraid/linit.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/scsi/aacraid/linit.c	Sat Jan 24 16:27:49 2004
@@ -119,22 +119,22 @@
  * for the card.  At that time we can remove the channels from here
  */
 static struct aac_driver_ident aac_drivers[] = {
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 2/Si */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Si */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Si */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2 }, /* PERC 3/Di */
-	{ aac_rx_init, "aacraid",  "ADAPTEC ", "catapult        ", 2 }, /* catapult*/
-	{ aac_rx_init, "aacraid",  "ADAPTEC ", "tomcat          ", 2 }, /* tomcat*/
-	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2120S   ", 1 }, /* Adaptec 2120S (Crusader)*/
-	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2200S   ", 2 }, /* Adaptec 2200S (Vulcan)*/
-	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2200S   ", 2 }, /* Adaptec 2200S (Vulcan-2m)*/
-	{ aac_rx_init, "aacraid",  "Legend  ", "Legend S220     ", 1 }, /* Legend S220*/
-	{ aac_rx_init, "aacraid",  "Legend  ", "Legend S230     ", 2 }, /* Legend S230*/
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 2/Si */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Si */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Si */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT }, /* PERC 3/Di */
+	{ aac_rx_init, "aacraid",  "ADAPTEC ", "catapult        ", 2, AAC_QUIRK_31BIT }, /* catapult*/
+	{ aac_rx_init, "aacraid",  "ADAPTEC ", "tomcat          ", 2, AAC_QUIRK_31BIT }, /* tomcat*/
+	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2120S   ", 1, AAC_QUIRK_31BIT }, /* Adaptec 2120S (Crusader)*/
+	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2200S   ", 2, AAC_QUIRK_31BIT }, /* Adaptec 2200S (Vulcan)*/
+	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2200S   ", 2, AAC_QUIRK_31BIT }, /* Adaptec 2200S (Vulcan-2m)*/
+	{ aac_rx_init, "aacraid",  "Legend  ", "Legend S220     ", 1, AAC_QUIRK_31BIT }, /* Legend S220*/
+	{ aac_rx_init, "aacraid",  "Legend  ", "Legend S230     ", 2, AAC_QUIRK_31BIT }, /* Legend S230*/
 
 	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 3230S   ", 2 }, /* Adaptec 3230S (Harrier)*/
 	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 3240S   ", 2 }, /* Adaptec 3240S (Tornado)*/
@@ -144,10 +144,10 @@
 	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec         ", 2 }, /* (Marco)*/
 	{ aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec         ", 2 }, /* (Sebring)*/
 
-	{ aac_rx_init, "percraid", "DELL    ", "PERC 320/DC     ", 2 }, /* Perc 320/DC*/
+	{ aac_rx_init, "percraid", "DELL    ", "PERC 320/DC     ", 2, AAC_QUIRK_31BIT }, /* Perc 320/DC*/
 	{ aac_sa_init, "aacraid",  "ADAPTEC ", "Adaptec 5400S   ", 4 }, /* Adaptec 5400S (Mustang)*/
 	{ aac_sa_init, "aacraid",  "ADAPTEC ", "AAC-364         ", 4 }, /* Adaptec 5400S (Mustang)*/
-	{ aac_sa_init, "percraid", "DELL    ", "PERCRAID        ", 4 }, /* Dell PERC2 "Quad Channel" */
+	{ aac_sa_init, "percraid", "DELL    ", "PERCRAID        ", 4, AAC_QUIRK_31BIT }, /* Dell PERC2 "Quad Channel" */
 	{ aac_sa_init, "hpnraid",  "HP      ", "NetRAID         ", 4 }  /* HP NetRAID-4M */
 };
 
@@ -407,8 +407,17 @@
 	if (pci_enable_device(pdev))
 		goto out;
 
-	if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL))
+	if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL) || 
+			pci_set_consistent_dma_mask(pdev, 0xFFFFFFFFULL))
 		goto out;
+	/*
+	 * If the quirk31 bit is set, the adapter needs adapter
+	 * to driver communication memory to be allocated below 2gig
+	 */
+	if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) 
+		if (pci_set_dma_mask(pdev, 0x7FFFFFFFULL) ||
+				pci_set_consistent_dma_mask(pdev, 0x7FFFFFFFULL))
+			goto out;
 	
 	pci_set_master(pdev);
 
@@ -442,6 +451,15 @@
 
 	if ((*aac_drivers[index].init)(aac , shost->unique_id))
 		goto out_free_fibs;
+
+	/*
+	 * If we had set a smaller DMA mask earlier, set it to 4gig
+	 * now since the adapter can dma data to at least a 4gig
+	 * address space.
+	 */
+	if (aac_drivers[index].quirks & AAC_QUIRK_31BIT)
+		if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL))
+			goto out_free_fibs;
 
 	aac_get_adapter_info(aac);
 
diff -Nru a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
--- a/drivers/scsi/aha1542.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/scsi/aha1542.c	Sat Jan 24 16:27:49 2004
@@ -67,10 +67,10 @@
 		       int nseg,
 		       int badseg)
 {
-	printk(KERN_CRIT "sgpnt[%d:%d] page %p/0x%x length %u\n",
+	printk(KERN_CRIT "sgpnt[%d:%d] page %p/0x%llx length %u\n",
 	       badseg, nseg,
 	       page_address(sgpnt[badseg].page) + sgpnt[badseg].offset,
-	       SCSI_SG_PA(&sgpnt[badseg]),
+	       (unsigned long long)SCSI_SG_PA(&sgpnt[badseg]),
 	       sgpnt[badseg].length);
 
 	/*
diff -Nru a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
--- a/drivers/scsi/aic7xxx/Makefile	Sat Jan 24 16:27:50 2004
+++ b/drivers/scsi/aic7xxx/Makefile	Sat Jan 24 16:27:50 2004
@@ -1,7 +1,7 @@
 #
 # Makefile for the Linux aic7xxx SCSI driver.
 #
-# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Makefile#7 $
+# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Makefile#8 $
 #
 
 # Let kbuild descend into aicasm when cleaning
@@ -61,6 +61,13 @@
 	-p $(obj)/aic7xxx_reg_print.c -i aic7xxx_osm.h
 
 ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aic7xxx_seq.h: aic7xxx_reg.h
+ifeq ($(CONFIG_AIC7XXX_REG_PRETTY_PRINT),y)
+aic7xxx_reg.h: aic7xxx_reg_print.c
+endif
 $(aic7xxx-gen-y): $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm
 	$(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic7xxx_reg.h \
 			      $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \
@@ -75,6 +82,13 @@
 	-p $(obj)/aic79xx_reg_print.c -i aic79xx_osm.h
 
 ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y)
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aic79xx_seq.h: aic79xx_reg.h
+ifeq ($(CONFIG_AIC79XX_REG_PRETTY_PRINT),y)
+aic79xx_reg.h: aic79xx_reg_print.c
+endif
 $(aic79xx-gen-y): $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm
 	$(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic79xx_reg.h \
 			      $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \
diff -Nru a/drivers/scsi/aic7xxx/aicasm/Makefile b/drivers/scsi/aic7xxx/aicasm/Makefile
--- a/drivers/scsi/aic7xxx/aicasm/Makefile	Sat Jan 24 16:27:49 2004
+++ b/drivers/scsi/aic7xxx/aicasm/Makefile	Sat Jan 24 16:27:49 2004
@@ -49,11 +49,19 @@
 clean:
 	rm -f $(clean-files)
 
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aicasm_gram.c: aicasm_gram.h
 aicasm_gram.c aicasm_gram.h: aicasm_gram.y
 	$(YACC) $(YFLAGS) -b $(<:.y=) $<
 	mv $(<:.y=).tab.c $(<:.y=.c)
 	mv $(<:.y=).tab.h $(<:.y=.h)
 
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aicasm_macro_gram.c: aicasm_macro_gram.h
 aicasm_macro_gram.c aicasm_macro_gram.h: aicasm_macro_gram.y
 	$(YACC) $(YFLAGS) -b $(<:.y=) -p mm $<
 	mv $(<:.y=).tab.c $(<:.y=.c)
diff -Nru a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
--- a/drivers/scsi/megaraid.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/scsi/megaraid.c	Sat Jan 24 16:27:48 2004
@@ -5093,7 +5093,7 @@
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_AMI_MEGARAID3,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_AMI_MEGARAID,
+	{PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_AMI_MEGARAID3,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0,}
 };
diff -Nru a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
--- a/drivers/serial/serial_core.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/serial/serial_core.c	Sat Jan 24 16:27:48 2004
@@ -529,8 +529,7 @@
 {
 	struct uart_state *state = tty->driver_data;
 
-	if (tty)
-		__uart_put_char(state->port, &state->info->xmit, ch);
+	__uart_put_char(state->port, &state->info->xmit, ch);
 }
 
 static void uart_flush_chars(struct tty_struct *tty)
@@ -545,7 +544,7 @@
 	struct uart_state *state = tty->driver_data;
 	int ret;
 
-	if (!tty || !state->info->xmit.buf)
+	if (!state->info->xmit.buf)
 		return 0;
 
 	if (from_user)
@@ -833,13 +832,17 @@
 	if (state->info->flags & UIF_INITIALIZED) {
 		if (((old_flags ^ port->flags) & UPF_SPD_MASK) ||
 		    old_custom_divisor != port->custom_divisor) {
-			/* If they're setting up a custom divisor or speed,
+			/*
+			 * If they're setting up a custom divisor or speed,
 			 * instead of clearing it, then bitch about it. No
-			 * need to rate-limit; it's CAP_SYS_ADMIN only. */
+			 * need to rate-limit; it's CAP_SYS_ADMIN only.
+			 */
 			if (port->flags & UPF_SPD_MASK) {
-				printk(KERN_NOTICE "%s sets custom speed on %s%d. This is deprecated.\n",
-				       current->comm, state->info->tty->driver->name, 
-				       state->port->line);
+				char buf[64];
+				printk(KERN_NOTICE
+				       "%s sets custom speed on %s. This "
+				       "is deprecated.\n", current->comm,
+				       tty_name(state->info->tty, buf));
 			}
 			uart_change_speed(state, NULL);
 		}
@@ -1209,9 +1212,15 @@
 static void uart_close(struct tty_struct *tty, struct file *filp)
 {
 	struct uart_state *state = tty->driver_data;
-	struct uart_port *port = state->port;
+	struct uart_port *port;
 
 	BUG_ON(!kernel_locked());
+
+	if (!state || !state->port)
+		return;
+
+	port = state->port;
+
 	DPRINTK("uart_close(%d) called\n", port->line);
 
 	down(&state->sem);
diff -Nru a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
--- a/drivers/serial/sunzilog.c	Sat Jan 24 16:27:50 2004
+++ b/drivers/serial/sunzilog.c	Sat Jan 24 16:27:50 2004
@@ -723,36 +723,28 @@
 	}
 }
 
-/* The port lock is not held.  */
+/* The port lock is held.  */
 static void sunzilog_stop_rx(struct uart_port *port)
 {
 	struct uart_sunzilog_port *up = UART_ZILOG(port);
 	struct zilog_channel *channel;
-	unsigned long flags;
 
 	if (ZS_IS_CONS(up))
 		return;
 
-	spin_lock_irqsave(&port->lock, flags);
-
 	channel = ZILOG_CHANNEL_FROM_PORT(port);
 
 	/* Disable all RX interrupts.  */
 	up->curregs[R1] &= ~RxINT_MASK;
 	sunzilog_maybe_update_regs(up, channel);
-
-	spin_unlock_irqrestore(&port->lock, flags);
 }
 
-/* The port lock is not held.  */
+/* The port lock is held.  */
 static void sunzilog_enable_ms(struct uart_port *port)
 {
 	struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port;
 	struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
 	unsigned char new_reg;
-	unsigned long flags;
-
-	spin_lock_irqsave(&port->lock, flags);
 
 	new_reg = up->curregs[R15] | (DCDIE | SYNCIE | CTSIE);
 	if (new_reg != up->curregs[R15]) {
@@ -761,8 +753,6 @@
 		/* NOTE: Not subject to 'transmitter active' rule.  */ 
 		write_zsreg(channel, R15, up->curregs[R15]);
 	}
-
-	spin_unlock_irqrestore(&port->lock, flags);
 }
 
 /* The port lock is not held.  */
diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/usb/input/hid-core.c	Sat Jan 24 16:27:49 2004
@@ -1357,6 +1357,9 @@
 #define USB_VENDOR_ID_BERKSHIRE		0x0c98
 #define USB_DEVICE_ID_BERKSHIRE_PCWD	0x1140
 
+#define USB_VENDOR_ID_ALPS		0x0433
+#define USB_DEVICE_ID_IBM_GAMEPAD	0x1101
+
 struct hid_blacklist {
 	__u16 idVendor;
 	__u16 idProduct;
@@ -1366,6 +1369,7 @@
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 1, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 2, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 3, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 1, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 2, HID_QUIRK_IGNORE },
@@ -1407,6 +1411,7 @@
 	{ USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK },
 	{ USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD },
 	{ 0, 0 }
 };
 
@@ -1525,9 +1530,9 @@
 				continue;
 			if (!(hid->urbout = usb_alloc_urb(0, GFP_KERNEL)))
 				goto fail;
-			pipe = usb_sndbulkpipe(dev, endpoint->bEndpointAddress);
-			usb_fill_bulk_urb(hid->urbout, dev, pipe, hid->outbuf, 0,
-					  hid_irq_out, hid);
+			pipe = usb_sndintpipe(dev, endpoint->bEndpointAddress);
+			usb_fill_int_urb(hid->urbout, dev, pipe, hid->outbuf, 0,
+					  hid_irq_out, hid, 1);
 			hid->urbout->transfer_dma = hid->outbuf_dma;
 			hid->urbout->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 		}
diff -Nru a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c
--- a/drivers/usb/input/hid-ff.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/usb/input/hid-ff.c	Sat Jan 24 16:27:49 2004
@@ -5,7 +5,7 @@
  *  Not all hid devices use the same protocol. For example, some use PID,
  *  other use their own proprietary procotol.
  *
- *  Copyright (c) 2002 Johann Deneux
+ *  Copyright (c) 2002-2004 Johann Deneux
  */
 
 /*
@@ -24,7 +24,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
  * Should you need to contact me, the author, you can do so by
- * e-mail - mail your message to <deneux@ifrance.com>
+ * e-mail - mail your message to <johann.deneux@it.uu.se>
  */
 
 #include <linux/input.h>
@@ -52,8 +52,9 @@
 
 static struct hid_ff_initializer inits[] = {
 #ifdef CONFIG_LOGITECH_FF
-	{0x46d, 0xc211, hid_lgff_init},
-	{0x46d, 0xc283, hid_lgff_init},
+	{0x46d, 0xc211, hid_lgff_init}, // Logitech Cordless rumble pad
+	{0x46d, 0xc283, hid_lgff_init}, // Logitech Wingman Force 3d
+	{0x46d, 0xc295, hid_lgff_init},	// Logitech MOMO force wheel
 #endif
 #ifdef CONFIG_HID_PID
 	{0x45e, 0x001b, hid_pid_init},
diff -Nru a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
--- a/drivers/usb/input/hid-input.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/usb/input/hid-input.c	Sat Jan 24 16:27:49 2004
@@ -40,13 +40,13 @@
 	  0,  0,  0,  0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
 	 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44,  2,  3,
 	  4,  5,  6,  7,  8,  9, 10, 11, 28,  1, 14, 15, 57, 12, 13, 26,
-	 27, 43, 84, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
+	 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
 	 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106,
 	105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71,
-	 72, 73, 82, 83, 86,127,116,117, 85, 89, 90, 91, 92, 93, 94, 95,
-	120,121,122,123,134,138,130,132,128,129,131,137,133,135,136,113,
-	115,114,unk,unk,unk,124,unk,181,182,183,184,185,186,187,188,189,
-	190,191,192,193,194,195,196,197,198,unk,unk,unk,unk,unk,unk,unk,
+	 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190,
+	191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113,
+	115,114,unk,unk,unk,121,unk, 89, 93,124, 92, 94, 95,unk,unk,unk,
+	122,123, 90, 91, 85,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,
 	unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,
 	unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,
 	unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,
diff -Nru a/drivers/usb/input/hid-lgff.c b/drivers/usb/input/hid-lgff.c
--- a/drivers/usb/input/hid-lgff.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/usb/input/hid-lgff.c	Sat Jan 24 16:27:49 2004
@@ -6,7 +6,7 @@
  * - WingMan Cordless RumblePad
  * - WingMan Force 3D
  *
- *  Copyright (c) 2002 Johann Deneux
+ *  Copyright (c) 2002-2004 Johann Deneux
  */
 
 /*
@@ -25,13 +25,13 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
  * Should you need to contact me, the author, you can do so by
- * e-mail - mail your message to <deneux@ifrance.com>
+ * e-mail - mail your message to <johann.deneux@it.uu.se>
  */
 
 #include <linux/input.h>
 #include <linux/sched.h>
 
-#define DEBUG
+//#define DEBUG
 #include <linux/usb.h>
 
 #include <linux/circ_buf.h>
@@ -179,8 +179,7 @@
 		kfree(private);
 		return -1;
 	}
-	private->rumble->field[0]->value[0] = 0x03;
-	private->rumble->field[0]->value[1] = 0x42;
+	private->rumble->field[0]->value[0] = 0x42;
 
 
 	private->condition = hid_lgff_duplicate_report(report);
@@ -207,7 +206,7 @@
 	add_timer(&private->timer);  /*TODO: only run the timer when at least
 				       one effect is playing */
 
-	printk(KERN_INFO "Force feedback for Logitech force feedback devices by Johann Deneux <deneux@ifrance.com>\n");
+	printk(KERN_INFO "Force feedback for Logitech force feedback devices by Johann Deneux <johann.deneux@it.uu.se>\n");
 
 	return 0;
 }
@@ -254,7 +253,7 @@
 	signed short* ff;
 	u16 idVendor = hid->dev->descriptor.idVendor;
 	u16 idProduct = hid->dev->descriptor.idProduct;
-	struct hid_input *hidinput = list_entry(&hid->inputs, struct hid_input, list);
+	struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
 
 	while (dev->idVendor && (idVendor != dev->idVendor || idProduct != dev->idProduct))
 		dev++;
@@ -511,10 +510,10 @@
 		hid_submit_report(hid, lgff->constant, USB_DIR_OUT);
 	}
 
-	if (left != lgff->rumble->field[0]->value[3]
-	    || right != lgff->rumble->field[0]->value[4]) {
-		lgff->rumble->field[0]->value[3] = left;
-		lgff->rumble->field[0]->value[4] = right;
+	if (left != lgff->rumble->field[0]->value[2]
+	    || right != lgff->rumble->field[0]->value[3]) {
+		lgff->rumble->field[0]->value[2] = left;
+		lgff->rumble->field[0]->value[3] = right;
 		dbg("(left,right)=(%04x, %04x)", left, right);
 		hid_submit_report(hid, lgff->rumble, USB_DIR_OUT);
 	}
diff -Nru a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c
--- a/drivers/usb/input/usbkbd.c	Sat Jan 24 16:27:50 2004
+++ b/drivers/usb/input/usbkbd.c	Sat Jan 24 16:27:50 2004
@@ -49,13 +49,13 @@
 	  0,  0,  0,  0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
 	 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44,  2,  3,
 	  4,  5,  6,  7,  8,  9, 10, 11, 28,  1, 14, 15, 57, 12, 13, 26,
-	 27, 43, 84, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
+	 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
 	 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106,
 	105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71,
-	 72, 73, 82, 83, 86,127,116,117, 85, 89, 90, 91, 92, 93, 94, 95,
-	120,121,122,123,134,138,130,132,128,129,131,137,133,135,136,113,
-	115,114,  0,  0,  0,124,  0,181,182,183,184,185,186,187,188,189,
-	190,191,192,193,194,195,196,197,198,  0,  0,  0,  0,  0,  0,  0,
+	 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190,
+	191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113,
+	115,114,  0,  0,  0,121,  0, 89, 93,124, 92, 94, 95,  0,  0,  0,
+	122,123, 90, 91, 85,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
diff -Nru a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c
--- a/drivers/usb/input/wacom.c	Sat Jan 24 16:27:48 2004
+++ b/drivers/usb/input/wacom.c	Sat Jan 24 16:27:48 2004
@@ -428,6 +428,7 @@
         { "Wacom Graphire",      8,  10206,  7422,  511, 32, 1, wacom_graphire_irq },
 	{ "Wacom Graphire2 4x5", 8,  10206,  7422,  511, 32, 1, wacom_graphire_irq },
  	{ "Wacom Graphire2 5x7", 8,  13918, 10206,  511, 32, 1, wacom_graphire_irq },
+	{ "Wacom Graphire3",     8,  10208,  7424,  511, 32, 1, wacom_graphire_irq },
   	{ "Wacom Intuos 4x5",   10,  12700, 10360, 1023, 15, 2, wacom_intuos_irq },
  	{ "Wacom Intuos 6x8",   10,  20600, 16450, 1023, 15, 2, wacom_intuos_irq },
  	{ "Wacom Intuos 9x12",  10,  30670, 24130, 1023, 15, 2, wacom_intuos_irq },
@@ -452,6 +453,7 @@
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x10) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x11) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x12) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x13) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22) },
diff -Nru a/drivers/usb/media/w9968cf.c b/drivers/usb/media/w9968cf.c
--- a/drivers/usb/media/w9968cf.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/usb/media/w9968cf.c	Sat Jan 24 16:27:49 2004
@@ -98,7 +98,7 @@
 static int specific_debug = W9968CF_SPECIFIC_DEBUG;
 #endif
 
-static unsigned int param_nv[23]; /* number of values per paramater */
+static unsigned int param_nv[24]; /* number of values per parameter */
 
 module_param(vppmod_load, bool, 0444);
 module_param(simcams, ushort, 0444);
diff -Nru a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
--- a/drivers/video/aty/aty128fb.c	Sat Jan 24 16:27:49 2004
+++ b/drivers/video/aty/aty128fb.c	Sat Jan 24 16:27:49 2004
@@ -2102,7 +2102,7 @@
 	reg |= LVDS_BL_MOD_EN | LVDS_BLON;
 	if (on && level > BACKLIGHT_OFF) {
 		reg |= LVDS_DIGION;
-		if (!reg & LVDS_ON) {
+		if (!(reg & LVDS_ON)) {
 			reg &= ~LVDS_BLON;
 			aty_st_le32(LVDS_GEN_CNTL, reg);
 			(void)aty_ld_le32(LVDS_GEN_CNTL);
diff -Nru a/drivers/video/console/Makefile b/drivers/video/console/Makefile
--- a/drivers/video/console/Makefile	Sat Jan 24 16:27:49 2004
+++ b/drivers/video/console/Makefile	Sat Jan 24 16:27:49 2004
@@ -29,10 +29,12 @@
 obj-$(CONFIG_FB_STI)              += sticore.o
 
 # Files generated that shall be removed upon make clean
-clean-files := promcon_tbl.c
+targets := promcon_tbl.c
 
-$(obj)/promcon_tbl.c: $(src)/prom.uni
-	$(objtree)/scripts/conmakehash $< | \
-	sed -e '/#include <[^>]*>/p' -e 's/types/init/' \
-	    -e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@
+quiet_cmd_conmakehash = CNMKHSH $@
+      cmd_conmakehash = $(objtree)/scripts/conmakehash $< | \
+		sed -e '/\#include <[^>]*>/p' -e 's/types/init/' \
+		-e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@
 
+$(obj)/promcon_tbl.c: $(src)/prom.uni FORCE
+	$(call if_changed,conmakehash)
diff -Nru a/drivers/video/logo/Makefile b/drivers/video/logo/Makefile
--- a/drivers/video/logo/Makefile	Sat Jan 24 16:27:49 2004
+++ b/drivers/video/logo/Makefile	Sat Jan 24 16:27:49 2004
@@ -25,18 +25,31 @@
 
 # How to generate them
 
-$(obj)/%_mono.c:	$(src)/%_mono.pbm
-		$(objtree)/scripts/pnmtologo -t mono -n $*_mono -o $@ $<
+quiet_cmd_logo_mono    = MONO    $@
+      cmd_logo_mono    = $(objtree)/scripts/pnmtologo -t mono -n $*_mono -o $@ $<
 
-$(obj)/%_vga16.c:	$(src)/%_vga16.ppm
-		$(objtree)/scripts/pnmtologo -t vga16 -n $*_vga16 -o $@ $<
+quiet_cmd_logo_vga16   = VGA16   $@
+      cmd_logo_vga16   = $(objtree)/scripts/pnmtologo -t vga16 -n $*_vga16 -o $@ $<
 
-$(obj)/%_clut224.c:	$(src)/%_clut224.ppm
-		$(objtree)/scripts/pnmtologo -t clut224 -n $*_clut224 -o $@ $<
+quiet_cmd_logo_clut224 = CLUT224 $@
+      cmd_logo_clut224 = $(objtree)/scripts/pnmtologo -t clut224 -n $*_clut224 -o $@ $<
 
-$(obj)/%_gray256.c:	$(src)/%_gray256.pgm
-		$(objtree)/scripts/pnmtologo -t gray256 -n $*_gray256 -o $@ $<
+quiet_cmd_logo_gray256 = GRAY256 $@
+      cmd_logo_gray256 = $(objtree)/scripts/pnmtologo -t gray256 -n $*_gray256 -o $@ $<
+
+
+$(obj)/%_mono.c: $(src)/%_mono.pbm FORCE
+	$(call if_changed,logo_mono)
+
+$(obj)/%_vga16.c: $(src)/%_vga16.ppm FORCE
+	$(call if_changed,logo_vga16)
+
+$(obj)/%_clut224.c: $(src)/%_clut224.ppm FORCE
+	$(call if_changed,logo_clut224)
+
+$(obj)/%_gray256.c: $(src)/%_gray256.pgm FORCE
+	$(call if_changed,logo_gray256)
 
 
 # Files generated that shall be removed upon make clean
-clean-files := *_mono.c *_vga16.c *_clut224.c *_gray256.c
+targets := *_mono.c *_vga16.c *_clut224.c *_gray256.c
diff -Nru a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c
--- a/drivers/video/radeonfb.c	Sat Jan 24 16:27:50 2004
+++ b/drivers/video/radeonfb.c	Sat Jan 24 16:27:50 2004
@@ -2319,7 +2319,7 @@
 	lvds_gen_cntl |= (LVDS_BL_MOD_EN | LVDS_BLON);
 	if (on && (level > BACKLIGHT_OFF)) {
 		lvds_gen_cntl |= LVDS_DIGON;
-		if (!lvds_gen_cntl & LVDS_ON) {
+		if (!(lvds_gen_cntl & LVDS_ON)) {
 			lvds_gen_cntl &= ~LVDS_BLON;
 			OUTREG(LVDS_GEN_CNTL, lvds_gen_cntl);
 			(void)INREG(LVDS_GEN_CNTL);
diff -Nru a/fs/compat_ioctl.c b/fs/compat_ioctl.c
--- a/fs/compat_ioctl.c	Sat Jan 24 16:27:50 2004
+++ b/fs/compat_ioctl.c	Sat Jan 24 16:27:50 2004
@@ -2426,7 +2426,7 @@
         __get_user(hi_min, ((__u32*)(&user_req->block_minor) + 1));
 
         req->block_major = lo_maj | (((__u64)hi_maj) << 32);
-        req->block_minor = lo_min | (((__u64)lo_min) << 32);
+        req->block_minor = lo_min | (((__u64)hi_min) << 32);
 
         return ret;
 }
diff -Nru a/fs/xfs/linux/xfs_aops.c b/fs/xfs/linux/xfs_aops.c
--- a/fs/xfs/linux/xfs_aops.c	Sat Jan 24 16:27:49 2004
+++ b/fs/xfs/linux/xfs_aops.c	Sat Jan 24 16:27:49 2004
@@ -407,8 +407,10 @@
 	offset <<= PAGE_CACHE_SHIFT;
 	offset += p_offset;
 
-	pb = pagebuf_lookup(iomapp->iomap_target,
-			    iomapp->iomap_offset, iomapp->iomap_bsize, 0);
+	/* get an "empty" pagebuf to manage IO completion
+	 * Proper values will be set before returning */
+	pb = pagebuf_lookup(iomapp->iomap_target, 0, 0, 0);
+
 	if (!pb)
 		return -EAGAIN;
 
@@ -471,6 +473,11 @@
 			nblocks += bs;
 			atomic_add(bs, &pb->pb_io_remaining);
 			convert_page(inode, page, iomapp, pb, startio, all_bh);
+                        /* stop if converting the next page might add
+			 * enough blocks that the corresponding byte
+			 * count won't fit in our ulong page buf length */
+			if (nblocks >= ((ULONG_MAX - PAGE_SIZE) >> block_bits))
+				goto enough;
 		}
 
 		if (tindex == tlast &&
@@ -481,16 +488,20 @@
 				nblocks += bs;
 				atomic_add(bs, &pb->pb_io_remaining);
 				convert_page(inode, page, iomapp, pb, startio, all_bh);
+				if (nblocks >= ((ULONG_MAX - PAGE_SIZE) >> block_bits))
+					goto enough;
 			}
 		}
 	}
 
+enough:
 	size = nblocks;		/* NB: using 64bit number here */
 	size <<= block_bits;	/* convert fsb's to byte range */
 
 	XFS_BUF_DATAIO(pb);
 	XFS_BUF_ASYNC(pb);
 	XFS_BUF_SET_SIZE(pb, size);
+	XFS_BUF_SET_COUNT(pb, size);
 	XFS_BUF_SET_OFFSET(pb, offset);
 	XFS_BUF_SET_FSPRIVATE(pb, LINVFS_GET_VP(inode));
 	XFS_BUF_SET_IODONE_FUNC(pb, linvfs_unwritten_convert);
@@ -925,8 +936,10 @@
 	}
 
 	if (blocks) {
-		size = (iomap.iomap_bsize - iomap.iomap_delta); 
-		bh_result->b_size = min_t(ssize_t, size, blocks << inode->i_blkbits);
+		loff_t iosize;
+		iosize = (iomap.iomap_bsize - iomap.iomap_delta);
+		bh_result->b_size =
+		    (ssize_t)min(iosize, (loff_t)(blocks << inode->i_blkbits));
 	}
 
 	return 0;
diff -Nru a/fs/xfs/xfs_iomap.h b/fs/xfs/xfs_iomap.h
--- a/fs/xfs/xfs_iomap.h	Sat Jan 24 16:27:49 2004
+++ b/fs/xfs/xfs_iomap.h	Sat Jan 24 16:27:49 2004
@@ -66,27 +66,26 @@
 /*
  * xfs_iomap_t:  File system I/O map
  *
- * The iomap_bn, iomap_offset and iomap_length fields are expressed in disk blocks.
- * The iomap_length field specifies the size of the underlying backing store
- * for the particular mapping.
+ * The iomap_bn field is expressed in 512-byte blocks, and is where the 
+ * mapping starts on disk.
  *
- * The iomap_bsize, iomap_size and iomap_delta fields are in bytes and indicate
- * the size of the mapping, the number of bytes that are valid to access
- * (read or write), and the offset into the mapping, given the offset
- * supplied to the file I/O map routine.  iomap_delta is the offset of the
- * desired data from the beginning of the mapping.
+ * The iomap_offset, iomap_bsize and iomap_delta fields are in bytes.
+ * iomap_offset is the offset of the mapping in the file itself.
+ * iomap_bsize is the size of the mapping,  iomap_delta is the 
+ * desired data's offset into the mapping, given the offset supplied 
+ * to the file I/O map routine.
  *
  * When a request is made to read beyond the logical end of the object,
- * iomap_size may be set to 0, but iomap_offset and iomap_length should be set to
- * the actual amount of underlying storage that has been allocated, if any.
+ * iomap_size may be set to 0, but iomap_offset and iomap_length should be set
+ * to the actual amount of underlying storage that has been allocated, if any.
  */
 
 typedef struct xfs_iomap {
-	xfs_daddr_t		iomap_bn;
+	xfs_daddr_t		iomap_bn;	/* first 512b blk of mapping */
 	xfs_buftarg_t		*iomap_target;
-	loff_t			iomap_offset;
-	size_t			iomap_delta;
-	size_t			iomap_bsize;
+	loff_t			iomap_offset;	/* offset of mapping, bytes */
+	loff_t			iomap_bsize;	/* size of mapping, bytes */
+	size_t			iomap_delta;	/* offset into mapping, bytes */
 	iomap_flags_t		iomap_flags;
 } xfs_iomap_t;
 
diff -Nru a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
--- a/fs/xfs/xfs_itable.c	Sat Jan 24 16:27:48 2004
+++ b/fs/xfs/xfs_itable.c	Sat Jan 24 16:27:48 2004
@@ -330,7 +330,7 @@
 	 * inode returned; 0 means start of the allocation group.
 	 */
 	rval = 0;
-	while ((ubleft/statstruct_size) > 0 && agno < mp->m_sb.sb_agcount) {
+	while (ubleft >= statstruct_size && agno < mp->m_sb.sb_agcount) {
 		bp = NULL;
 		down_read(&mp->m_peraglock);
 		error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
@@ -415,7 +415,7 @@
 		 * Loop through inode btree records in this ag,
 		 * until we run out of inodes or space in the buffer.
 		 */
-		while (irbp < irbufend && icount < (ubleft/statstruct_size)) {
+		while (irbp < irbufend && icount < ubcount) {
 			/*
 			 * Loop as long as we're unable to read the
 			 * inode btree.
@@ -467,7 +467,7 @@
 		 */
 		irbufend = irbp;
 		for (irbp = irbuf;
-		     irbp < irbufend && (ubleft/statstruct_size) > 0; irbp++) {
+		     irbp < irbufend && ubleft >= statstruct_size; irbp++) {
 			/*
 			 * Read-ahead the next chunk's worth of inodes.
 			 */
diff -Nru a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
--- a/fs/xfs/xfs_log_recover.c	Sat Jan 24 16:27:49 2004
+++ b/fs/xfs/xfs_log_recover.c	Sat Jan 24 16:27:49 2004
@@ -1553,7 +1553,7 @@
 		case XFS_LI_BUF:
 		case XFS_LI_6_1_BUF:
 		case XFS_LI_5_3_BUF:
-			if ((!flags & XFS_BLI_CANCEL)) {
+			if (!(flags & XFS_BLI_CANCEL)) {
 				xlog_recover_insert_item_frontq(&trans->r_itemq,
 								itemq);
 				break;
diff -Nru a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h
--- a/include/asm-alpha/elf.h	Sat Jan 24 16:27:49 2004
+++ b/include/asm-alpha/elf.h	Sat Jan 24 16:27:49 2004
@@ -122,27 +122,19 @@
    instruction set this CPU supports.  This is trivial on Alpha, 
    but not so on other machines. */
 
-#define ELF_HWCAP							\
-({									\
-	/* Sadly, most folks don't yet have assemblers that know about	\
-	   amask.  This is "amask v0, v0" */				\
-	register long _v0 __asm("$0") = -1;				\
-	__asm(".long 0x47e00c20" : "=r"(_v0) : "0"(_v0));		\
-	~_v0;								\
-})
+#define ELF_HWCAP  (~amask(-1))
 
 /* This yields a string that ld.so will use to load implementation
    specific libraries for optimization.  This is more specific in
-   intent than poking at uname or /proc/cpuinfo.  
-
-   This might do with checking bwx simultaneously...  */
+   intent than poking at uname or /proc/cpuinfo.  */
 
 #define ELF_PLATFORM				\
 ({						\
-	/* Or "implver v0" ... */		\
-	register long _v0 __asm("$0");		\
-	__asm(".long 0x47e03d80" : "=r"(_v0));	\
-	_v0 == 0 ? "ev4" : "ev5";		\
+	enum implver_enum i_ = implver();	\
+	( i_ == IMPLVER_EV4 ? "ev4"		\
+	: i_ == IMPLVER_EV5			\
+	  ? (amask(AMASK_BWX) ? "ev5" : "ev56")	\
+	: amask (AMASK_CIX) ? "ev6" : "ev67");	\
 })
 
 #ifdef __KERNEL__
diff -Nru a/include/asm-x86_64/calling.h b/include/asm-x86_64/calling.h
--- a/include/asm-x86_64/calling.h	Sat Jan 24 16:27:49 2004
+++ b/include/asm-x86_64/calling.h	Sat Jan 24 16:27:49 2004
@@ -33,18 +33,28 @@
 
 	.macro SAVE_ARGS addskip=0,norcx=0 	
 	subq  $9*8+\addskip,%rsp
+	CFI_ADJUST_CFA_OFFSET	9*8+\addskip
 	movq  %rdi,8*8(%rsp) 
+	CFI_OFFSET	rdi,8*8-(9*8+\addskip)
 	movq  %rsi,7*8(%rsp) 
+	CFI_OFFSET	rsi,7*8-(9*8+\addskip)
 	movq  %rdx,6*8(%rsp)
+	CFI_OFFSET	rdx,6*8-(9*8+\addskip)
 	.if \norcx
 	.else
 	movq  %rcx,5*8(%rsp)
+	CFI_OFFSET	rcx,5*8-(9*8+\addskip)
 	.endif
 	movq  %rax,4*8(%rsp) 
+	CFI_OFFSET	rax,4*8-(9*8+\addskip)
 	movq  %r8,3*8(%rsp) 
+	CFI_OFFSET	r8,3*8-(9*8+\addskip)
 	movq  %r9,2*8(%rsp) 
+	CFI_OFFSET	r9,2*8-(9*8+\addskip)
 	movq  %r10,1*8(%rsp) 
+	CFI_OFFSET	r10,1*8-(9*8+\addskip)
 	movq  %r11,(%rsp) 
+	CFI_OFFSET	r11,-(9*8+\addskip)
 	.endm
 
 #define ARG_SKIP 9*8
@@ -69,6 +79,7 @@
 	movq 8*8(%rsp),%rdi
 	.if ARG_SKIP+\addskip > 0
 	addq $ARG_SKIP+\addskip,%rsp
+	CFI_ADJUST_CFA_OFFSET	-(ARG_SKIP+\addskip)
 	.endif
 	.endm	
 
@@ -87,12 +98,19 @@
 #define REST_SKIP 6*8			
 	.macro SAVE_REST
 	subq $REST_SKIP,%rsp
+	CFI_ADJUST_CFA_OFFSET	REST_SKIP
 	movq %rbx,5*8(%rsp) 
+	CFI_OFFSET	rbx,5*8-(REST_SKIP)
 	movq %rbp,4*8(%rsp) 
+	CFI_OFFSET	rbp,4*8-(REST_SKIP)
 	movq %r12,3*8(%rsp) 
+	CFI_OFFSET	r12,3*8-(REST_SKIP)
 	movq %r13,2*8(%rsp) 
+	CFI_OFFSET	r13,2*8-(REST_SKIP)
 	movq %r14,1*8(%rsp) 
+	CFI_OFFSET	r14,1*8-(REST_SKIP)
 	movq %r15,(%rsp) 
+	CFI_OFFSET	r15,0*8-(REST_SKIP)
 	.endm		
 
 	.macro RESTORE_REST
@@ -103,6 +121,7 @@
 	movq 4*8(%rsp),%rbp
 	movq 5*8(%rsp),%rbx
 	addq $REST_SKIP,%rsp
+	CFI_ADJUST_CFA_OFFSET	-(REST_SKIP)
 	.endm
 		
 	.macro SAVE_ALL
diff -Nru a/include/asm-x86_64/desc.h b/include/asm-x86_64/desc.h
--- a/include/asm-x86_64/desc.h	Sat Jan 24 16:27:50 2004
+++ b/include/asm-x86_64/desc.h	Sat Jan 24 16:27:50 2004
@@ -118,6 +118,7 @@
 	d.base1 = PTR_MIDDLE(tss) & 0xFF; 
 	d.type = type;
 	d.p = 1; 
+	d.g = 1;
 	d.limit1 = (size >> 16) & 0xF;
 	d.base2 = (PTR_MIDDLE(tss) >> 8) & 0xFF; 
 	d.base3 = PTR_HIGH(tss); 
diff -Nru a/include/asm-x86_64/dwarf2.h b/include/asm-x86_64/dwarf2.h
--- a/include/asm-x86_64/dwarf2.h	Sat Jan 24 16:27:48 2004
+++ b/include/asm-x86_64/dwarf2.h	Sat Jan 24 16:27:48 2004
@@ -14,7 +14,7 @@
    away for older version. 
  */
 
-#ifdef CONFIG_CFI_BINUTILS
+#ifdef CONFIG_DEBUG_INFO
 
 #define CFI_STARTPROC .cfi_startproc
 #define CFI_ENDPROC .cfi_endproc
@@ -27,23 +27,15 @@
 
 #else
 
-#ifdef __ASSEMBLY__
-	.macro nothing
-	.endm
-	.macro nothing1 a
-	.endm
-	.macro nothing2 a,b
-	.endm      
-#endif
-
-#define CFI_STARTPROC nothing
-#define CFI_ENDPROC nothing
-#define CFI_DEF_CFA nothing2
-#define CFI_DEF_CFA_REGISTER nothing1
-#define CFI_DEF_CFA_OFFSET nothing1
-#define CFI_ADJUST_CFA_OFFSET nothing1
-#define CFI_OFFSET nothing2
-#define CFI_REL_OFFSET nothing2
+/* use assembler line comment character # to ignore the arguments. */
+#define CFI_STARTPROC	#
+#define CFI_ENDPROC	#
+#define CFI_DEF_CFA	#
+#define CFI_DEF_CFA_REGISTER	#
+#define CFI_DEF_CFA_OFFSET	#
+#define CFI_ADJUST_CFA_OFFSET	#
+#define CFI_OFFSET	#
+#define CFI_REL_OFFSET	#
 
 #endif
 
diff -Nru a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-x86_64/hpet.h	Sat Jan 24 16:27:50 2004
@@ -0,0 +1,59 @@
+#ifndef _ASM_X8664_HPET_H
+#define _ASM_X8664_HPET_H 1
+
+#include <linux/interrupt.h>
+
+/*
+ * Documentation on HPET can be found at:
+ *      http://www.intel.com/ial/home/sp/pcmmspec.htm
+ *      ftp://download.intel.com/ial/home/sp/mmts098.pdf
+ */
+
+#define HPET_MMAP_SIZE	1024
+
+#define HPET_ID		0x000
+#define HPET_PERIOD	0x004
+#define HPET_CFG	0x010
+#define HPET_STATUS	0x020
+#define HPET_COUNTER	0x0f0
+#define HPET_T0_CFG	0x100
+#define HPET_T0_CMP	0x108
+#define HPET_T0_ROUTE	0x110
+#define HPET_T1_CFG	0x120
+#define HPET_T1_CMP	0x128
+#define HPET_T1_ROUTE	0x130
+#define HPET_T2_CFG	0x140
+#define HPET_T2_CMP	0x148
+#define HPET_T2_ROUTE	0x150
+
+#define HPET_ID_VENDOR	0xffff0000
+#define HPET_ID_LEGSUP	0x00008000
+#define HPET_ID_NUMBER	0x00001f00
+#define HPET_ID_REV	0x000000ff
+
+#define HPET_ID_VENDOR_SHIFT	16
+#define HPET_ID_VENDOR_8086	0x8086
+
+#define HPET_CFG_ENABLE	0x001
+#define HPET_CFG_LEGACY	0x002
+
+#define HPET_TN_ENABLE		0x004
+#define HPET_TN_PERIODIC	0x008
+#define HPET_TN_PERIODIC_CAP	0x010
+#define HPET_TN_SETVAL		0x040
+#define HPET_TN_32BIT		0x100
+
+extern int is_hpet_enabled(void);
+extern int hpet_rtc_timer_init(void);
+
+#ifdef CONFIG_HPET_EMULATE_RTC
+extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask);
+extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
+extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec);
+extern int hpet_set_periodic_freq(unsigned long freq);
+extern int hpet_rtc_dropped_irq(void);
+extern int hpet_rtc_timer_init(void);
+extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+#endif /* CONFIG_HPET_EMULATE_RTC */
+
+#endif
diff -Nru a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
--- a/include/asm-x86_64/hw_irq.h	Sat Jan 24 16:27:50 2004
+++ b/include/asm-x86_64/hw_irq.h	Sat Jan 24 16:27:50 2004
@@ -106,8 +106,6 @@
 extern atomic_t irq_err_count;
 extern atomic_t irq_mis_count;
 
-extern char _stext, _etext;
-
 #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
 
 #define __STR(x) #x
diff -Nru a/include/asm-x86_64/ia32.h b/include/asm-x86_64/ia32.h
--- a/include/asm-x86_64/ia32.h	Sat Jan 24 16:27:49 2004
+++ b/include/asm-x86_64/ia32.h	Sat Jan 24 16:27:49 2004
@@ -100,8 +100,11 @@
 
 		/* POSIX.1b timers */
 		struct {
-			unsigned int _timer1;
-			unsigned int _timer2;
+			int _tid;		/* timer id */
+			int _overrun;		/* overrun count */
+			sigval_t32 _sigval;	/* same as below */
+			int _sys_private;	/* not to be passed to user */
+			int _overrun_incr;	/* amount to add to overrun */
 		} _timer;
 
 		/* POSIX.1b signals */
@@ -164,9 +167,12 @@
 
 #ifdef __KERNEL__
 struct user_desc;
+struct siginfo_t;
 int do_get_thread_area(struct thread_struct *t, struct user_desc *u_info);
 int do_set_thread_area(struct thread_struct *t, struct user_desc *u_info);
 int ia32_child_tls(struct task_struct *p, struct pt_regs *childregs);
+int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from);
+int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from);
 #endif
 
 #endif /* !CONFIG_IA32_SUPPORT */
diff -Nru a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h
--- a/include/asm-x86_64/kdebug.h	Sat Jan 24 16:27:48 2004
+++ b/include/asm-x86_64/kdebug.h	Sat Jan 24 16:27:48 2004
@@ -31,6 +31,7 @@
 	DIE_TRAP,
 	DIE_GPF,
 	DIE_CALL,
+	DIE_NMI_IPI,
 }; 
 	
 static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig)
diff -Nru a/include/asm-x86_64/mc146818rtc.h b/include/asm-x86_64/mc146818rtc.h
--- a/include/asm-x86_64/mc146818rtc.h	Sat Jan 24 16:27:49 2004
+++ b/include/asm-x86_64/mc146818rtc.h	Sat Jan 24 16:27:49 2004
@@ -24,11 +24,6 @@
 outb_p((val),RTC_PORT(1)); \
 })
 
-#ifndef CONFIG_HPET_TIMER
 #define RTC_IRQ 8
-#else
-/* Temporary workaround due to IRQ routing problem. */
-#define RTC_IRQ 0
-#endif
 
 #endif /* _ASM_MC146818RTC_H */
diff -Nru a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
--- a/include/asm-x86_64/processor.h	Sat Jan 24 16:27:50 2004
+++ b/include/asm-x86_64/processor.h	Sat Jan 24 16:27:50 2004
@@ -173,7 +173,7 @@
  * space during mmap's.
  */
 #define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? 0xc0000000 : 0xFFFFe000)
-#define TASK_UNMAPPED_32 (IA32_PAGE_OFFSET / 3)
+#define TASK_UNMAPPED_32 (PAGE_ALIGN(IA32_PAGE_OFFSET / 3))
 #define TASK_UNMAPPED_64 PAGE_ALIGN(TASK_SIZE/3) 
 #define TASK_UNMAPPED_BASE	\
 	(test_thread_flag(TIF_IA32) ? TASK_UNMAPPED_32 : TASK_UNMAPPED_64)  
diff -Nru a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h
--- a/include/asm-x86_64/proto.h	Sat Jan 24 16:27:49 2004
+++ b/include/asm-x86_64/proto.h	Sat Jan 24 16:27:49 2004
@@ -74,6 +74,8 @@
 
 extern void check_ioapic(void);
 
+extern int unhandled_signal(struct task_struct *tsk, int sig);
+
 extern unsigned long max_mapnr;
 extern unsigned long end_pfn; 
 extern unsigned long table_start, table_end;
diff -Nru a/include/asm-x86_64/ptrace.h b/include/asm-x86_64/ptrace.h
--- a/include/asm-x86_64/ptrace.h	Sat Jan 24 16:27:48 2004
+++ b/include/asm-x86_64/ptrace.h	Sat Jan 24 16:27:48 2004
@@ -6,7 +6,7 @@
 #define R14 8
 #define R13 16
 #define R12 24
-#define RBP 36
+#define RBP 32
 #define RBX 40
 /* arguments: interrupts/non tracing syscalls only save upto here*/
 #define R11 48
diff -Nru a/include/asm-x86_64/scatterlist.h b/include/asm-x86_64/scatterlist.h
--- a/include/asm-x86_64/scatterlist.h	Sat Jan 24 16:27:49 2004
+++ b/include/asm-x86_64/scatterlist.h	Sat Jan 24 16:27:49 2004
@@ -6,6 +6,7 @@
     unsigned int	offset;
     unsigned int	length;
     dma_addr_t		dma_address;
+    unsigned int        dma_length;
 };
 
 #define ISA_DMA_THRESHOLD (0x00ffffff)
@@ -16,6 +17,6 @@
  * returns.
  */
 #define sg_dma_address(sg)     ((sg)->dma_address)
-#define sg_dma_len(sg)         ((sg)->length)
+#define sg_dma_len(sg)         ((sg)->dma_length)
 
 #endif 
diff -Nru a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h
--- a/include/asm-x86_64/system.h	Sat Jan 24 16:27:49 2004
+++ b/include/asm-x86_64/system.h	Sat Jan 24 16:27:49 2004
@@ -19,62 +19,12 @@
 #define __SAVE(reg,offset) "movq %%" #reg ",(14-" #offset ")*8(%%rsp)\n\t"
 #define __RESTORE(reg,offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t"
 
-#ifdef CONFIG_X86_REMOTE_DEBUG
-
-/* full frame for the debug stub */
-/* Should be replaced with a dwarf2 cie/fde description, then gdb could
-   figure it out all by itself. */
-struct save_context_frame { 
-	unsigned long rbp; 
-	unsigned long rbx;
-	unsigned long r11;
-	unsigned long r10;
-	unsigned long r9;
-	unsigned long r8;
-	unsigned long rcx;
-	unsigned long rdx;	
-	unsigned long r15;
-	unsigned long r14;
-	unsigned long r13;
-	unsigned long r12;
-	unsigned long rdi;
-	unsigned long rsi;
-	unsigned long flags;
-}; 
-
-#define SAVE_CONTEXT \
-	"pushfq\n\t"							\
-	"subq $14*8,%%rsp\n\t" 						\
-	__SAVE(rbx, 12) __SAVE(rdi,  1)					\
-	__SAVE(rdx,  6) __SAVE(rcx,  7)					\
-	__SAVE(r8,   8) __SAVE(r9,   9)					\
-	__SAVE(r12,  2) __SAVE(r13,  3)					\
-	__SAVE(r14,  4) __SAVE(r15,  5)					\
-	__SAVE(r10, 10) __SAVE(r11, 11)					\
-	__SAVE(rsi, 0)  __SAVE(rbp, 13) 				\
-
-
-#define RESTORE_CONTEXT \
-	__RESTORE(rbx, 12) __RESTORE(rdi,  1) 					\
-	__RESTORE(rdx,  6) __RESTORE(rcx,  7)					\
-	__RESTORE(r12,  2) __RESTORE(r13,  3)					\
-	__RESTORE(r14,  4) __RESTORE(r15,  5)					\
-	__RESTORE(r10, 10) __RESTORE(r11, 11)					\
-	__RESTORE(r8,   8) __RESTORE(r9,   9)					\
-	__RESTORE(rbp, 13) __RESTORE(rsi, 0) 		   		        \
-	"addq $14*8,%%rsp\n\t" 							\
-	"popfq\n\t"
-
-#define __EXTRA_CLOBBER 
-
-#else
 /* frame pointer must be last for get_wchan */
 #define SAVE_CONTEXT    "pushfq ; pushq %%rbp ; movq %%rsi,%%rbp\n\t"
 #define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp ; popfq\n\t" 
 
 #define __EXTRA_CLOBBER  \
 	,"rcx","rbx","rdx","r8","r9","r10","r11","r12","r13","r14","r15"
-#endif
 
 #define switch_to(prev,next,last) \
 	asm volatile(SAVE_CONTEXT						    \
@@ -321,20 +271,7 @@
 #define local_irq_disable() 	__asm__ __volatile__("cli": : :"memory")
 #define local_irq_enable()	__asm__ __volatile__("sti": : :"memory")
 /* used in the idle loop; sti takes one instruction cycle to complete */
-
-/* Work around BIOS that don't have K8 Errata #93 fixed. */
-#define safe_halt()	      \
-	asm volatile("   sti\n"					\
-		     "1: hlt\n"						\
-		     "2:\n"							\
-		     ".section .fixup,\"ax\"\n"		\
-		     "3: call idle_warning\n"		\
-		     "   jmp 2b\n"					\
-		     ".previous\n"					\
-		     ".section __ex_table,\"a\"\n\t"	\
-		     ".align 8\n\t"					\
-		     ".quad 1b,3b\n"				\
-		     ".previous" ::: "memory")
+#define safe_halt()		__asm__ __volatile__("sti; hlt": : :"memory")
 
 #define irqs_disabled()			\
 ({					\
diff -Nru a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h
--- a/include/asm-x86_64/thread_info.h	Sat Jan 24 16:27:49 2004
+++ b/include/asm-x86_64/thread_info.h	Sat Jan 24 16:27:49 2004
@@ -105,6 +105,7 @@
 #define TIF_POLLING_NRFLAG	16	/* true if poll_idle() is polling TIF_NEED_RESCHED */
 #define TIF_IA32		17	/* 32bit process */ 
 #define TIF_FORK		18	/* ret_from_fork */
+#define TIF_ABI_PENDING		19
 
 #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
 #define _TIF_NOTIFY_RESUME	(1<<TIF_NOTIFY_RESUME)
@@ -115,6 +116,7 @@
 #define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG)
 #define _TIF_IA32		(1<<TIF_IA32)
 #define _TIF_FORK		(1<<TIF_FORK)
+#define _TIF_ABI_PENDING	(1<<TIF_ABI_PENDING)
 
 #define _TIF_WORK_MASK		0x0000FFFE	/* work to do on interrupt/exception return */
 #define _TIF_ALLWORK_MASK	0x0000FFFF	/* work to do on any return to u-space */
diff -Nru a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h
--- a/include/asm-x86_64/timex.h	Sat Jan 24 16:27:49 2004
+++ b/include/asm-x86_64/timex.h	Sat Jan 24 16:27:49 2004
@@ -9,6 +9,7 @@
 #include <linux/config.h>
 #include <asm/msr.h>
 #include <asm/vsyscall.h>
+#include <asm/hpet.h>
 
 #define CLOCK_TICK_RATE	1193182 /* Underlying HZ */
 #define CLOCK_TICK_FACTOR	20	/* Factor of both 1000000 and CLOCK_TICK_RATE */
@@ -29,34 +30,6 @@
 }
 
 extern unsigned int cpu_khz;
-
-/*
- * Documentation on HPET can be found at:
- *      http://www.intel.com/ial/home/sp/pcmmspec.htm
- *      ftp://download.intel.com/ial/home/sp/mmts098.pdf
- */
-
-#define HPET_ID		0x000
-#define HPET_PERIOD	0x004
-#define HPET_CFG	0x010
-#define HPET_STATUS	0x020
-#define HPET_COUNTER	0x0f0
-#define HPET_T0_CFG	0x100
-#define HPET_T0_CMP	0x108
-#define HPET_T0_ROUTE	0x110
-
-#define HPET_ID_VENDOR	0xffff0000
-#define HPET_ID_LEGSUP	0x00008000
-#define HPET_ID_NUMBER	0x00000f00
-#define HPET_ID_REV	0x000000ff
-
-#define HPET_CFG_ENABLE	0x001
-#define HPET_CFG_LEGACY	0x002
-
-#define HPET_T0_ENABLE		0x004
-#define HPET_T0_PERIODIC	0x008
-#define HPET_T0_SETVAL		0x040
-#define HPET_T0_32BIT		0x100
 
 extern struct vxtime_data vxtime;
 
diff -Nru a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
--- a/include/asm-x86_64/unistd.h	Sat Jan 24 16:27:49 2004
+++ b/include/asm-x86_64/unistd.h	Sat Jan 24 16:27:49 2004
@@ -533,6 +533,8 @@
 #define __NR_vserver		236
 __SYSCALL(__NR_vserver, sys_ni_syscall)
 
+/* 237,238,239 reserved for NUMA API */
+
 #define __NR_syscall_max __NR_vserver
 #ifndef __NO_STUBS
 
@@ -694,7 +696,7 @@
 }
 
 extern long sys_exit(int) __attribute__((noreturn));
-extern inline long exit(int error_code)
+extern inline void exit(int error_code)
 {
 	sys_exit(error_code);
 }
diff -Nru a/include/asm-x86_64/vsyscall32.h b/include/asm-x86_64/vsyscall32.h
--- a/include/asm-x86_64/vsyscall32.h	Sat Jan 24 16:27:49 2004
+++ b/include/asm-x86_64/vsyscall32.h	Sat Jan 24 16:27:49 2004
@@ -8,6 +8,6 @@
 
 #define VSYSCALL32_VSYSCALL ((void *)VSYSCALL32_BASE + 0x400) 
 #define VSYSCALL32_SIGRETURN ((void *)VSYSCALL32_BASE + 0x500) 
-#define VSYSCALL32_RTSIGRETURN ((void *)VSYSCALL32_BASE + 0x500) 
+#define VSYSCALL32_RTSIGRETURN ((void *)VSYSCALL32_BASE + 0x600) 
 
 #endif
diff -Nru a/include/linux/apm_bios.h b/include/linux/apm_bios.h
--- a/include/linux/apm_bios.h	Sat Jan 24 16:27:49 2004
+++ b/include/linux/apm_bios.h	Sat Jan 24 16:27:49 2004
@@ -53,6 +53,7 @@
 	int			get_power_status_broken;
 	int			get_power_status_swabinminutes;
 	int			allow_ints;
+	int			forbid_idle;
 	int			realmode_power_off;
 	int			disabled;
 };
diff -Nru a/include/linux/blkdev.h b/include/linux/blkdev.h
--- a/include/linux/blkdev.h	Sat Jan 24 16:27:48 2004
+++ b/include/linux/blkdev.h	Sat Jan 24 16:27:48 2004
@@ -485,7 +485,7 @@
 
 #define rq_for_each_bio(_bio, rq)	\
 	if ((rq->bio))			\
-		for (_bio = (rq)->bio; _bio; _bio = bio->bi_next)
+		for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next)
 
 struct sec_size {
 	unsigned block_size;
diff -Nru a/include/linux/cpu.h b/include/linux/cpu.h
--- a/include/linux/cpu.h	Sat Jan 24 16:27:48 2004
+++ b/include/linux/cpu.h	Sat Jan 24 16:27:48 2004
@@ -37,7 +37,12 @@
 extern void unregister_cpu_notifier(struct notifier_block *nb);
 
 int cpu_up(unsigned int cpu);
+
+#define lock_cpu_hotplug()	down(&cpucontrol)
+#define unlock_cpu_hotplug()	up(&cpucontrol)
+
 #else
+
 static inline int register_cpu_notifier(struct notifier_block *nb)
 {
 	return 0;
@@ -45,6 +50,10 @@
 static inline void unregister_cpu_notifier(struct notifier_block *nb)
 {
 }
+
+#define lock_cpu_hotplug()	do { } while (0)
+#define unlock_cpu_hotplug()		do { } while (0)
+
 #endif /* CONFIG_SMP */
 extern struct sysdev_class cpu_sysdev_class;
 
diff -Nru a/include/linux/input.h b/include/linux/input.h
--- a/include/linux/input.h	Sat Jan 24 16:27:49 2004
+++ b/include/linux/input.h	Sat Jan 24 16:27:49 2004
@@ -189,18 +189,18 @@
 #define KEY_KP3			81
 #define KEY_KP0			82
 #define KEY_KPDOT		83
-#define KEY_103RD		84
-#define KEY_F13			85
+
+#define KEY_ZENKAKUHANKAKU	85
 #define KEY_102ND		86
 #define KEY_F11			87
 #define KEY_F12			88
-#define KEY_F14			89
-#define KEY_F15			90
-#define KEY_F16			91
-#define KEY_F17			92
-#define KEY_F18			93
-#define KEY_F19			94
-#define KEY_F20			95
+#define KEY_RO			89
+#define KEY_KATAKANA		90
+#define KEY_HIRAGANA		91
+#define KEY_HENKAN		92
+#define KEY_KATAKANAHIRAGANA	93
+#define KEY_MUHENKAN		94
+#define KEY_KPJPCOMMA		95
 #define KEY_KPENTER		96
 #define KEY_RIGHTCTRL		97
 #define KEY_KPSLASH		98
@@ -225,11 +225,11 @@
 #define KEY_KPEQUAL		117
 #define KEY_KPPLUSMINUS		118
 #define KEY_PAUSE		119
-#define KEY_F21			120
-#define KEY_F22			121
-#define KEY_F23			122
-#define KEY_F24			123
-#define KEY_KPCOMMA		124
+
+#define KEY_KPCOMMA		121
+#define KEY_HANGUEL		122
+#define KEY_HANJA		123
+#define KEY_YEN			124
 #define KEY_LEFTMETA		125
 #define KEY_RIGHTMETA		126
 #define KEY_COMPOSE		127
@@ -288,24 +288,18 @@
 #define KEY_KPLEFTPAREN		179
 #define KEY_KPRIGHTPAREN	180
 
-#define KEY_INTL1		181
-#define KEY_INTL2		182
-#define KEY_INTL3		183
-#define KEY_INTL4		184
-#define KEY_INTL5		185
-#define KEY_INTL6		186
-#define KEY_INTL7		187
-#define KEY_INTL8		188
-#define KEY_INTL9		189
-#define KEY_LANG1		190
-#define KEY_LANG2		191
-#define KEY_LANG3		192
-#define KEY_LANG4		193
-#define KEY_LANG5		194
-#define KEY_LANG6		195
-#define KEY_LANG7		196
-#define KEY_LANG8		197
-#define KEY_LANG9		198
+#define KEY_F13			183
+#define KEY_F14			184
+#define KEY_F15			185
+#define KEY_F16			186
+#define KEY_F17			187
+#define KEY_F18			188
+#define KEY_F19			189
+#define KEY_F20			190
+#define KEY_F21			191
+#define KEY_F22			192
+#define KEY_F23			193
+#define KEY_F24			194
 
 #define KEY_PLAYCD		200
 #define KEY_PAUSECD		201
@@ -580,6 +574,7 @@
 #define BUS_ISAPNP		0x02
 #define BUS_USB			0x03
 #define BUS_HIL			0x04
+#define BUS_BLUETOOTH		0x05
 
 #define BUS_ISA			0x10
 #define BUS_I8042		0x11
diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h
--- a/include/linux/skbuff.h	Sat Jan 24 16:27:49 2004
+++ b/include/linux/skbuff.h	Sat Jan 24 16:27:49 2004
@@ -871,7 +871,7 @@
 	return skb->data;
 }
 
-static inline char *__skb_pull(struct sk_buff *skb, unsigned int len)
+static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len)
 {
 	skb->len -= len;
 	BUG_ON(skb->len < skb->data_len);
@@ -895,7 +895,7 @@
 
 extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta);
 
-static inline char *__pskb_pull(struct sk_buff *skb, unsigned int len)
+static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len)
 {
 	if (len > skb_headlen(skb) &&
 	    !__pskb_pull_tail(skb, len-skb_headlen(skb)))
diff -Nru a/include/net/addrconf.h b/include/net/addrconf.h
--- a/include/net/addrconf.h	Sat Jan 24 16:27:49 2004
+++ b/include/net/addrconf.h	Sat Jan 24 16:27:49 2004
@@ -57,9 +57,11 @@
 extern int			addrconf_set_dstaddr(void *arg);
 
 extern int			ipv6_chk_addr(struct in6_addr *addr,
-					      struct net_device *dev);
+					      struct net_device *dev,
+					      int strict);
 extern struct inet6_ifaddr *	ipv6_get_ifaddr(struct in6_addr *addr,
-						struct net_device *dev);
+						struct net_device *dev,
+						int strict);
 extern int			ipv6_get_saddr(struct dst_entry *dst, 
 					       struct in6_addr *daddr,
 					       struct in6_addr *saddr);
diff -Nru a/include/net/ah.h b/include/net/ah.h
--- a/include/net/ah.h	Sat Jan 24 16:27:48 2004
+++ b/include/net/ah.h	Sat Jan 24 16:27:48 2004
@@ -3,6 +3,9 @@
 
 #include <net/xfrm.h>
 
+/* This is the maximum truncated ICV length that we know of. */
+#define MAX_AH_AUTH_LEN	12
+
 struct ah_data
 {
 	u8			*key;
diff -Nru a/init/main.c b/init/main.c
--- a/init/main.c	Sat Jan 24 16:27:48 2004
+++ b/init/main.c	Sat Jan 24 16:27:48 2004
@@ -339,7 +339,7 @@
 /* Called by boot processor to activate the rest. */
 static void __init smp_init(void)
 {
-	unsigned int i;
+	unsigned int i, j=0;
 
 	/* FIXME: This should be done in userspace --RR */
 	for (i = 0; i < NR_CPUS; i++) {
@@ -348,11 +348,12 @@
 		if (cpu_possible(i) && !cpu_online(i)) {
 			printk("Bringing up %i\n", i);
 			cpu_up(i);
+			j++;
 		}
 	}
 
 	/* Any cleanup work */
-	printk("CPUS done %u\n", max_cpus);
+	printk("CPUS done %u\n", j);
 	smp_cpus_done(max_cpus);
 #if 0
 	/* Get other processors into their bootup holding patterns. */
diff -Nru a/net/core/flow.c b/net/core/flow.c
--- a/net/core/flow.c	Sat Jan 24 16:27:48 2004
+++ b/net/core/flow.c	Sat Jan 24 16:27:48 2004
@@ -66,24 +66,18 @@
 
 struct flow_flush_info {
 	atomic_t cpuleft;
-	cpumask_t cpumap;
 	struct completion completion;
 };
 static DEFINE_PER_CPU(struct tasklet_struct, flow_flush_tasklets) = { NULL };
 
 #define flow_flush_tasklet(cpu) (&per_cpu(flow_flush_tasklets, cpu))
 
-static DECLARE_MUTEX(flow_cache_cpu_sem);
-static cpumask_t flow_cache_cpu_map;
-static unsigned int flow_cache_cpu_count;
-
 static void flow_cache_new_hashrnd(unsigned long arg)
 {
 	int i;
 
-	for (i = 0; i < NR_CPUS; i++)
-		if (cpu_isset(i, flow_cache_cpu_map))
-			flow_hash_rnd_recalc(i) = 1;
+	for_each_cpu(i)
+		flow_hash_rnd_recalc(i) = 1;
 
 	flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD;
 	add_timer(&flow_hash_rnd_timer);
@@ -179,7 +173,9 @@
 	cpu = smp_processor_id();
 
 	fle = NULL;
-	if (!cpu_isset(cpu, flow_cache_cpu_map))
+	/* Packet really early in init?  Making flow_cache_init a
+	 * pre-smp initcall would solve this.  --RR */
+	if (!flow_table(cpu))
 		goto nocache;
 
 	if (flow_hash_rnd_recalc(cpu))
@@ -278,8 +274,6 @@
 	struct tasklet_struct *tasklet;
 
 	cpu = smp_processor_id();
-	if (!cpu_isset(cpu, info->cpumap))
-		return;
 
 	tasklet = flow_flush_tasklet(cpu);
 	tasklet->data = (unsigned long)info;
@@ -289,29 +283,23 @@
 void flow_cache_flush(void)
 {
 	struct flow_flush_info info;
-	static DECLARE_MUTEX(flow_flush_sem);
-
-	down(&flow_cache_cpu_sem);
-	info.cpumap = flow_cache_cpu_map;
-	atomic_set(&info.cpuleft, flow_cache_cpu_count);
-	up(&flow_cache_cpu_sem);
 
+	/* Don't want cpus going down or up during this, also protects
+	 * against multiple callers. */
+	lock_cpu_hotplug();
+	atomic_set(&info.cpuleft, num_online_cpus());
 	init_completion(&info.completion);
 
-	down(&flow_flush_sem);
-
 	local_bh_disable();
 	smp_call_function(flow_cache_flush_per_cpu, &info, 1, 0);
-	if (cpu_isset(smp_processor_id(), info.cpumap))
-		flow_cache_flush_tasklet((unsigned long)&info);
+	flow_cache_flush_tasklet((unsigned long)&info);
 	local_bh_enable();
 
 	wait_for_completion(&info.completion);
-
-	up(&flow_flush_sem);
+	unlock_cpu_hotplug();
 }
 
-static int __devinit flow_cache_cpu_prepare(int cpu)
+static void __devinit flow_cache_cpu_prepare(int cpu)
 {
 	struct tasklet_struct *tasklet;
 	unsigned long order;
@@ -324,9 +312,8 @@
 
 	flow_table(cpu) = (struct flow_cache_entry **)
 		__get_free_pages(GFP_KERNEL, order);
-
 	if (!flow_table(cpu))
-		return NOTIFY_BAD;
+		panic("NET: failed to allocate flow cache order %lu\n", order);
 
 	memset(flow_table(cpu), 0, PAGE_SIZE << order);
 
@@ -335,39 +322,8 @@
 
 	tasklet = flow_flush_tasklet(cpu);
 	tasklet_init(tasklet, flow_cache_flush_tasklet, 0);
-
-	return NOTIFY_OK;
-}
-
-static int __devinit flow_cache_cpu_online(int cpu)
-{
-	down(&flow_cache_cpu_sem);
-	cpu_set(cpu, flow_cache_cpu_map);
-	flow_cache_cpu_count++;
-	up(&flow_cache_cpu_sem);
-
-	return NOTIFY_OK;
 }
 
-static int __devinit flow_cache_cpu_notify(struct notifier_block *self,
-					   unsigned long action, void *hcpu)
-{
-	unsigned long cpu = (unsigned long)cpu;
-	switch (action) {
-	case CPU_UP_PREPARE:
-		return flow_cache_cpu_prepare(cpu);
-		break;
-	case CPU_ONLINE:
-		return flow_cache_cpu_online(cpu);
-		break;
-	}
-	return NOTIFY_OK;
-}
-
-static struct notifier_block __devinitdata flow_cache_cpu_nb = {
-	.notifier_call = flow_cache_cpu_notify,
-};
-
 static int __init flow_cache_init(void)
 {
 	int i;
@@ -389,15 +345,8 @@
 	flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD;
 	add_timer(&flow_hash_rnd_timer);
 
-	register_cpu_notifier(&flow_cache_cpu_nb);
-	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");
-	}
+	for_each_cpu(i)
+		flow_cache_cpu_prepare(i);
 
 	return 0;
 }
diff -Nru a/net/ipv4/ah4.c b/net/ipv4/ah4.c
--- a/net/ipv4/ah4.c	Sat Jan 24 16:27:49 2004
+++ b/net/ipv4/ah4.c	Sat Jan 24 16:27:49 2004
@@ -199,7 +199,7 @@
 			goto out;
 	}
         {
-		u8 auth_data[ahp->icv_trunc_len];
+		u8 auth_data[MAX_AH_AUTH_LEN];
 		
 		memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len);
 		skb_push(skb, skb->data - skb->nh.raw);
@@ -284,6 +284,8 @@
 	
 	ahp->icv_full_len = aalg_desc->uinfo.auth.icv_fullbits/8;
 	ahp->icv_trunc_len = aalg_desc->uinfo.auth.icv_truncbits/8;
+	
+	BUG_ON(ahp->icv_trunc_len > MAX_AH_AUTH_LEN);
 	
 	ahp->work_icv = kmalloc(ahp->icv_full_len, GFP_KERNEL);
 	if (!ahp->work_icv)
diff -Nru a/net/ipv4/igmp.c b/net/ipv4/igmp.c
--- a/net/ipv4/igmp.c	Sat Jan 24 16:27:50 2004
+++ b/net/ipv4/igmp.c	Sat Jan 24 16:27:50 2004
@@ -2084,16 +2084,19 @@
 	if (im && proto == IPPROTO_IGMP) {
 		rv = 1;
 	} else if (im) {
-		for (psf=im->sources; psf; psf=psf->sf_next) {
-			if (psf->sf_inaddr == src_addr)
-				break;
-		}
-		if (psf)
-			rv = psf->sf_count[MCAST_INCLUDE] ||
-				psf->sf_count[MCAST_EXCLUDE] !=
-				im->sfcount[MCAST_EXCLUDE];
-		else
-			rv = im->sfcount[MCAST_EXCLUDE] != 0;
+		if (src_addr) {
+			for (psf=im->sources; psf; psf=psf->sf_next) {
+				if (psf->sf_inaddr == src_addr)
+					break;
+			}
+			if (psf)
+				rv = psf->sf_count[MCAST_INCLUDE] ||
+					psf->sf_count[MCAST_EXCLUDE] !=
+					im->sfcount[MCAST_EXCLUDE];
+			else
+				rv = im->sfcount[MCAST_EXCLUDE] != 0;
+		} else
+			rv = 1; /* unspecified source; tentatively allow */
 	}
 	read_unlock(&in_dev->lock);
 	return rv;
diff -Nru a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
--- a/net/ipv6/addrconf.c	Sat Jan 24 16:27:50 2004
+++ b/net/ipv6/addrconf.c	Sat Jan 24 16:27:50 2004
@@ -910,7 +910,7 @@
 	return cnt;
 }
 
-int ipv6_chk_addr(struct in6_addr *addr, struct net_device *dev)
+int ipv6_chk_addr(struct in6_addr *addr, struct net_device *dev, int strict)
 {
 	struct inet6_ifaddr * ifp;
 	u8 hash = ipv6_addr_hash(addr);
@@ -920,7 +920,7 @@
 		if (ipv6_addr_cmp(&ifp->addr, addr) == 0 &&
 		    !(ifp->flags&IFA_F_TENTATIVE)) {
 			if (dev == NULL || ifp->idev->dev == dev ||
-			    !(ifp->scope&(IFA_LINK|IFA_HOST)))
+			    !(ifp->scope&(IFA_LINK|IFA_HOST) || strict))
 				break;
 		}
 	}
@@ -945,7 +945,7 @@
 	return ifp != NULL;
 }
 
-struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, struct net_device *dev)
+struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, struct net_device *dev, int strict)
 {
 	struct inet6_ifaddr * ifp;
 	u8 hash = ipv6_addr_hash(addr);
@@ -954,7 +954,7 @@
 	for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) {
 		if (ipv6_addr_cmp(&ifp->addr, addr) == 0) {
 			if (dev == NULL || ifp->idev->dev == dev ||
-			    !(ifp->scope&(IFA_LINK|IFA_HOST))) {
+			    !(ifp->scope&(IFA_LINK|IFA_HOST) || strict)) {
 				in6_ifa_hold(ifp);
 				break;
 			}
@@ -1338,7 +1338,7 @@
 	 *	2) Configure prefixes with the auto flag set
 	 */
 
-	/* Avoid arithemtic overflow. Really, we could
+	/* Avoid arithmetic overflow. Really, we could
 	   save rt_expires in seconds, likely valid_lft,
 	   but it would require division in fib gc, that it
 	   not good.
@@ -1393,7 +1393,7 @@
 
 ok:
 
-		ifp = ipv6_get_ifaddr(&addr, dev);
+		ifp = ipv6_get_ifaddr(&addr, dev, 1);
 
 		if (ifp == NULL && valid_lft) {
 			int max_addresses = in6_dev->cnf.max_addresses;
@@ -2952,7 +2952,7 @@
 			if (!ipv6_addr_any(&addr))
 				ipv6_dev_ac_dec(ifp->idev->dev, &addr);
 		}
-		if (!ipv6_chk_addr(&ifp->addr, NULL))
+		if (!ipv6_chk_addr(&ifp->addr, ifp->idev->dev, 1))
 			ip6_rt_addr_del(&ifp->addr, ifp->idev->dev);
 		break;
 	}
@@ -3030,6 +3030,9 @@
 			idev = NULL;
 		*valp = new;
 		addrconf_forward_change(idev);
+
+		if (*valp)
+			rt6_purge_dflt_routers(0);
 	} else
 		*valp = new;
 
@@ -3191,6 +3194,9 @@
 			.mode		=	0555,
 			.child		=	addrconf_sysctl.addrconf_vars,
 		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 	.addrconf_conf_dir = {
 		{
@@ -3199,6 +3205,9 @@
 			.mode		=	0555,
 			.child		=	addrconf_sysctl.addrconf_dev,
 		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 	.addrconf_proto_dir = {
 		{
@@ -3207,6 +3216,9 @@
 			.mode		=	0555,
 			.child		=	addrconf_sysctl.addrconf_conf_dir,
 		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 	.addrconf_root_dir = {
 		{
@@ -3215,6 +3227,9 @@
 			.mode		=	0555,
 			.child		=	addrconf_sysctl.addrconf_proto_dir,
 		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 };
 
diff -Nru a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
--- a/net/ipv6/af_inet6.c	Sat Jan 24 16:27:49 2004
+++ b/net/ipv6/af_inet6.c	Sat Jan 24 16:27:49 2004
@@ -355,7 +355,7 @@
 			 */
 			v4addr = LOOPBACK4_IPV6;
 			if (!(addr_type & IPV6_ADDR_MULTICAST))	{
-				if (!ipv6_chk_addr(&addr->sin6_addr, dev)) {
+				if (!ipv6_chk_addr(&addr->sin6_addr, dev, 0)) {
 					if (dev)
 						dev_put(dev);
 					err = -EADDRNOTAVAIL;
diff -Nru a/net/ipv6/ah6.c b/net/ipv6/ah6.c
--- a/net/ipv6/ah6.c	Sat Jan 24 16:27:49 2004
+++ b/net/ipv6/ah6.c	Sat Jan 24 16:27:49 2004
@@ -315,7 +315,7 @@
 	skb->nh.ipv6h->hop_limit   = 0;
 
         {
-		u8 auth_data[ahp->icv_trunc_len];
+		u8 auth_data[MAX_AH_AUTH_LEN];
 
 		memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len);
 		memset(ah->auth_data, 0, ahp->icv_trunc_len);
@@ -419,6 +419,8 @@
 	
 	ahp->icv_full_len = aalg_desc->uinfo.auth.icv_fullbits/8;
 	ahp->icv_trunc_len = aalg_desc->uinfo.auth.icv_truncbits/8;
+	
+	BUG_ON(ahp->icv_trunc_len > MAX_AH_AUTH_LEN);
 	
 	ahp->work_icv = kmalloc(ahp->icv_full_len, GFP_KERNEL);
 	if (!ahp->work_icv)
diff -Nru a/net/ipv6/anycast.c b/net/ipv6/anycast.c
--- a/net/ipv6/anycast.c	Sat Jan 24 16:27:48 2004
+++ b/net/ipv6/anycast.c	Sat Jan 24 16:27:48 2004
@@ -113,7 +113,7 @@
 		return -EPERM;
 	if (ipv6_addr_type(addr) & IPV6_ADDR_MULTICAST)
 		return -EINVAL;
-	if (ipv6_chk_addr(addr, NULL))
+	if (ipv6_chk_addr(addr, NULL, 0))
 		return -EINVAL;
 
 	pac = sock_kmalloc(sk, sizeof(struct ipv6_ac_socklist), GFP_KERNEL);
diff -Nru a/net/ipv6/datagram.c b/net/ipv6/datagram.c
--- a/net/ipv6/datagram.c	Sat Jan 24 16:27:48 2004
+++ b/net/ipv6/datagram.c	Sat Jan 24 16:27:48 2004
@@ -295,7 +295,7 @@
 
 			addr_type = ipv6_addr_type(&src_info->ipi6_addr);
 
-			if (ipv6_addr_type == IPV6_ADDR_ANY)
+			if (addr_type == IPV6_ADDR_ANY)
 				break;
 			
 			if (addr_type & IPV6_ADDR_LINKLOCAL) {
@@ -307,7 +307,7 @@
 						return -ENODEV;
 				}
 			}
-			if (!ipv6_chk_addr(&src_info->ipi6_addr, dev)) {
+			if (!ipv6_chk_addr(&src_info->ipi6_addr, dev, 0)) {
 				if (dev)
 					dev_put(dev);
 				err = -EINVAL;
diff -Nru a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
--- a/net/ipv6/exthdrs.c	Sat Jan 24 16:27:48 2004
+++ b/net/ipv6/exthdrs.c	Sat Jan 24 16:27:48 2004
@@ -367,7 +367,7 @@
 	   Inverted result:
 	   [ H_prev -> ... -> H1 ] daddr =sender
 
-	   Note, that IP output engine will rewrire this rthdr
+	   Note, that IP output engine will rewrite this rthdr
 	   by rotating it left by one addr.
 	 */
 
diff -Nru a/net/ipv6/icmp.c b/net/ipv6/icmp.c
--- a/net/ipv6/icmp.c	Sat Jan 24 16:27:48 2004
+++ b/net/ipv6/icmp.c	Sat Jan 24 16:27:48 2004
@@ -298,7 +298,7 @@
 	 */
 	addr_type = ipv6_addr_type(&hdr->daddr);
 
-	if (ipv6_chk_addr(&hdr->daddr, skb->dev))
+	if (ipv6_chk_addr(&hdr->daddr, skb->dev, 0))
 		saddr = &hdr->daddr;
 
 	/*
diff -Nru a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
--- a/net/ipv6/ip6_fib.c	Sat Jan 24 16:27:49 2004
+++ b/net/ipv6/ip6_fib.c	Sat Jan 24 16:27:49 2004
@@ -942,7 +942,7 @@
 			}
 			fn = fn->parent;
 		}
-		/* No more references are possiible at this point. */
+		/* No more references are possible at this point. */
 		if (atomic_read(&rt->rt6i_ref) != 1) BUG();
 	}
 
diff -Nru a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
--- a/net/ipv6/ip6_output.c	Sat Jan 24 16:27:48 2004
+++ b/net/ipv6/ip6_output.c	Sat Jan 24 16:27:48 2004
@@ -725,6 +725,7 @@
 {
 	int err = 0;
 
+	*dst = NULL;
 	if (sk) {
 		struct ipv6_pinfo *np = inet6_sk(sk);
 	
diff -Nru a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
--- a/net/ipv6/ip6_tunnel.c	Sat Jan 24 16:27:48 2004
+++ b/net/ipv6/ip6_tunnel.c	Sat Jan 24 16:27:48 2004
@@ -777,10 +777,10 @@
 		if (p->link)
 			ldev = dev_get_by_index(p->link);
 		
-		if ((ltype&IPV6_ADDR_UNICAST) && !ipv6_chk_addr(laddr, ldev))
+		if (ltype&IPV6_ADDR_UNICAST && !ipv6_chk_addr(laddr, ldev, 0))
 			l_ok = 0;
 		
-		if ((rtype&IPV6_ADDR_UNICAST) && ipv6_chk_addr(raddr, NULL))
+		if (rtype&IPV6_ADDR_UNICAST && ipv6_chk_addr(raddr, NULL, 0))
 			r_ok = 0;
 		
 		if (l_ok && r_ok) {
diff -Nru a/net/ipv6/mcast.c b/net/ipv6/mcast.c
--- a/net/ipv6/mcast.c	Sat Jan 24 16:27:49 2004
+++ b/net/ipv6/mcast.c	Sat Jan 24 16:27:49 2004
@@ -918,20 +918,24 @@
 				break;
 		}
 		if (mc) {
-			struct ip6_sf_list *psf;
+			if (!ipv6_addr_any(src_addr)) {
+				struct ip6_sf_list *psf;
 
-			spin_lock_bh(&mc->mca_lock);
-			for (psf=mc->mca_sources; psf; psf=psf->sf_next) {
-				if (ipv6_addr_cmp(&psf->sf_addr, src_addr) == 0)
-					break;
-			}
-			if (psf)
-				rv = psf->sf_count[MCAST_INCLUDE] ||
-					psf->sf_count[MCAST_EXCLUDE] !=
-					mc->mca_sfcount[MCAST_EXCLUDE];
-			else
-				rv = mc->mca_sfcount[MCAST_EXCLUDE] != 0;
-			spin_unlock_bh(&mc->mca_lock);
+				spin_lock_bh(&mc->mca_lock);
+				for (psf=mc->mca_sources;psf;psf=psf->sf_next) {
+					if (ipv6_addr_cmp(&psf->sf_addr,
+					    src_addr) == 0)
+						break;
+				}
+				if (psf)
+					rv = psf->sf_count[MCAST_INCLUDE] ||
+						psf->sf_count[MCAST_EXCLUDE] !=
+						mc->mca_sfcount[MCAST_EXCLUDE];
+				else
+					rv = mc->mca_sfcount[MCAST_EXCLUDE] !=0;
+				spin_unlock_bh(&mc->mca_lock);
+			} else
+				rv = 1; /* don't filter unspecified source */
 		}
 		read_unlock_bh(&idev->lock);
 		in6_dev_put(idev);
diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
--- a/net/ipv6/ndisc.c	Sat Jan 24 16:27:49 2004
+++ b/net/ipv6/ndisc.c	Sat Jan 24 16:27:49 2004
@@ -434,7 +434,7 @@
 	len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
 
 	/* for anycast or proxy, solicited_addr != src_addr */
-	ifp = ipv6_get_ifaddr(solicited_addr, dev);
+	ifp = ipv6_get_ifaddr(solicited_addr, dev, 1);
  	if (ifp) {
 		src_addr = solicited_addr;
 		in6_ifa_put(ifp);
@@ -680,7 +680,7 @@
 	struct in6_addr *target = (struct in6_addr *)&neigh->primary_key;
 	int probes = atomic_read(&neigh->probes);
 
-	if (skb && ipv6_chk_addr(&skb->nh.ipv6h->saddr, dev))
+	if (skb && ipv6_chk_addr(&skb->nh.ipv6h->saddr, dev, 1))
 		saddr = &skb->nh.ipv6h->saddr;
 
 	if ((probes -= neigh->parms->ucast_probes) < 0) {
@@ -758,7 +758,7 @@
 		}
 	}
 
-	if ((ifp = ipv6_get_ifaddr(&msg->target, dev)) != NULL) {
+	if ((ifp = ipv6_get_ifaddr(&msg->target, dev, 1)) != NULL) {
 		if (ifp->flags & IFA_F_TENTATIVE) {
 			/* Address is tentative. If the source
 			   is unspecified address, it is someone
@@ -955,7 +955,7 @@
 			return;
 		}
 	}
-	if ((ifp = ipv6_get_ifaddr(&msg->target, dev))) {
+	if ((ifp = ipv6_get_ifaddr(&msg->target, dev, 1))) {
 		if (ifp->flags & IFA_F_TENTATIVE) {
 			addrconf_dad_failure(ifp);
 			return;
diff -Nru a/net/ipv6/raw.c b/net/ipv6/raw.c
--- a/net/ipv6/raw.c	Sat Jan 24 16:27:49 2004
+++ b/net/ipv6/raw.c	Sat Jan 24 16:27:49 2004
@@ -227,7 +227,7 @@
 		v4addr = LOOPBACK4_IPV6;
 		if (!(addr_type & IPV6_ADDR_MULTICAST))	{
 			err = -EADDRNOTAVAIL;
-			if (!ipv6_chk_addr(&addr->sin6_addr, dev)) {
+			if (!ipv6_chk_addr(&addr->sin6_addr, dev, 0)) {
 				if (dev)
 					dev_put(dev);
 				goto out;
diff -Nru a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
--- a/net/ipv6/reassembly.c	Sat Jan 24 16:27:48 2004
+++ b/net/ipv6/reassembly.c	Sat Jan 24 16:27:48 2004
@@ -526,7 +526,7 @@
 		} else {
 			struct sk_buff *free_it = next;
 
-			/* Old fragmnet is completely overridden with
+			/* Old fragment is completely overridden with
 			 * new one drop it.
 			 */
 			next = next->next;
diff -Nru a/net/ipv6/route.c b/net/ipv6/route.c
--- a/net/ipv6/route.c	Sat Jan 24 16:27:49 2004
+++ b/net/ipv6/route.c	Sat Jan 24 16:27:49 2004
@@ -785,7 +785,7 @@
 			/* IPv6 strictly inhibits using not link-local
 			   addresses as nexthop address.
 			   Otherwise, router will not able to send redirects.
-			   It is very good, but in some (rare!) curcumstances
+			   It is very good, but in some (rare!) circumstances
 			   (SIT, PtP, NBMA NOARP links) it is handy to allow
 			   some exceptions. --ANK
 			 */
@@ -1365,10 +1365,10 @@
 	 */
 	/*
 	   If new MTU is less than route PMTU, this new MTU will be the
-	   lowest MTU in the path, update the route PMTU to refect PMTU
+	   lowest MTU in the path, update the route PMTU to reflect PMTU
 	   decreases; if new MTU is greater than route PMTU, and the
 	   old MTU is the lowest MTU in the path, update the route PMTU
-	   to refect the increase. In this case if the other nodes' MTU
+	   to reflect the increase. In this case if the other nodes' MTU
 	   also have the lowest MTU, TOO BIG MESSAGE will be lead to
 	   PMTU discouvery.
 	 */
diff -Nru a/net/sctp/ipv6.c b/net/sctp/ipv6.c
--- a/net/sctp/ipv6.c	Sat Jan 24 16:27:49 2004
+++ b/net/sctp/ipv6.c	Sat Jan 24 16:27:49 2004
@@ -510,7 +510,7 @@
 	if (!(type & IPV6_ADDR_UNICAST))
 		return 0;
 
-	return ipv6_chk_addr(in6, NULL);
+	return ipv6_chk_addr(in6, NULL, 0);
 }
 
 /* This function checks if the address is a valid address to be used for
diff -Nru a/security/selinux/netif.c b/security/selinux/netif.c
--- a/security/selinux/netif.c	Sat Jan 24 16:27:49 2004
+++ b/security/selinux/netif.c	Sat Jan 24 16:27:49 2004
@@ -12,6 +12,7 @@
  * it under the terms of the GNU General Public License version 2,
  * as published by the Free Software Foundation.
  */
+#include <linux/init.h>
 #include <linux/types.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>