# 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.1592 
#	drivers/atm/horizon.c	1.13    -> 1.14   
#	drivers/usb/input/hid.h	1.27.1.2 -> 1.29   
#	  net/ipv6/anycast.c	1.9     -> 1.10   
#	Documentation/video4linux/bttv/README	1.5     -> 1.6    
#	net/ipv6/ip6_output.c	1.48    -> 1.49   
#	net/ipv6/ip6_tunnel.c	1.15    -> 1.16   
#	drivers/input/serio/i8042.c	1.35.1.3 -> 1.38   
#	 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    
#	arch/i386/kernel/cpu/mcheck/non-fatal.c	1.7     -> 1.8    
#	drivers/md/raid6mmx.c	1.1     -> 1.2    
#	drivers/md/raid6recov.c	1.1     -> 1.2    
#	drivers/md/raid6sse1.c	1.1     -> 1.2    
#	drivers/md/raid6test/Makefile	1.1     -> 1.2    
#	drivers/md/raid6test/test.c	1.1     -> 1.2    
#	drivers/input/mouse/psmouse-base.c	1.43.1.1 -> 1.46   
#	     net/ipv6/icmp.c	1.45    -> 1.46   
#	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   
#	drivers/input/keyboard/98kbd.c	1.2     -> 1.3    
#	      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   
#	include/linux/input.h	1.40.1.1 -> 1.44   
#	 drivers/net/dummy.c	1.7     -> 1.8    
#	drivers/usb/input/hid-ff.c	1.4     -> 1.5    
#	arch/alpha/kernel/signal.c	1.19    -> 1.20   
#	drivers/input/joydev.c	1.20.1.1 -> 1.23   
#	include/asm-alpha/elf.h	1.6     -> 1.7    
#	security/selinux/netif.c	1.1     -> 1.2    
#	  arch/ppc64/Kconfig	1.37    -> 1.38   
#	 net/ipv6/af_inet6.c	1.59    -> 1.60   
#	drivers/usb/input/hid-core.c	1.67.1.1 -> 1.70   
#	    net/ipv6/ndisc.c	1.63    -> 1.64   
#	     net/sctp/ipv6.c	1.49    -> 1.50   
#	arch/sparc64/kernel/sys_sparc32.c	1.84    -> 1.86   
#	drivers/input/mouse/logips2pp.c	1.4     -> 1.5    
#	drivers/md/raid6x86.h	1.1     -> 1.2    
#	arch/ppc64/kernel/sys_ppc32.c	1.75    -> 1.76   
#	 drivers/pcmcia/ds.c	1.39    -> 1.43   
#	drivers/usb/input/hid-lgff.c	1.5     -> 1.6    
#	include/net/addrconf.h	1.13    -> 1.14   
#	drivers/input/keyboard/atkbd.c	1.42.1.1 -> 1.48   
#	drivers/input/mouse/psmouse.h	1.4     -> 1.5    
#	drivers/media/dvb/ttusb-dec/ttusb_dec.c	1.10    -> 1.11   
#	drivers/input/keyboard/amikbd.c	1.13    -> 1.14   
#	 net/ipv6/addrconf.c	1.86    -> 1.88   
#	arch/ppc/kernel/setup.c	1.49    -> 1.50   
#	  drivers/md/raid6.h	1.1     -> 1.2    
#	drivers/usb/input/usbkbd.c	1.32.1.1 -> 1.34   
#	drivers/md/raid6int.uc	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.2    
#	               (new)	        -> 1.1     Documentation/video4linux/CARDLIST.saa7134
#	               (new)	        -> 1.1     drivers/input/keyboard/hpps2atkbd.h
#	               (new)	        -> 1.1     Documentation/video4linux/README.cx88
#	               (new)	        -> 1.1     Documentation/video4linux/README.saa7134
#	               (new)	        -> 1.1     Documentation/video4linux/CARDLIST.tuner
#	               (new)	        -> 1.1     Documentation/video4linux/README.ir
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/01/20	torvalds@home.osdl.org	1.1569
# Linux 2.6.2-rc1
# --------------------------------------------
# 04/01/20	torvalds@home.osdl.org	1.1570
# 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.1569.1.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.1569.1.2
# [TTUSB]: ttusb_dec.c needs linux/init.h
# --------------------------------------------
# 04/01/21	vojtech@ucw.cz	1.1571
# Merge ucw.cz:/home/vojtech/bk/linus into ucw.cz:/home/vojtech/bk/input
# --------------------------------------------
# 04/01/21	davem@nuts.ninka.net	1.1569.1.3
# [SPARC64]: Update defconfig.
# --------------------------------------------
# 04/01/21	davem@kernel.bkbits.net	1.1570.1.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.1572
# input: Allow Synaptics packet rate to be controlled by the
#        psmouse_rate= option.
# --------------------------------------------
# 04/01/21	dtor_core@ameritech.net	1.1573
# 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.1574
# 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.1575
# [PATCH] selinux build fix
# 
# trivial one: uses __init and thus needs linux/init.h
# --------------------------------------------
# 04/01/21	kraxel@bytesex.org	1.1576
# [PATCH] video4linux driver documentation update
# 
# This updates / adds documentation for the bttv, saa7134 and cx88
# video4linux drivers.
# --------------------------------------------
# 04/01/21	davej@redhat.com	1.1577
# [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.1578
# [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.1579
# [NET]: Do not mark dummy_free_one() __exit in dummy.c driver.
# --------------------------------------------
# 04/01/21	vnourval@tcs.hut.fi	1.1580
# [IPV6]: Fix link-local address check in datagram.c
# --------------------------------------------
# 04/01/21	shemminger@osdl.org	1.1581
# [IPV6]: More missing sysctl table sentinels in addrconf.c
# --------------------------------------------
# 04/01/21	krkumar@us.ibm.com	1.1582
# [IPV6]: Explicity set *dst to NULL at top of ip6_dst_lookup().
# --------------------------------------------
# 04/01/21	chas@cmf.nrl.navy.mil	1.1583
# [ATM]: [horizon] avoid warning about limited range of data type
# --------------------------------------------
# 04/01/21	davem@nuts.ninka.net	1.1578.1.1
# [SPARC64]: Add missing sched_balance_exec() to 32-bit compat execve().
# --------------------------------------------
# 04/01/21	vnourval@tcs.hut.fi	1.1584
# [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.1585
# 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.1586
# [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.1587
# [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.1588
# [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.1589
# [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.1590
# Merge bk://bk.arm.linux.org.uk/linux-2.6-pcmcia
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/22	torvalds@home.osdl.org	1.1591
# 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	mikpe@user.it.uu.se	1.1592
# [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.
# --------------------------------------------
#
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	Thu Jan 22 18:53:56 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	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:56 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	Thu Jan 22 18:53:56 2004
+++ b/Documentation/video4linux/bttv/Insmod-options	Thu Jan 22 18:53:56 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	Thu Jan 22 18:53:56 2004
+++ b/Documentation/video4linux/bttv/README	Thu Jan 22 18:53:56 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/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
--- a/arch/alpha/kernel/signal.c	Thu Jan 22 18:53:57 2004
+++ b/arch/alpha/kernel/signal.c	Thu Jan 22 18:53:57 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/kernel/apic.c b/arch/i386/kernel/apic.c
--- a/arch/i386/kernel/apic.c	Thu Jan 22 18:53:57 2004
+++ b/arch/i386/kernel/apic.c	Thu Jan 22 18:53:57 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/cpu/mcheck/non-fatal.c b/arch/i386/kernel/cpu/mcheck/non-fatal.c
--- a/arch/i386/kernel/cpu/mcheck/non-fatal.c	Thu Jan 22 18:53:56 2004
+++ b/arch/i386/kernel/cpu/mcheck/non-fatal.c	Thu Jan 22 18:53:56 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/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
--- a/arch/ppc/kernel/setup.c	Thu Jan 22 18:53:57 2004
+++ b/arch/ppc/kernel/setup.c	Thu Jan 22 18:53:57 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/ppc64/Kconfig b/arch/ppc64/Kconfig
--- a/arch/ppc64/Kconfig	Thu Jan 22 18:53:57 2004
+++ b/arch/ppc64/Kconfig	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/arch/ppc64/kernel/sys_ppc32.c	Thu Jan 22 18:53:57 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/defconfig b/arch/sparc64/defconfig
--- a/arch/sparc64/defconfig	Thu Jan 22 18:53:57 2004
+++ b/arch/sparc64/defconfig	Thu Jan 22 18:53:57 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/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
--- a/arch/sparc64/kernel/sys_sparc32.c	Thu Jan 22 18:53:57 2004
+++ b/arch/sparc64/kernel/sys_sparc32.c	Thu Jan 22 18:53:57 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/drivers/atm/horizon.c b/drivers/atm/horizon.c
--- a/drivers/atm/horizon.c	Thu Jan 22 18:53:56 2004
+++ b/drivers/atm/horizon.c	Thu Jan 22 18:53:56 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/char/keyboard.c b/drivers/char/keyboard.c
--- a/drivers/char/keyboard.c	Thu Jan 22 18:53:57 2004
+++ b/drivers/char/keyboard.c	Thu Jan 22 18:53:57 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/input/joydev.c b/drivers/input/joydev.c
--- a/drivers/input/joydev.c	Thu Jan 22 18:53:57 2004
+++ b/drivers/input/joydev.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/input/keyboard/98kbd.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/input/keyboard/amikbd.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/input/keyboard/atkbd.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/input/keyboard/maple_keyb.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/input/mouse/logips2pp.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:56 2004
+++ b/drivers/input/mouse/psmouse-base.c	Thu Jan 22 18:53:56 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/input/mouse/psmouse.h	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/input/mouse/synaptics.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:56 2004
+++ b/drivers/input/serio/i8042.c	Thu Jan 22 18:53:56 2004
@@ -377,65 +377,60 @@
 	unsigned long flags;
 	unsigned char str, data;
 	unsigned int dfl;
-	struct {
-		int data;
-		int str;
-	} buffer[I8042_BUFFER_SIZE];
-	int i, j = 0;
 
 	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);
+		return IRQ_RETVAL(0);
+	}
+
+	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:
+
+	mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
+	return IRQ_RETVAL(1);
 }
 
 /*
@@ -519,17 +514,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 +621,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 +640,6 @@
 static void i8042_timer_func(unsigned long data)
 {
 	i8042_interrupt(0, NULL, NULL);
-	mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
 }
 
 
@@ -666,8 +652,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 +923,9 @@
 
 	dbg_init();
 
+	init_timer(&i8042_timer);
+	i8042_timer.function = i8042_timer_func;
+
 	if (i8042_platform_init())
 		return -EBUSY;
 
@@ -951,20 +938,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	Thu Jan 22 18:53:57 2004
+++ b/drivers/macintosh/adbhid.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:56 2004
+++ b/drivers/md/Kconfig	Thu Jan 22 18:53:56 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/raid6.h b/drivers/md/raid6.h
--- a/drivers/md/raid6.h	Thu Jan 22 18:53:57 2004
+++ b/drivers/md/raid6.h	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/md/raid6algos.c	Thu Jan 22 18:53:57 2004
@@ -46,7 +46,7 @@
 	&raid6_intx16,
 	&raid6_intx32,
 #endif
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__)
 	&raid6_mmxx1,
 	&raid6_mmxx2,
 	&raid6_sse1x1,
@@ -55,6 +55,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	Thu Jan 22 18:53:57 2004
+++ b/drivers/md/raid6int.uc	Thu Jan 22 18:53:57 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
@@ -21,11 +21,63 @@
 #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	Thu Jan 22 18:53:56 2004
+++ b/drivers/md/raid6mmx.c	Thu Jan 22 18:53:56 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	Thu Jan 22 18:53:56 2004
+++ b/drivers/md/raid6recov.c	Thu Jan 22 18:53:56 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	Thu Jan 22 18:53:56 2004
+++ b/drivers/md/raid6sse1.c	Thu Jan 22 18:53:56 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	Thu Jan 22 18:53:56 2004
+++ b/drivers/md/raid6test/Makefile	Thu Jan 22 18:53:56 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	Thu Jan 22 18:53:56 2004
+++ b/drivers/md/raid6test/test.c	Thu Jan 22 18:53:56 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/md/raid6x86.h	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c	Thu Jan 22 18:53:57 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"
diff -Nru a/drivers/net/dummy.c b/drivers/net/dummy.c
--- a/drivers/net/dummy.c	Thu Jan 22 18:53:57 2004
+++ b/drivers/net/dummy.c	Thu Jan 22 18:53:57 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/pcmcia/ds.c b/drivers/pcmcia/ds.c
--- a/drivers/pcmcia/ds.c	Thu Jan 22 18:53:57 2004
+++ b/drivers/pcmcia/ds.c	Thu Jan 22 18:53:57 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/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c	Thu Jan 22 18:53:57 2004
+++ b/drivers/usb/input/hid-core.c	Thu Jan 22 18:53:57 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;
@@ -1407,6 +1410,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 +1529,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	Thu Jan 22 18:53:57 2004
+++ b/drivers/usb/input/hid-ff.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/usb/input/hid-input.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/usb/input/hid-lgff.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/drivers/usb/input/usbkbd.c	Thu Jan 22 18:53:57 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/include/asm-alpha/elf.h b/include/asm-alpha/elf.h
--- a/include/asm-alpha/elf.h	Thu Jan 22 18:53:57 2004
+++ b/include/asm-alpha/elf.h	Thu Jan 22 18:53:57 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/linux/input.h b/include/linux/input.h
--- a/include/linux/input.h	Thu Jan 22 18:53:57 2004
+++ b/include/linux/input.h	Thu Jan 22 18:53:57 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/net/addrconf.h b/include/net/addrconf.h
--- a/include/net/addrconf.h	Thu Jan 22 18:53:57 2004
+++ b/include/net/addrconf.h	Thu Jan 22 18:53:57 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/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
--- a/net/ipv6/addrconf.c	Thu Jan 22 18:53:57 2004
+++ b/net/ipv6/addrconf.c	Thu Jan 22 18:53:57 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;
 			}
@@ -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;
 	}
@@ -3191,6 +3191,9 @@
 			.mode		=	0555,
 			.child		=	addrconf_sysctl.addrconf_vars,
 		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 	.addrconf_conf_dir = {
 		{
@@ -3199,6 +3202,9 @@
 			.mode		=	0555,
 			.child		=	addrconf_sysctl.addrconf_dev,
 		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 	.addrconf_proto_dir = {
 		{
@@ -3207,6 +3213,9 @@
 			.mode		=	0555,
 			.child		=	addrconf_sysctl.addrconf_conf_dir,
 		},
+		{
+			.ctl_name	=	0,	/* sentinel */
+		}
 	},
 	.addrconf_root_dir = {
 		{
@@ -3215,6 +3224,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	Thu Jan 22 18:53:57 2004
+++ b/net/ipv6/af_inet6.c	Thu Jan 22 18:53:57 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/anycast.c b/net/ipv6/anycast.c
--- a/net/ipv6/anycast.c	Thu Jan 22 18:53:56 2004
+++ b/net/ipv6/anycast.c	Thu Jan 22 18:53:56 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	Thu Jan 22 18:53:56 2004
+++ b/net/ipv6/datagram.c	Thu Jan 22 18:53:56 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/icmp.c b/net/ipv6/icmp.c
--- a/net/ipv6/icmp.c	Thu Jan 22 18:53:56 2004
+++ b/net/ipv6/icmp.c	Thu Jan 22 18:53:56 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_output.c b/net/ipv6/ip6_output.c
--- a/net/ipv6/ip6_output.c	Thu Jan 22 18:53:56 2004
+++ b/net/ipv6/ip6_output.c	Thu Jan 22 18:53:56 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	Thu Jan 22 18:53:56 2004
+++ b/net/ipv6/ip6_tunnel.c	Thu Jan 22 18:53:56 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/ndisc.c b/net/ipv6/ndisc.c
--- a/net/ipv6/ndisc.c	Thu Jan 22 18:53:57 2004
+++ b/net/ipv6/ndisc.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/net/ipv6/raw.c	Thu Jan 22 18:53:57 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/sctp/ipv6.c b/net/sctp/ipv6.c
--- a/net/sctp/ipv6.c	Thu Jan 22 18:53:57 2004
+++ b/net/sctp/ipv6.c	Thu Jan 22 18:53:57 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	Thu Jan 22 18:53:57 2004
+++ b/security/selinux/netif.c	Thu Jan 22 18:53:57 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>