# 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.1-rc2 -> 1.1496 
#	  arch/sparc/Kconfig	1.22    -> 1.24   
#	drivers/media/dvb/frontends/tda1004x.c	1.5     -> 1.6    
#	  sound/oss/cs46xx.c	1.36    -> 1.37   
#	drivers/sbus/char/bpp.c	1.16    -> 1.17   
#	include/asm-sparc/vaddrs.h	1.4     -> 1.5    
#	scripts/kconfig/qconf.cc	1.8     -> 1.9    
#	include/asm-i386/mach-pc9800/irq_vectors.h	1.2     -> 1.3    
#	 drivers/scsi/fcal.c	1.14    -> 1.15   
#	net/ipv6/ip6_output.c	1.47    -> 1.48   
#	net/ipv6/ip6_tunnel.c	1.14    -> 1.15   
#	include/asm-i386/mach-visws/irq_vectors.h	1.6     -> 1.7    
#	drivers/block/ll_rw_blk.c	1.222   -> 1.223  
#	 drivers/net/Space.c	1.43    -> 1.44   
#	drivers/parport/parport_sunbpp.c	1.7     -> 1.8    
#	drivers/media/dvb/ttpci/Kconfig	1.5     -> 1.6    
#	sound/oss/esssolo1.c	1.32    -> 1.33   
#	   arch/i386/Kconfig	1.94    -> 1.95   
#	drivers/media/dvb/frontends/Kconfig	1.11    -> 1.12   
#	   fs/jfs/jfs_imap.c	1.29    -> 1.30   
#	 sound/oss/ite8172.c	1.25    -> 1.26   
#	include/asm-sparc/kmap_types.h	1.12    -> 1.13   
#	include/linux/blkdev.h	1.129   -> 1.130  
#	 include/linux/udp.h	1.8     -> 1.9    
#	scripts/kconfig/mconf.c	1.8     -> 1.9    
#	arch/sparc/mm/highmem.c	1.3     -> 1.4    
#	include/asm-sparc/page.h	1.9     -> 1.10   
#	  include/linux/ip.h	1.11    -> 1.12   
#	net/irda/ircomm/ircomm_tty.c	1.29    -> 1.30   
#	drivers/ide/ide-tape.c	1.32    -> 1.33   
#	arch/sparc64/defconfig	1.107   -> 1.108  
#	include/asm-sparc/pgtsrmmu.h	1.7     -> 1.8    
#	arch/sparc/mm/fault.c	1.12    -> 1.13   
#	drivers/scsi/pluto.c	1.13    -> 1.14   
#	 sound/oss/rme96xx.c	1.17    -> 1.18   
#	 include/linux/ide.h	1.78    -> 1.79   
#	include/net/irda/ircomm_tty.h	1.9     -> 1.10   
#	include/linux/pci_ids.h	1.128   -> 1.129  
#	      fs/sysfs/dir.c	1.12    -> 1.13   
#	arch/sparc/mm/init.c	1.25    -> 1.26   
#	sound/oss/sonicvibes.c	1.28    -> 1.29   
#	arch/sparc/mm/io-unit.c	1.7     -> 1.8    
#	arch/x86_64/kernel/io_apic.c	1.18    -> 1.19   
#	net/decnet/af_decnet.c	1.35    -> 1.36   
#	         mm/mremap.c	1.34    -> 1.35   
#	drivers/sbus/char/vfc_dev.c	1.12    -> 1.13   
#	    drivers/fc4/fc.c	1.12    -> 1.13   
#	arch/sparc/mm/srmmu.c	1.36    -> 1.37   
#	include/linux/skbuff.h	1.37    -> 1.38   
#	        net/compat.c	1.12    -> 1.13   
#	 net/sched/sch_htb.c	1.18    -> 1.19   
#	  sound/oss/au1000.c	1.6     -> 1.7    
#	drivers/media/dvb/ttpci/av7110.c	1.17    -> 1.18   
#	net/packet/af_packet.c	1.36    -> 1.37   
#	drivers/char/agp/amd64-agp.c	1.68    -> 1.69   
#	arch/i386/kernel/timers/timer_tsc.c	1.34    -> 1.35   
#	drivers/mtd/maps/sun_uflash.c	1.5     -> 1.6    
#	drivers/scsi/qlogicpti.c	1.20    -> 1.21   
#	drivers/pnp/pnpbios/bioscalls.c	1.2     -> 1.3    
#	include/linux/ipv6.h	1.14    -> 1.15   
#	             CREDITS	1.102   -> 1.103  
#	drivers/char/agp/ati-agp.c	1.12    -> 1.13   
#	     kernel/module.c	1.95    -> 1.96   
#	sound/oss/nec_vrc5477.c	1.19    -> 1.20   
#	  sound/oss/es1371.c	1.32    -> 1.33   
#	arch/sparc/mm/sun4c.c	1.34    -> 1.35   
#	      fs/jfs/namei.c	1.35    -> 1.36   
#	drivers/media/dvb/frontends/sp887x.c	1.4     -> 1.5    
#	  include/net/ipv6.h	1.26    -> 1.27   
#	drivers/ide/ide-io.c	1.20    -> 1.21   
#	arch/sparc64/kernel/sparc64_ksyms.c	1.60    -> 1.61   
#	include/linux/netfilter_ipv4.h	1.5     -> 1.6    
#	include/linux/netfilter_ipv6.h	1.1     -> 1.2    
#	arch/sparc64/Kconfig	1.40    -> 1.41   
#	scripts/kconfig/conf.c	1.11    -> 1.12   
#	drivers/ide/pci/cmd640.c	1.7     -> 1.8    
#	 net/ipv6/addrconf.c	1.78    -> 1.79   
#	scripts/kconfig/gconf.c	1.7     -> 1.10   
#	include/linux/netdevice.h	1.66    -> 1.67   
#	arch/sparc/mm/iommu.c	1.11    -> 1.12   
#	  drivers/scsi/esp.c	1.34    -> 1.35   
#	drivers/serial/sunzilog.c	1.38    -> 1.39   
#	sound/oss/cs4281/cs4281m.c	1.27    -> 1.28   
#	include/asm-sparc/highmem.h	1.9     -> 1.10   
#	  sound/oss/es1370.c	1.31    -> 1.32   
#	drivers/mtd/chips/jedec_probe.c	1.8     -> 1.9    
#	drivers/char/drm/ffb_drv.c	1.12    -> 1.13   
#	               (new)	        -> 1.1     include/asm-sparc/setup.h
#	               (new)	        -> 1.1     include/asm-sparc/fixmap.h
#	               (new)	        -> 1.1     include/asm-sparc64/setup.h
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/01/05	torvalds@home.osdl.org	1.1482.1.3
# Linux 2.6.1-rc2
# --------------------------------------------
# 04/01/05	davem@nuts.ninka.net	1.1474.1.100
# [NET]: In dev_kfree_skb_any() use dev_kfree_skb_irq() if irqs_disabled().
# 
# With help from Jeff Garzik and others.
# --------------------------------------------
# 04/01/05	jt@hpl.hp.com	1.1474.1.101
# [IRDA]: Fix locking in the ircomm-shutdown path.
# --------------------------------------------
# 04/01/05	wesolows@foobazco.org	1.1474.66.8
# [SPARC32]: Fix BUG on swapout on srmmu systems.
# 
# This fixes BUG-on-swapout for srmmu-based systems.  The problem is
# caused by kmap_atomic_to_page being fed an aliased (pagetable) address
# and returning bogons.  This also adjusts the pkmap and fixmap base
# addresses so they cannot overlap.
# --------------------------------------------
# 04/01/05	davem@nuts.ninka.net	1.1474.1.102
# [NET]: Un-deprecate skb_linearize(), we can re-deprecate in 2.7.x
# --------------------------------------------
# 04/01/05	ak@muc.de	1.1482.1.4
# [PATCH] Fix interrupt routing problem on x86-64
# 
# The MSI port to x86-64 added an interrupt routing bug that makes the
# kernel not boot anymore on some machines.
# 
# Fix that.
# --------------------------------------------
# 04/01/05	B.Zolnierkiewicz@elka.pw.edu.pl	1.1482.1.5
# [PATCH] cmd640.c: fix PCI type1 access
# 
# Revert wrong changes introduced in 2.4.21.
# 
# From: Stefan Talpalaru <stefantalpalaru@yahoo.com>,
#       Ingo Kilian <ikilian@web.de>.
# --------------------------------------------
# 04/01/05	B.Zolnierkiewicz@elka.pw.edu.pl	1.1482.1.6
# [PATCH] ide-tape.c: stop abusing rq->flags
# 
# Use rq->cmd[0] instead of rq->flags for storing special request flags.
# 
# Per Jens' suggestion.  Tested by Stef van der Made <svdmade@planet.nl>.
# --------------------------------------------
# 04/01/05	B.Zolnierkiewicz@elka.pw.edu.pl	1.1482.1.7
# [PATCH] remove dead and broken DISK_RECOVERY_TIME support
# 
# It was also removed in 2.4.23.
# --------------------------------------------
# 04/01/05	B.Zolnierkiewicz@elka.pw.edu.pl	1.1482.1.8
# [PATCH] fix oopses on rmmod in some OSS drivers
# 
# Fix for oops on rmmod caused by *_remove() function marked as __devinit
# (and thus discarded after module initialization - if CONFIG_MODULES=y
# and CONFIG_HOTPLUG is not set).
# This patch changes __devinit to __devexit and adds __devexit_p() where
# pointer to such function is used.
# 
# The only exception is au1000, where au1000_remove() is called from
# cleanup_au1000() function - __devinit is jest removed there.
# --------------------------------------------
# 04/01/06	zippel@linux-m68k.org	1.1474.59.3
# [PATCH] generate an error if writing of kernel config failed
# 
# generate an error if writing of kernel config failed
# --------------------------------------------
# 04/01/06	zippel@linux-m68k.org	1.1474.59.4
# [PATCH] fix gconf segfault problem
# 
# fix gconf segfault problem (by Romain Lievin <roms@tilp.info>)
# --------------------------------------------
# 04/01/06	zippel@linux-m68k.org	1.1474.59.5
# [PATCH] gconf compile warning fixes
# 
# gconf compile warning fixes (by Buddy Lucas <b.lucas@ohra.nl>)
# --------------------------------------------
# 04/01/06	zippel@linux-m68k.org	1.1474.59.6
# [PATCH] gconf startup fixes
# 
# Let gconf find it's glade file, even it's started with an absolute path
# and check srcdir so it also works if it's compiled outside of the tree.
# --------------------------------------------
# 04/01/06	zippel@linux-m68k.org	1.1474.59.7
# [PATCH] qconf fix
# 
# Sometimes a menuconfig item is shown twice, so hide the other item.
# --------------------------------------------
# 04/01/06	torvalds@home.osdl.org	1.1482.1.9
# Merge home.osdl.org:/home/torvalds/v2.5/kconfig
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/06	ambx1@neo.rr.com	1.1482.1.10
# [PATCH] Fix PnP BIOS call
# 
# The recent escd fix I have made corrects a thinko in the PnPBIOS code and it
# turns out that faults from calling /proc/pnp/bus/escd were probably not caused
# by BIOS bugs.
# --------------------------------------------
# 04/01/06	davem@nuts.ninka.net	1.1482.1.11
# Merge nuts.ninka.net:/disk1/davem/BK/sparcwork-2.6
# into nuts.ninka.net:/disk1/davem/BK/sparc-2.6
# --------------------------------------------
# 04/01/06	davem@nuts.ninka.net	1.1482.2.1
# Merge nuts.ninka.net:/disk1/davem/BK/network-2.6
# into nuts.ninka.net:/disk1/davem/BK/net-2.6
# --------------------------------------------
# 04/01/06	jmorris@redhat.com	1.1482.2.2
# [NETFILTER]: Add SELINUX priority values for ipv4/ipv6, approved by Harald Welte.
# --------------------------------------------
# 04/01/06	devik@cdi.cz	1.1482.2.3
# [NET]: Make sure that class selected by priority is a leaf in HTB scheduler.
# --------------------------------------------
# 04/01/06	mk@linux-ipv6.org	1.1482.2.4
# Fix my PGP fingerprint in the CREDITS file.
# --------------------------------------------
# 04/01/07	davej@redhat.com	1.1484
# [AGPGART] Add support for Radeon IGP345M to ATI GART driver.
# Also consolidate a bunch of convoluted if's into a single
# "is this an r200 or r300" function.
# --------------------------------------------
# 04/01/07	torvalds@home.osdl.org	1.1485
# Merge bk://linux-dj.bkbits.net/agpgart
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/07	akpm@osdl.org	1.1486
# [PATCH] MSI build fixes
# 
# Add missing NR_VECTORS definition to visws and pc9800.  Also, make MSI
# support dependent on CONFIG_X86_IO_APIC, as it won't build without IOAPIC
# support.
# --------------------------------------------
# 04/01/07	akpm@osdl.org	1.1487
# [PATCH] fix sysfs oops
# 
# From: Greg KH <greg@kroah.com>
# 
# This fixes an oops when a kobject is unregistered before it's child is.
# The usb-serial devices show this bug very easily (yank out a device
# while its port is opened...)
# 
# Patch was originally written by Mike Gorse <mgorse@mgorse.dhs.org>
# --------------------------------------------
# 04/01/07	akpm@osdl.org	1.1488
# [PATCH] JFS fix for NFS on little-endian systems
# 
# From: Dave Kleikamp <shaggy@austin.ibm.com>
# 
# After Jose debugged the problem down to the routine jfs_get_parent, we
# were able to find the problem.  I believe it only affects users of
# NFS-exported JFS file systems on big-endian hardware.
# 
# The problem was a missing le32_to_cpu macro.  The patch also fixes a
# return code to be more consistent other implementations of get_parent.
# --------------------------------------------
# 04/01/07	akpm@osdl.org	1.1489
# [PATCH] dvb: firmware fixes
# 
# From: Michael Hunold <hunold@convergence.de>
# 
# - move around sp887x firmware file entry to be close to sp887x selection
# 
# - fix a bunch of filenames to point to /usr/lib/hotplug/firmware/ rather
#   then /etc/dvb
# 
# - fix the av7110 firmware config entry for "make allyesconfig"
# --------------------------------------------
# 04/01/07	akpm@osdl.org	1.1490
# [PATCH] ia32 sched_clock() deadlock fix
# 
# From: Ingo Molnar <mingo@elte.hu>,
# 
# Voyager is getting odd deadlocks due to the taking of xtime_lock() in
# sched_clock()->get_jiffies_64().
# 
# I had this patch queued up to fix a different deadlock, which occurs when we
# relax the requirement that TSC's be synchronised across CPUs.  But it will
# fix James' deadlock too.
# --------------------------------------------
# 04/01/07	shaggy@austin.ibm.com	1.1491
# [PATCH] don't clear i_sb
# 
# From: Christoph Hellwig <hch@lst.de>
# 
# JFS currently clears i_sb in some error pathes which can make the
# core kernel OOPS because it may never be NULL.  Noticed because some
# IBM people try to "fix" the core kernel for it now..
# --------------------------------------------
# 04/01/07	davem@nuts.ninka.net	1.1492
# Merge nuts.ninka.net:/disk1/davem/BK/sparcwork-2.6
# into nuts.ninka.net:/disk1/davem/BK/sparc-2.6
# --------------------------------------------
# 04/01/07	davem@nuts.ninka.net	1.1491.1.1
# Merge nuts.ninka.net:/disk1/davem/BK/network-2.6
# into nuts.ninka.net:/disk1/davem/BK/net-2.6
# --------------------------------------------
# 04/01/07	willy@debian.org	1.1493
# [SPARC32]: Use drivers/block/Kconfig
# --------------------------------------------
# 04/01/07	ak@suse.de	1.1491.1.2
# [COMPAT]: Handle SO_TIMESTAMP cmsgs.
# --------------------------------------------
# 04/01/07	vnourval@tcs.hut.fi	1.1491.1.3
# [IPV6]: Autoconfig link-local address on ip6-ip6 tunnel device.
# --------------------------------------------
# 04/01/07	torvalds@home.osdl.org	1.1491.2.1
# Fix ttpci bogus use of floating point by casting the
# constant expression properly.
# --------------------------------------------
# 04/01/07	torvalds@home.osdl.org	1.1491.2.2
# Fix silly mremap test.
# 
# Get off the drugs, Linus.
# --------------------------------------------
# 04/01/07	torvalds@home.osdl.org	1.1494
# Merge bk://kernel.bkbits.net/davem/sparc-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/07	torvalds@home.osdl.org	1.1495
# Merge bk://kernel.bkbits.net/davem/net-2.6
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 04/01/07	torvalds@home.osdl.org	1.1496
# Don't relocate non-allocated regions in modules.
# 
# This fixes loading of modules compiled with debugging on
# some platforms.
# 
# From Rusty.
# --------------------------------------------
#
diff -Nru a/CREDITS b/CREDITS
--- a/CREDITS	Wed Jan  7 22:12:57 2004
+++ b/CREDITS	Wed Jan  7 22:12:57 2004
@@ -1567,7 +1567,7 @@
 E: mk@isl.rdc.toshiba.co.jp
 E: mk@karaba.org
 W: http://www.karaba.org/~mk/
-P: 1024D/2EC7E30D 9A35 D378 F084 9EA4 EFBA  925B 1C93 B376 F0EF BE59
+P: 1024D/2EC7E30D 4DC3 949B 5A6C F0D6 375F  4472 8888 A8E1 2EC7 E30D
 D: IPsec, IPv6
 D: USAGI/WIDE Project, TOSHIBA CORPORATION
 S: 2-47-8, Takinogawa,
diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig
--- a/arch/i386/Kconfig	Wed Jan  7 22:12:57 2004
+++ b/arch/i386/Kconfig	Wed Jan  7 22:12:57 2004
@@ -1056,7 +1056,7 @@
 
 config PCI_USE_VECTOR
 	bool "Vector-based interrupt indexing"
-	depends on X86_LOCAL_APIC
+	depends on X86_LOCAL_APIC && X86_IO_APIC
 	default n
 	help
 	   This replaces the current existing IRQ-based index interrupt scheme
diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
--- a/arch/i386/kernel/timers/timer_tsc.c	Wed Jan  7 22:12:57 2004
+++ b/arch/i386/kernel/timers/timer_tsc.c	Wed Jan  7 22:12:57 2004
@@ -140,7 +140,8 @@
 #ifndef CONFIG_NUMA
 	if (!use_tsc)
 #endif
-		return (unsigned long long)get_jiffies_64() * (1000000000 / HZ);
+		/* no locking but a rare wrong value is not a big deal */
+		return jiffies_64 * (1000000000 / HZ);
 
 	/* Read the Time Stamp Counter */
 	rdtscll(this_offset);
diff -Nru a/arch/sparc/Kconfig b/arch/sparc/Kconfig
--- a/arch/sparc/Kconfig	Wed Jan  7 22:12:57 2004
+++ b/arch/sparc/Kconfig	Wed Jan  7 22:12:57 2004
@@ -300,138 +300,7 @@
 source "drivers/sbus/char/Kconfig"
 endif
 
-
-menu "Block devices"
-
-config BLK_DEV_FD
-	bool "Normal floppy disk support"
-	---help---
-	  If you want to use the floppy disk drive(s) of your PC under Linux,
-	  say Y. Information about this driver, especially important for IBM
-	  Thinkpad users, is contained in <file:Documentation/floppy.txt>.
-	  That file also contains the location of the Floppy driver FAQ as
-	  well as location of the fdutils package used to configure additional
-	  parameters of the driver at run time.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called floppy.
-
-config BLK_DEV_LOOP
-	tristate "Loopback device support"
-	---help---
-	  Saying Y here will allow you to use a regular file as a block
-	  device; you can then create a file system on that block device and
-	  mount it just as you would mount other block devices such as hard
-	  drive partitions, CD-ROM drives or floppy drives. The loop devices
-	  are block special device files with major number 7 and typically
-	  called /dev/loop0, /dev/loop1 etc.
-
-	  This is useful if you want to check an ISO 9660 file system before
-	  burning the CD, or if you want to use floppy images without first
-	  writing them to floppy. Furthermore, some Linux distributions avoid
-	  the need for a dedicated Linux partition by keeping their complete
-	  root file system inside a DOS FAT file using this loop device
-	  driver.
-
-	  The loop device driver can also be used to "hide" a file system in a
-	  disk partition, floppy, or regular file, either using encryption
-	  (scrambling the data) or steganography (hiding the data in the low
-	  bits of, say, a sound file). This is also safe if the file resides
-	  on a remote file server. If you want to do this, you will first have
-	  to acquire and install a kernel patch from
-	  <ftp://ftp.kerneli.org/pub/kerneli/>, and then you need to
-	  say Y to this option.
-
-	  Note that alternative ways to use encrypted file systems are
-	  provided by the cfs package, which can be gotten from
-	  <ftp://ftp.kerneli.org/pub/kerneli/net-source/>, and the newer tcfs
-	  package, available at <http://tcfs.dia.unisa.it/>. You do not need
-	  to say Y here if you want to use one of these. However, using cfs
-	  requires saying Y to "NFS file system support" below while using
-	  tcfs requires applying a kernel patch. An alternative steganography
-	  solution is provided by StegFS, also available from
-	  <ftp://ftp.kerneli.org/pub/kerneli/net-source/>.
-
-	  To use the loop device, you need the losetup utility and a recent
-	  version of the mount program, both contained in the util-linux
-	  package. The location and current version number of util-linux is
-	  contained in the file <file:Documentation/Changes>.
-
-	  Note that this loop device has nothing to do with the loopback
-	  device used for network connections from the machine to itself.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called loop.
-
-	  Most users will answer N here.
-
-config BLK_DEV_NBD
-	tristate "Network block device support"
-	depends on NET
-	---help---
-	  Saying Y here will allow your computer to be a client for network
-	  block devices, i.e. it will be able to use block devices exported by
-	  servers (mount file systems on them etc.). Communication between
-	  client and server works over TCP/IP networking, but to the client
-	  program this is hidden: it looks like a regular local file access to
-	  a block device special file such as /dev/nd0.
-
-	  Network block devices also allows you to run a block-device in
-	  userland (making server and client physically the same computer,
-	  communicating using the loopback network device).
-
-	  Read <file:Documentation/nbd.txt> for more information, especially
-	  about where to find the server code, which runs in user space and
-	  does not need special kernel support.
-
-	  Note that this has nothing to do with the network file systems NFS
-	  or Coda; you can say N here even if you intend to use NFS or Coda.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called nbd.
-
-	  If unsure, say N.
-
-source "drivers/md/Kconfig"
-
-config BLK_DEV_RAM
-	tristate "RAM disk support"
-	---help---
-	  Saying Y here will allow you to use a portion of your RAM memory as
-	  a block device, so that you can make file systems on it, read and
-	  write to it and do all the other things that you can do with normal
-	  block devices (such as hard drives). It is usually used to load and
-	  store a copy of a minimal root file system off of a floppy into RAM
-	  during the initial install of Linux.
-
-	  Note that the kernel command line option "ramdisk=XX" is now
-	  obsolete. For details, read <file:Documentation/ramdisk.txt>.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called rd.
-
-	  Most normal users won't need the RAM disk functionality, and can
-	  thus say N here.
-
-config BLK_DEV_RAM_SIZE
-	int "Default RAM disk size"
-	depends on BLK_DEV_RAM
-	default "4096"
-	help
-	  The default value is 4096. Only change this if you know what are
-	  you doing. If you are using IBM S/390, then set this to 8192.
-
-config BLK_DEV_INITRD
-	bool "Initial RAM disk (initrd) support"
-	depends on BLK_DEV_RAM=y
-	help
-	  The initial RAM disk is a RAM disk that is loaded by the boot loader
-	  (loadlin or lilo) and that is mounted as root before the normal boot
-	  procedure. It is typically used to load modules needed to mount the
-	  "real" root file system, etc. See <file:Documentation/initrd.txt>
-	  for details.
-
-endmenu
+source "drivers/block/Kconfig"
 
 # Don't frighten a common SBus user
 if PCI
@@ -446,6 +315,8 @@
 
 source "drivers/fc4/Kconfig"
 
+source "drivers/md/Kconfig"
+
 source "net/Kconfig"
 
 # This one must be before the filesystem configs. -DaveM
@@ -539,6 +410,13 @@
 
 config DEBUG_SPINLOCK
 	bool "Spinlock debugging"
+
+config DEBUG_HIGHMEM
+	bool "Highmem debugging"
+	depends on DEBUG_KERNEL && HIGHMEM
+	help
+	  This options enables addition error checking for high memory systems.
+	  Disable for production systems.
 
 config DEBUG_SPINLOCK_SLEEP
 	bool "Sleep-inside-spinlock checking"
diff -Nru a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
--- a/arch/sparc/mm/fault.c	Wed Jan  7 22:12:57 2004
+++ b/arch/sparc/mm/fault.c	Wed Jan  7 22:12:57 2004
@@ -36,7 +36,7 @@
 
 #define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))
 
-extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
+extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS+1];
 extern int prom_node_root;
 
 /* At boot time we determine these two values necessary for setting
@@ -72,7 +72,7 @@
 		mlist = mlist->theres_more;
 		bytes = mlist->num_bytes;
 		tally += bytes;
-		if (i >= SPARC_PHYS_BANKS-1) {
+		if (i > SPARC_PHYS_BANKS-1) {
 			printk ("The machine has more banks than "
 				"this kernel can support\n"
 				"Increase the SPARC_PHYS_BANKS "
diff -Nru a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c
--- a/arch/sparc/mm/highmem.c	Wed Jan  7 22:12:57 2004
+++ b/arch/sparc/mm/highmem.c	Wed Jan  7 22:12:57 2004
@@ -27,6 +27,7 @@
 #include <asm/pgalloc.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
+#include <asm/fixmap.h>
 
 void *kmap_atomic(struct page *page, enum km_type type)
 {
@@ -39,7 +40,7 @@
 		return page_address(page);
 
 	idx = type + KM_TYPE_NR*smp_processor_id();
-	vaddr = fix_kmap_begin + idx * PAGE_SIZE;
+	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
 
 /* XXX Fix - Anton */
 #if 0
@@ -48,11 +49,10 @@
 	flush_cache_all();
 #endif
 
-#if HIGHMEM_DEBUG
-	if (!pte_none(*(kmap_pte+idx)))
-		BUG();
+#ifdef CONFIG_DEBUG_HIGHMEM
+	BUG_ON(!pte_none(*(kmap_pte-idx)));
 #endif
-	set_pte(kmap_pte+idx, mk_pte(page, kmap_prot));
+	set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
 /* XXX Fix - Anton */
 #if 0
 	__flush_tlb_one(vaddr);
@@ -65,17 +65,17 @@
 
 void kunmap_atomic(void *kvaddr, enum km_type type)
 {
-	unsigned long vaddr = (unsigned long) kvaddr;
+#ifdef CONFIG_DEBUG_HIGHMEM
+	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
 	unsigned long idx = type + KM_TYPE_NR*smp_processor_id();
 
-	if (vaddr < fix_kmap_begin) { // FIXME
+	if (vaddr < FIXADDR_START) { // FIXME
 		dec_preempt_count();
 		preempt_check_resched();
 		return;
 	}
 
-	if (vaddr != fix_kmap_begin + idx * PAGE_SIZE)
-		BUG();
+	BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN+idx));
 
 /* XXX Fix - Anton */
 #if 0
@@ -84,12 +84,11 @@
 	flush_cache_all();
 #endif
 
-#ifdef HIGHMEM_DEBUG
 	/*
 	 * force other mappings to Oops if they'll try to access
 	 * this pte without first remap it
 	 */
-	pte_clear(kmap_pte+idx);
+	pte_clear(kmap_pte-idx);
 /* XXX Fix - Anton */
 #if 0
 	__flush_tlb_one(vaddr);
@@ -97,6 +96,25 @@
 	flush_tlb_all();
 #endif
 #endif
+
 	dec_preempt_count();
 	preempt_check_resched();
+}
+
+/* We may be fed a pagetable here by ptep_to_xxx and others. */
+struct page *kmap_atomic_to_page(void *ptr)
+{
+	unsigned long idx, vaddr = (unsigned long)ptr;
+	pte_t *pte;
+
+	if (vaddr < SRMMU_NOCACHE_VADDR)
+		return virt_to_page(ptr);
+	if (vaddr < PKMAP_BASE)
+		return pfn_to_page(__nocache_pa(vaddr) >> PAGE_SHIFT);
+	BUG_ON(vaddr < FIXADDR_START);
+	BUG_ON(vaddr > FIXADDR_TOP);
+
+	idx = virt_to_fix(vaddr);
+	pte = kmap_pte - (idx - FIX_KMAP_BEGIN);
+	return pte_page(*pte);
 }
diff -Nru a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
--- a/arch/sparc/mm/init.c	Wed Jan  7 22:12:57 2004
+++ b/arch/sparc/mm/init.c	Wed Jan  7 22:12:57 2004
@@ -41,7 +41,7 @@
 
 unsigned long page_kernel;
 
-struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
+struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS+1];
 unsigned long sparc_unmapped_base;
 
 struct pgtable_cache_struct pgt_quicklists;
@@ -61,17 +61,13 @@
 EXPORT_SYMBOL(kmap_prot);
 EXPORT_SYMBOL(kmap_pte);
 
-/* These are set in {srmmu,sun4c}_paging_init() */
-unsigned long fix_kmap_begin;
-unsigned long fix_kmap_end;
-
-#define kmap_get_fixed_pte(vaddr) \
+#define kmap_get_fixmap_pte(vaddr) \
 	pte_offset_kernel(pmd_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr))
 
 void __init kmap_init(void)
 {
 	/* cache the first kmap pte */
-	kmap_pte = kmap_get_fixed_pte(fix_kmap_begin);
+	kmap_pte = kmap_get_fixmap_pte(__fix_to_virt(FIX_KMAP_BEGIN));
 	kmap_prot = __pgprot(SRMMU_ET_PTE | SRMMU_PRIV | SRMMU_CACHE);
 }
 
@@ -385,12 +381,12 @@
 {
 	unsigned long tmp;
 
-#ifdef DEBUG_HIGHMEM
+#ifdef CONFIG_DEBUG_HIGHMEM
 	printk("mapping high region %08lx - %08lx\n", start_pfn, end_pfn);
 #endif
 
 	for (tmp = start_pfn; tmp < end_pfn; tmp++) {
-		struct page *page = mem_map + tmp;
+		struct page *page = pfn_to_page(tmp);
 
 		ClearPageReserved(page);
 		set_bit(PG_highmem, &page->flags);
@@ -407,7 +403,18 @@
 	int initpages = 0; 
 	int i;
 
-	highmem_start_page = mem_map + highstart_pfn;
+	highmem_start_page = pfn_to_page(highstart_pfn);
+
+	if (PKMAP_BASE+LAST_PKMAP*PAGE_SIZE >= FIXADDR_START) {
+		prom_printf("BUG: fixmap and pkmap areas overlap\n");
+		prom_printf("pkbase: 0x%lx pkend: 0x%lx fixstart 0x%lx\n",
+		       PKMAP_BASE,
+		       (unsigned long)PKMAP_BASE+LAST_PKMAP*PAGE_SIZE,
+		       FIXADDR_START);
+		prom_printf("Please mail sparclinux@vger.kernel.org.\n");
+		prom_halt();
+	}
+
 
 	/* Saves us work later. */
 	memset((void *)&empty_zero_page, 0, PAGE_SIZE);
diff -Nru a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c
--- a/arch/sparc/mm/io-unit.c	Wed Jan  7 22:12:57 2004
+++ b/arch/sparc/mm/io-unit.c	Wed Jan  7 22:12:57 2004
@@ -65,7 +65,7 @@
 	
 	for (xptend = iounit->page_table + (16 * PAGE_SIZE) / sizeof(iopte_t);
 	     xpt < xptend;)
-	     	*xpt++ = 0;
+	     	iopte_val(*xpt++) = 0;
 }
 
 /* One has to hold iounit->lock to call this */
@@ -199,7 +199,7 @@
 			pmdp = pmd_offset(pgdp, addr);
 			ptep = pte_offset_map(pmdp, addr);
 
-			set_pte(ptep, pte_val(mk_pte(virt_to_page(page), dvma_prot)));
+			set_pte(ptep, mk_pte(virt_to_page(page), dvma_prot));
 			
 			i = ((addr - IOUNIT_DMA_BASE) >> PAGE_SHIFT);
 
@@ -207,7 +207,7 @@
 				struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
 
 				iopte = (iopte_t *)(iounit->page_table + i);
-				*iopte = __iopte(MKIOPTE(__pa(page)));
+				*iopte = MKIOPTE(__pa(page));
 			}
 		}
 		addr += PAGE_SIZE;
diff -Nru a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c
--- a/arch/sparc/mm/iommu.c	Wed Jan  7 22:12:57 2004
+++ b/arch/sparc/mm/iommu.c	Wed Jan  7 22:12:57 2004
@@ -405,7 +405,7 @@
 	iopte_t *iopte = iommu->page_table;
 
 	iopte += ((busa - iommu->start) >> PAGE_SHIFT);
-	return pfn_to_page((pte_val(*iopte) & IOPTE_PAGE) >> (PAGE_SHIFT-4));
+	return pfn_to_page((iopte_val(*iopte) & IOPTE_PAGE) >> (PAGE_SHIFT-4));
 }
 #endif
 
diff -Nru a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
--- a/arch/sparc/mm/srmmu.c	Wed Jan  7 22:12:57 2004
+++ b/arch/sparc/mm/srmmu.c	Wed Jan  7 22:12:57 2004
@@ -139,10 +139,6 @@
 /* these will be initialized in srmmu_nocache_calcsize() */
 unsigned long srmmu_nocache_size;
 unsigned long srmmu_nocache_end;
-unsigned long pkmap_base;
-unsigned long pkmap_base_end;
-extern unsigned long fix_kmap_begin;
-extern unsigned long fix_kmap_end;
 
 /* 1 bit <=> 256 bytes of nocache <=> 64 PTEs */
 #define SRMMU_NOCACHE_BITMAP_SHIFT (PAGE_SHIFT - 4)
@@ -154,11 +150,6 @@
 void *srmmu_nocache_bitmap;
 static struct bit_map srmmu_nocache_map;
 
-/* This makes sense. Honest it does - Anton */
-#define __nocache_pa(VADDR) (((unsigned long)VADDR) - SRMMU_NOCACHE_VADDR + __pa((unsigned long)srmmu_nocache_pool))
-#define __nocache_va(PADDR) (__va((unsigned long)PADDR) - (unsigned long)srmmu_nocache_pool + SRMMU_NOCACHE_VADDR)
-#define __nocache_fix(VADDR) __va(__nocache_pa(VADDR))
-
 static unsigned long srmmu_pte_pfn(pte_t pte)
 {
 	if (srmmu_device_memory(pte_val(pte))) {
@@ -322,10 +313,7 @@
 		printk("Size 0x%x unaligned int nocache request\n", size);
 		size += SRMMU_NOCACHE_BITMAP_SHIFT-1;
 	}
-	if (align > SRMMU_NOCACHE_ALIGN_MAX) {
-		BUG();
-		return 0;
-	}
+	BUG_ON(align > SRMMU_NOCACHE_ALIGN_MAX);
 
 	offset = bit_map_string_get(&srmmu_nocache_map,
 		       			size >> SRMMU_NOCACHE_BITMAP_SHIFT,
@@ -361,7 +349,7 @@
 		    vaddr, (unsigned long)SRMMU_NOCACHE_VADDR);
 		BUG();
 	}
-	if (vaddr >= srmmu_nocache_end) {
+	if (vaddr+size >= srmmu_nocache_end) {
 		printk("Vaddr %lx is bigger than nocache end 0x%lx\n",
 		    vaddr, srmmu_nocache_end);
 		BUG();
@@ -403,17 +391,15 @@
 
  /* P3 XXX The 4x overuse: corroborated by /proc/meminfo. */
 	// if (srmmu_nocache_npages < 256) srmmu_nocache_npages = 256;
-	if (srmmu_nocache_npages < 550) srmmu_nocache_npages = 550;
+	if (srmmu_nocache_npages < SRMMU_MIN_NOCACHE_PAGES)
+		srmmu_nocache_npages = SRMMU_MIN_NOCACHE_PAGES;
 
 	/* anything above 1280 blows up */
-	if (srmmu_nocache_npages > 1280) srmmu_nocache_npages = 1280;
+	if (srmmu_nocache_npages > SRMMU_MAX_NOCACHE_PAGES)
+		srmmu_nocache_npages = SRMMU_MAX_NOCACHE_PAGES;
 
 	srmmu_nocache_size = srmmu_nocache_npages * PAGE_SIZE;
 	srmmu_nocache_end = SRMMU_NOCACHE_VADDR + srmmu_nocache_size;
-	fix_kmap_begin = srmmu_nocache_end;
-	fix_kmap_end = fix_kmap_begin + (KM_TYPE_NR * NR_CPUS - 1) * PAGE_SIZE;
-	pkmap_base = SRMMU_NOCACHE_VADDR + srmmu_nocache_size + 0x40000;
-	pkmap_base_end = pkmap_base + LAST_PKMAP * PAGE_SIZE;
 }
 
 void srmmu_nocache_init(void)
@@ -453,7 +439,7 @@
 		if (srmmu_cache_pagetables)
 			pteval |= SRMMU_CACHE;
 
-		srmmu_set_pte(__nocache_fix(pte), pteval);
+		srmmu_set_pte(__nocache_fix(pte), __pte(pteval));
 
 		vaddr += PAGE_SIZE;
 		paddr += PAGE_SIZE;
@@ -1083,6 +1069,8 @@
 			memset(__nocache_fix(ptep), 0, SRMMU_PTE_SZ_SOFT);
 			srmmu_pmd_set(__nocache_fix(pmdp), ptep);
 		}
+		if (start > (0xffffffffUL - SRMMU_PMD_SIZE_SOFT))
+			break;
 		start = (start + SRMMU_PMD_SIZE) & SRMMU_PMD_MASK;
 	}
 }
@@ -1111,6 +1099,8 @@
 			memset(ptep, 0, SRMMU_PTE_SZ_SOFT);
 			srmmu_pmd_set(pmdp, ptep);
 		}
+		if (start > (0xffffffffUL - SRMMU_PMD_SIZE_SOFT))
+			break;
 		start = (start + SRMMU_PMD_SIZE) & SRMMU_PMD_MASK;
 	}
 }
@@ -1315,12 +1305,13 @@
 	srmmu_allocate_ptable_skeleton(DVMA_VADDR, DVMA_END);
 #endif
 
-	srmmu_allocate_ptable_skeleton(fix_kmap_begin, fix_kmap_end);
-	srmmu_allocate_ptable_skeleton(pkmap_base, pkmap_base_end);
-
-	pgd = pgd_offset_k(pkmap_base);
-	pmd = srmmu_pmd_offset(pgd, pkmap_base);
-	pte = srmmu_pte_offset(pmd, pkmap_base);
+	srmmu_allocate_ptable_skeleton(
+		__fix_to_virt(__end_of_fixed_addresses - 1), FIXADDR_TOP);
+	srmmu_allocate_ptable_skeleton(PKMAP_BASE, PKMAP_END);
+
+	pgd = pgd_offset_k(PKMAP_BASE);
+	pmd = srmmu_pmd_offset(pgd, PKMAP_BASE);
+	pte = srmmu_pte_offset(pmd, PKMAP_BASE);
 	pkmap_page_table = pte;
 
 	flush_cache_all();
diff -Nru a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
--- a/arch/sparc/mm/sun4c.c	Wed Jan  7 22:12:57 2004
+++ b/arch/sparc/mm/sun4c.c	Wed Jan  7 22:12:57 2004
@@ -2028,18 +2028,12 @@
 extern unsigned long bootmem_init(unsigned long *pages_avail);
 extern unsigned long last_valid_pfn;
 
-extern unsigned long fix_kmap_begin;
-extern unsigned long fix_kmap_end;
-
 void __init sun4c_paging_init(void)
 {
 	int i, cnt;
 	unsigned long kernel_end, vaddr;
 	extern struct resource sparc_iomap;
 	unsigned long end_pfn, pages_avail;
-
-	fix_kmap_begin = KERNBASE + SRMMU_MAXMEM; /* Why bother with SRMMU_MAXMEM? */
-	fix_kmap_end = fix_kmap_begin + ((KM_TYPE_NR*NR_CPUS)-1)*PAGE_SIZE;
 
 	kernel_end = (unsigned long) &end;
 	kernel_end += (SUN4C_REAL_PGDIR_SIZE * 4);
diff -Nru a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
--- a/arch/sparc64/Kconfig	Wed Jan  7 22:12:57 2004
+++ b/arch/sparc64/Kconfig	Wed Jan  7 22:12:57 2004
@@ -501,145 +501,15 @@
 
 source "drivers/mtd/Kconfig"
 
-
-menu "Block devices"
-
-config BLK_DEV_FD
-	bool "Normal floppy disk support"
-	---help---
-	  If you want to use the floppy disk drive(s) of your PC under Linux,
-	  say Y. Information about this driver, especially important for IBM
-	  Thinkpad users, is contained in <file:Documentation/floppy.txt>.
-	  That file also contains the location of the Floppy driver FAQ as
-	  well as location of the fdutils package used to configure additional
-	  parameters of the driver at run time.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called floppy.
-
-config BLK_DEV_LOOP
-	tristate "Loopback device support"
-	---help---
-	  Saying Y here will allow you to use a regular file as a block
-	  device; you can then create a file system on that block device and
-	  mount it just as you would mount other block devices such as hard
-	  drive partitions, CD-ROM drives or floppy drives. The loop devices
-	  are block special device files with major number 7 and typically
-	  called /dev/loop0, /dev/loop1 etc.
-
-	  This is useful if you want to check an ISO 9660 file system before
-	  burning the CD, or if you want to use floppy images without first
-	  writing them to floppy. Furthermore, some Linux distributions avoid
-	  the need for a dedicated Linux partition by keeping their complete
-	  root file system inside a DOS FAT file using this loop device
-	  driver.
-
-	  The loop device driver can also be used to "hide" a file system in a
-	  disk partition, floppy, or regular file, either using encryption
-	  (scrambling the data) or steganography (hiding the data in the low
-	  bits of, say, a sound file). This is also safe if the file resides
-	  on a remote file server. If you want to do this, you will first have
-	  to acquire and install a kernel patch from
-	  <ftp://ftp.kerneli.org/pub/kerneli/>, and then you need to
-	  say Y to this option.
-
-	  Note that alternative ways to use encrypted file systems are
-	  provided by the cfs package, which can be gotten from
-	  <ftp://ftp.kerneli.org/pub/kerneli/net-source/>, and the newer tcfs
-	  package, available at <http://tcfs.dia.unisa.it/>. You do not need
-	  to say Y here if you want to use one of these. However, using cfs
-	  requires saying Y to "NFS file system support" below while using
-	  tcfs requires applying a kernel patch. An alternative steganography
-	  solution is provided by StegFS, also available from
-	  <ftp://ftp.kerneli.org/pub/kerneli/net-source/>.
-
-	  To use the loop device, you need the losetup utility and a recent
-	  version of the mount program, both contained in the util-linux
-	  package. The location and current version number of util-linux is
-	  contained in the file <file:Documentation/Changes>.
-
-	  Note that this loop device has nothing to do with the loopback
-	  device used for network connections from the machine to itself.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called loop.
-
-	  Most users will answer N here.
-
-config BLK_DEV_NBD
-	tristate "Network block device support"
-	depends on NET
-	---help---
-	  Saying Y here will allow your computer to be a client for network
-	  block devices, i.e. it will be able to use block devices exported by
-	  servers (mount file systems on them etc.). Communication between
-	  client and server works over TCP/IP networking, but to the client
-	  program this is hidden: it looks like a regular local file access to
-	  a block device special file such as /dev/nd0.
-
-	  Network block devices also allows you to run a block-device in
-	  userland (making server and client physically the same computer,
-	  communicating using the loopback network device).
-
-	  Read <file:Documentation/nbd.txt> for more information, especially
-	  about where to find the server code, which runs in user space and
-	  does not need special kernel support.
-
-	  Note that this has nothing to do with the network file systems NFS
-	  or Coda; you can say N here even if you intend to use NFS or Coda.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called nbd.
-
-	  If unsure, say N.
-
-source "drivers/md/Kconfig"
-
-config BLK_DEV_RAM
-	tristate "RAM disk support"
-	---help---
-	  Saying Y here will allow you to use a portion of your RAM memory as
-	  a block device, so that you can make file systems on it, read and
-	  write to it and do all the other things that you can do with normal
-	  block devices (such as hard drives). It is usually used to load and
-	  store a copy of a minimal root file system off of a floppy into RAM
-	  during the initial install of Linux.
-
-	  Note that the kernel command line option "ramdisk=XX" is now
-	  obsolete. For details, read <file:Documentation/ramdisk.txt>.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called rd.
-
-	  Most normal users won't need the RAM disk functionality, and can
-	  thus say N here.
-
-config BLK_DEV_RAM_SIZE
-	int "Default RAM disk size"
-	depends on BLK_DEV_RAM
-	default "4096"
-	help
-	  The default value is 4096. Only change this if you know what are
-	  you doing. If you are using IBM S/390, then set this to 8192.
-
-config BLK_DEV_INITRD
-	bool "Initial RAM disk (initrd) support"
-	depends on BLK_DEV_RAM=y
-	help
-	  The initial RAM disk is a RAM disk that is loaded by the boot loader
-	  (loadlin or lilo) and that is mounted as root before the normal boot
-	  procedure. It is typically used to load modules needed to mount the
-	  "real" root file system, etc. See <file:Documentation/initrd.txt>
-	  for details.
-
-endmenu
-
+source "drivers/block/Kconfig"
 
 source "drivers/ide/Kconfig"
 
 source "drivers/scsi/Kconfig"
 
 source "drivers/fc4/Kconfig"
+
+source "drivers/md/Kconfig"
 
 if PCI
 source "drivers/message/fusion/Kconfig"
diff -Nru a/arch/sparc64/defconfig b/arch/sparc64/defconfig
--- a/arch/sparc64/defconfig	Wed Jan  7 22:12:57 2004
+++ b/arch/sparc64/defconfig	Wed Jan  7 22:12:57 2004
@@ -198,22 +198,16 @@
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
 CONFIG_BLK_DEV_NBD=m
-
-#
-# Multi-device support (RAID and LVM)
-#
-CONFIG_MD=y
-CONFIG_BLK_DEV_MD=m
-CONFIG_MD_LINEAR=m
-CONFIG_MD_RAID0=m
-CONFIG_MD_RAID1=m
-CONFIG_MD_RAID5=m
-CONFIG_MD_MULTIPATH=m
-CONFIG_BLK_DEV_DM=m
-# CONFIG_DM_IOCTL_V4 is not set
 # CONFIG_BLK_DEV_RAM is not set
+# CONFIG_BLK_DEV_INITRD is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -368,6 +362,19 @@
 #
 CONFIG_SCSI_PLUTO=m
 CONFIG_SCSI_FCAL=m
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_IOCTL_V4 is not set
 
 #
 # Fusion MPT device support
diff -Nru a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
--- a/arch/sparc64/kernel/sparc64_ksyms.c	Wed Jan  7 22:12:57 2004
+++ b/arch/sparc64/kernel/sparc64_ksyms.c	Wed Jan  7 22:12:57 2004
@@ -19,6 +19,7 @@
 #include <linux/pci.h>
 #include <linux/interrupt.h>
 #include <linux/fs_struct.h>
+#include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/socket.h>
 #include <linux/percpu.h>
@@ -96,6 +97,7 @@
 extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
 extern long sparc32_open(const char * filename, int flags, int mode);
 extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space);
+extern long sys_close(unsigned int);
                 
 extern int __ashrdi3(int, int);
 
@@ -324,6 +326,7 @@
 EXPORT_SYMBOL(sys_ioctl);
 EXPORT_SYMBOL(compat_sys_ioctl);
 EXPORT_SYMBOL(sparc32_open);
+EXPORT_SYMBOL(sys_close);
 #endif
 
 /* Special internal versions of library functions. */
diff -Nru a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
--- a/arch/x86_64/kernel/io_apic.c	Wed Jan  7 22:12:57 2004
+++ b/arch/x86_64/kernel/io_apic.c	Wed Jan  7 22:12:57 2004
@@ -1933,7 +1933,7 @@
 	io_apic_write(ioapic, 0x10+2*pin, *(((int *)&entry)+0));
 	spin_unlock_irqrestore(&ioapic_lock, flags);
 
-	return entry.vector;
+	return 0;
 }
 
 #endif /*CONFIG_ACPI_BOOT*/
diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
--- a/drivers/block/ll_rw_blk.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/block/ll_rw_blk.c	Wed Jan  7 22:12:57 2004
@@ -780,11 +780,6 @@
 	"REQ_PM_SUSPEND",
 	"REQ_PM_RESUME",
 	"REQ_PM_SHUTDOWN",
-	"REQ_IDETAPE_PC1",
-	"REQ_IDETAPE_PC2",
-	"REQ_IDETAPE_READ",
-	"REQ_IDETAPE_WRITE",
-	"REQ_IDETAPE_READ_BUFFER",
 };
 
 void blk_dump_rq_flags(struct request *rq, char *msg)
diff -Nru a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
--- a/drivers/char/agp/amd64-agp.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/char/agp/amd64-agp.c	Wed Jan  7 22:12:57 2004
@@ -347,10 +347,10 @@
 	while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev)) 
 			!= NULL) {
 		if (fix_northbridge(loop_dev, pdev, cap_ptr) < 0) { 
-			printk(KERN_INFO PFX "No usable aperture found.\n");
+			printk(KERN_ERR PFX "No usable aperture found.\n");
 #ifdef __x86_64__ 
 			/* should port this to i386 */
-			printk(KERN_INFO PFX "Consider rebooting with iommu=memaper=2 to get a good aperture.\n");
+			printk(KERN_ERR PFX "Consider rebooting with iommu=memaper=2 to get a good aperture.\n");
 #endif 
 			return -1;  
 		}
@@ -358,7 +358,7 @@
 		nr_garts = i;
 #ifdef CONFIG_SMP
 		if (i > MAX_HAMMER_GARTS) { 
-			printk(KERN_INFO PFX "Too many northbridges for AGP\n");
+			printk(KERN_ERR PFX "Too many northbridges for AGP\n");
 			return -1;
 		}
 #else
diff -Nru a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c
--- a/drivers/char/agp/ati-agp.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/char/agp/ati-agp.c	Wed Jan  7 22:12:57 2004
@@ -135,6 +135,15 @@
 	return retval;
 }
 
+static int is_r200(void)
+{
+	if ((agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS100) ||
+	    (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS200) ||
+	    (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS200_B) ||
+	    (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS250))
+		return 1;
+	return 0;
+}
 
 static int ati_fetch_size(void)
 {
@@ -142,13 +151,10 @@
 	u32 temp;
 	struct aper_size_info_lvl2 *values;
 
-	if ((agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS100) ||
-	    (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS200) ||
-	    (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS250)) {
+	if (is_r200)
 		pci_read_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, &temp);
-	} else {
+	else
 		pci_read_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, &temp);
-	}
 
 	temp = (temp & 0x0000000e);
 	values = A_SIZE_LVL2(agp_bridge->driver->aperture_sizes);
@@ -178,9 +184,7 @@
 	previous_size = A_SIZE_LVL2(agp_bridge->previous_size);
 
 	/* Write back the previous size and disable gart translation */
-	if ((agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS100) ||
-	    (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS200) ||
-	    (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS250)) {
+	if (is_r200) {
 		pci_read_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, &temp);
 		temp = ((temp & ~(0x0000000f)) | previous_size->size_value);
 		pci_write_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, temp);
@@ -202,13 +206,10 @@
 	temp = (temp & 0xfffff000);
 	ati_generic_private.registers = (volatile u8 *) ioremap(temp, 4096);
 
-	if ((agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS100) ||
-	    (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS200) ||
-	    (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS250)) {
-        	pci_write_config_dword(agp_bridge->dev, ATI_RS100_IG_AGPMODE, 0x20000);
-	} else {
+	if (is_r200)
+       	pci_write_config_dword(agp_bridge->dev, ATI_RS100_IG_AGPMODE, 0x20000);
+	else
 		pci_write_config_dword(agp_bridge->dev, ATI_RS300_IG_AGPMODE, 0x20000);
-	}
 
 	/* address to map too */
         /*
@@ -332,9 +333,7 @@
 	/* Write out the size register */
 	current_size = A_SIZE_LVL2(agp_bridge->current_size);
 
-	if ((agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS100) ||
-	    (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS200) ||
-	    (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS250)) {
+	if (is_r200) {
 		pci_read_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, &temp);
 		temp = (((temp & ~(0x0000000e)) | current_size->size_value)
 			| 0x00000001);
@@ -412,6 +411,10 @@
 	{
 		.device_id	= PCI_DEVICE_ID_ATI_RS200,
 		.chipset_name	= "IGP330/340/345/350/M",
+	},
+	{
+		.device_id	= PCI_DEVICE_ID_ATI_RS200_B,
+		.chipset_name	= "IGP345M",
 	},
 	{
 		.device_id	= PCI_DEVICE_ID_ATI_RS250,
diff -Nru a/drivers/char/drm/ffb_drv.c b/drivers/char/drm/ffb_drv.c
--- a/drivers/char/drm/ffb_drv.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/char/drm/ffb_drv.c	Wed Jan  7 22:12:57 2004
@@ -372,25 +372,6 @@
 	return ret;
 }
 
-#ifndef MODULE
-/* DRM(options) is called by the kernel to parse command-line options
- * passed via the boot-loader (e.g., LILO).  It calls the insmod option
- * routine, drm_parse_drm.
- */
-
-/* JH- We have to hand expand the string ourselves because of the cpp.  If
- * anyone can think of a way that we can fit into the __setup macro without
- * changing it, then please send the solution my way.
- */
-static int __init ffb_options(char *str)
-{
-	DRM(parse_options)(str);
-	return 1;
-}
-
-__setup(DRIVER_NAME "=", ffb_options);
-#endif
-
 #include "drm_fops.h"
 #include "drm_init.h"
 #include "drm_ioctl.h"
diff -Nru a/drivers/fc4/fc.c b/drivers/fc4/fc.c
--- a/drivers/fc4/fc.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/fc4/fc.c	Wed Jan  7 22:12:57 2004
@@ -1156,3 +1156,6 @@
 	kfree(p);
 	return status;
 }
+
+MODULE_LICENSE("GPL");
+
diff -Nru a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
--- a/drivers/ide/ide-io.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/ide/ide-io.c	Wed Jan  7 22:12:57 2004
@@ -54,37 +54,6 @@
 #include <asm/io.h>
 #include <asm/bitops.h>
 
-#if (DISK_RECOVERY_TIME > 0)
-
-#error So the User Has To Fix the Compilation And Stop Hacking Port 0x43. Does anyone ever use this anyway ??
-
-/*
- * For really screwy hardware (hey, at least it *can* be used with Linux)
- * we can enforce a minimum delay time between successive operations.
- */
-static unsigned long read_timer (ide_hwif_t *hwif)
-{
-	unsigned long t, flags;
-	int i;
-	
-	/* FIXME this is completely unsafe! */
-	local_irq_save(flags);
-	t = jiffies * 11932;
-	outb_p(0, 0x43);
-	i = inb_p(0x40);
-	i |= inb_p(0x40) << 8;
-	local_irq_restore(flags);
-	return (t - i);
-}
-#endif /* DISK_RECOVERY_TIME */
-
-static inline void set_recovery_timer (ide_hwif_t *hwif)
-{
-#if (DISK_RECOVERY_TIME > 0)
-	hwif->last_time = read_timer(hwif);
-#endif /* DISK_RECOVERY_TIME */
-}
-
 /**
  *	ide_end_request		-	complete an IDE I/O
  *	@drive: IDE device for the I/O
@@ -653,10 +622,6 @@
 	if (block == 0 && drive->remap_0_to_1 == 1)
 		block = 1;  /* redirect MBR access to EZ-Drive partn table */
 
-#if (DISK_RECOVERY_TIME > 0)
-	while ((read_timer() - HWIF(drive)->last_time) < DISK_RECOVERY_TIME);
-#endif
-
 	if (blk_pm_suspend_request(rq) &&
 	    rq->pm->pm_step == ide_pm_state_start_suspend)
 		/* Mark drive blocked when starting the suspend sequence. */
@@ -1116,7 +1081,6 @@
 					startstop =
 					DRIVER(drive)->error(drive, "irq timeout", hwif->INB(IDE_STATUS_REG));
 			}
-			set_recovery_timer(hwif);
 			drive->service_time = jiffies - drive->service_start;
 			spin_lock_irq(&ide_lock);
 			enable_irq(hwif->irq);
@@ -1313,7 +1277,6 @@
 	 * same irq as is currently being serviced here, and Linux
 	 * won't allow another of the same (on any CPU) until we return.
 	 */
-	set_recovery_timer(HWIF(drive));
 	drive->service_time = jiffies - drive->service_start;
 	if (startstop == ide_stopped) {
 		if (hwgroup->handler == NULL) {	/* paranoia */
diff -Nru a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
--- a/drivers/ide/ide-tape.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/ide/ide-tape.c	Wed Jan  7 22:12:57 2004
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/ide-tape.c		Version 1.18	Nov, 2003
+ * linux/drivers/ide/ide-tape.c		Version 1.19	Nov, 2003
  *
  * Copyright (C) 1995 - 1999 Gadi Oxman <gadio@netvision.net.il>
  *
@@ -422,7 +422,7 @@
  *		sharing a (fast) ATA-2 disk with any (slow) new ATAPI device.
  */
 
-#define IDETAPE_VERSION "1.18"
+#define IDETAPE_VERSION "1.19"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -1216,10 +1216,14 @@
  *	requests to the tail of our block device request queue and wait
  *	for their completion.
  */
-#define idetape_request(rq) \
-	((rq)->flags & (REQ_IDETAPE_PC1 | REQ_IDETAPE_PC2 | \
-			REQ_IDETAPE_READ | REQ_IDETAPE_WRITE | \
-			REQ_IDETAPE_READ_BUFFER))
+
+enum {
+	REQ_IDETAPE_PC1		= (1 << 0), /* packet command (first stage) */
+	REQ_IDETAPE_PC2		= (1 << 1), /* packet command (second stage) */
+	REQ_IDETAPE_READ	= (1 << 2),
+	REQ_IDETAPE_WRITE	= (1 << 3),
+	REQ_IDETAPE_READ_BUFFER	= (1 << 4),
+};
 
 /*
  *	Error codes which are returned in rq->errors to the higher part
@@ -1892,7 +1896,7 @@
 		tape->active_stage = NULL;
 		tape->active_data_request = NULL;
 		tape->nr_pending_stages--;
-		if (rq->flags & REQ_IDETAPE_WRITE) {
+		if (rq->cmd[0] & REQ_IDETAPE_WRITE) {
 #if ONSTREAM_DEBUG
 			if (tape->debug_level >= 2) {
 				if (tape->onstream) {
@@ -1938,7 +1942,7 @@
 					}
 				}
 			}
-		} else if (rq->flags & REQ_IDETAPE_READ) {
+		} else if (rq->cmd[0] & REQ_IDETAPE_READ) {
 			if (error == IDETAPE_ERROR_EOD) {
 				set_bit(IDETAPE_PIPELINE_ERROR, &tape->flags);
 				idetape_abort_pipeline(drive, active_stage);
@@ -1996,6 +2000,13 @@
 	pc->callback = &idetape_request_sense_callback;
 }
 
+static void idetape_init_rq(struct request *rq, u8 cmd)
+{
+	memset(rq, 0, sizeof(*rq));
+	rq->flags = REQ_SPECIAL;
+	rq->cmd[0] = cmd;
+}
+
 /*
  *	idetape_queue_pc_head generates a new packet command request in front
  *	of the request queue, before the current request, so that it will be
@@ -2017,8 +2028,7 @@
  */
 static void idetape_queue_pc_head (ide_drive_t *drive, idetape_pc_t *pc,struct request *rq)
 {
-	memset(rq, 0, sizeof(*rq));
-	rq->flags = REQ_IDETAPE_PC1;
+	idetape_init_rq(rq, REQ_IDETAPE_PC1);
 	rq->buffer = (char *) pc;
 	(void) ide_do_drive_cmd(drive, rq, ide_preempt);
 }
@@ -2729,7 +2739,7 @@
 	if (tape->debug_level >= 5)
 		printk(KERN_INFO "ide-tape: rq_status: %d, "
 			"dev: %s, cmd: %ld, errors: %d\n", rq->rq_status,
-			 rq->rq_disk->disk_name, rq->flags, rq->errors);
+			 rq->rq_disk->disk_name, rq->cmd[0], rq->errors);
 #endif
 	if (tape->debug_level >= 2)
 		printk(KERN_INFO "ide-tape: sector: %ld, "
@@ -2737,11 +2747,11 @@
 			rq->sector, rq->nr_sectors, rq->current_nr_sectors);
 #endif /* IDETAPE_DEBUG_LOG */
 
-	if (!idetape_request(rq)) {
+	if ((rq->flags & REQ_SPECIAL) == 0) {
 		/*
 		 * We do not support buffer cache originated requests.
 		 */
-		printk(KERN_NOTICE "ide-tape: %s: Unsupported command in "
+		printk(KERN_NOTICE "ide-tape: %s: Unsupported request in "
 			"request queue (%ld)\n", drive->name, rq->flags);
 		ide_end_request(drive, 0, 0);
 		return ide_stopped;
@@ -2778,7 +2788,7 @@
 	 */
 	if (tape->onstream)
 		status.b.dsc = 1;
-	if (!drive->dsc_overlap && !(rq->flags & REQ_IDETAPE_PC2))
+	if (!drive->dsc_overlap && !(rq->cmd[0] & REQ_IDETAPE_PC2))
 		set_bit(IDETAPE_IGNORE_DSC, &tape->flags);
 
 	/*
@@ -2792,7 +2802,7 @@
 	if (tape->tape_still_time > 100 && tape->tape_still_time < 200)
 		tape->measure_insert_time = 1;
 	if (tape->req_buffer_fill &&
-	    (rq->flags & (REQ_IDETAPE_WRITE | REQ_IDETAPE_READ))) {
+	    (rq->cmd[0] & (REQ_IDETAPE_WRITE | REQ_IDETAPE_READ))) {
 		tape->req_buffer_fill = 0;
 		tape->writes_since_buffer_fill = 0;
 		tape->reads_since_buffer_fill = 0;
@@ -2806,12 +2816,12 @@
 		tape->insert_speed = tape->insert_size / 1024 * HZ / (jiffies - tape->insert_time);
 	calculate_speeds(drive);
 	if (tape->onstream && tape->max_frames &&
-	    (((rq->flags & REQ_IDETAPE_WRITE) &&
+	    (((rq->cmd[0] & REQ_IDETAPE_WRITE) &&
               ( tape->cur_frames == tape->max_frames ||
                 ( tape->speed_control && tape->cur_frames > 5 &&
                        (tape->insert_speed > tape->max_insert_speed ||
                         (0 /* tape->cur_frames > 30 && tape->tape_still_time > 200 */) ) ) ) ) ||
-	     ((rq->flags & REQ_IDETAPE_READ) &&
+	     ((rq->cmd[0] & REQ_IDETAPE_READ) &&
 	      ( tape->cur_frames == 0 ||
 		( tape->speed_control && (tape->cur_frames < tape->max_frames - 5) &&
 			tape->insert_speed > tape->max_insert_speed ) ) && rq->nr_sectors) ) ) {
@@ -2819,7 +2829,7 @@
 		if (tape->debug_level >= 4)
 			printk(KERN_INFO "ide-tape: postponing request, "
 					"cmd %ld, cur %d, max %d\n",
-				rq->flags, tape->cur_frames, tape->max_frames);
+				rq->cmd[0], tape->cur_frames, tape->max_frames);
 #endif
 		if (tape->postpone_cnt++ < 500) {
 			status.b.dsc = 0;
@@ -2840,7 +2850,7 @@
 		} else if ((signed long) (jiffies - tape->dsc_timeout) > 0) {
 			printk(KERN_ERR "ide-tape: %s: DSC timeout\n",
 				tape->name);
-			if (rq->flags & REQ_IDETAPE_PC2) {
+			if (rq->cmd[0] & REQ_IDETAPE_PC2) {
 				idetape_media_access_finished(drive);
 				return ide_stopped;
 			} else {
@@ -2851,7 +2861,7 @@
 		idetape_postpone_request(drive);
 		return ide_stopped;
 	}
-	if (rq->flags & REQ_IDETAPE_READ) {
+	if (rq->cmd[0] & REQ_IDETAPE_READ) {
 		tape->buffer_head++;
 #if USE_IOTRACE
 		IO_trace(IO_IDETAPE_FIFO, tape->pipeline_head, tape->buffer_head, tape->tape_head, tape->minor);
@@ -2868,7 +2878,7 @@
 		idetape_create_read_cmd(tape, pc, rq->current_nr_sectors, (struct idetape_bh *)rq->special);
 		goto out;
 	}
-	if (rq->flags & REQ_IDETAPE_WRITE) {
+	if (rq->cmd[0] & REQ_IDETAPE_WRITE) {
 		tape->buffer_head++;
 #if USE_IOTRACE
 		IO_trace(IO_IDETAPE_FIFO, tape->pipeline_head, tape->buffer_head, tape->tape_head, tape->minor);
@@ -2886,19 +2896,19 @@
 		idetape_create_write_cmd(tape, pc, rq->current_nr_sectors, (struct idetape_bh *)rq->special);
 		goto out;
 	}
-	if (rq->flags & REQ_IDETAPE_READ_BUFFER) {
+	if (rq->cmd[0] & REQ_IDETAPE_READ_BUFFER) {
 		tape->postpone_cnt = 0;
 		pc = idetape_next_pc_storage(drive);
 		idetape_create_read_buffer_cmd(tape, pc, rq->current_nr_sectors, (struct idetape_bh *)rq->special);
 		goto out;
 	}
-	if (rq->flags & REQ_IDETAPE_PC1) {
+	if (rq->cmd[0] & REQ_IDETAPE_PC1) {
 		pc = (idetape_pc_t *) rq->buffer;
-		rq->flags &= ~(REQ_IDETAPE_PC1);
-		rq->flags |= REQ_IDETAPE_PC2;
+		rq->cmd[0] &= ~(REQ_IDETAPE_PC1);
+		rq->cmd[0] |= REQ_IDETAPE_PC2;
 		goto out;
 	}
-	if (rq->flags & REQ_IDETAPE_PC2) {
+	if (rq->cmd[0] & REQ_IDETAPE_PC2) {
 		idetape_media_access_finished(drive);
 		return ide_stopped;
 	}
@@ -3195,7 +3205,7 @@
 	idetape_tape_t *tape = drive->driver_data;
 
 #if IDETAPE_DEBUG_BUGS
-	if (rq == NULL || !idetape_request(rq)) {
+	if (rq == NULL || (rq->flags & REQ_SPECIAL) == 0) {
 		printk (KERN_ERR "ide-tape: bug: Trying to sleep on non-valid request\n");
 		return;
 	}
@@ -3301,8 +3311,7 @@
 {
 	struct request rq;
 
-	memset(&rq, 0, sizeof(rq));
-	rq.flags = REQ_IDETAPE_PC1;
+	idetape_init_rq(&rq, REQ_IDETAPE_PC1);
 	rq.buffer = (char *) pc;
 	return ide_do_drive_cmd(drive, &rq, ide_wait);
 }
@@ -3571,8 +3580,7 @@
 	}
 #endif /* IDETAPE_DEBUG_BUGS */	
 
-	memset(&rq, 0, sizeof(rq));
-	rq.flags = cmd;
+	idetape_init_rq(&rq, cmd);
 	rq.special = (void *)bh;
 	rq.sector = tape->first_frame_position;
 	rq.nr_sectors = rq.current_nr_sectors = blocks;
@@ -3621,8 +3629,7 @@
 			printk(KERN_INFO "ide-tape: %s: read back logical block %d, data %x %x %x %x\n", tape->name, logical_blk_num, *p++, *p++, *p++, *p++);
 #endif
 		rq = &stage->rq;
-		memset(rq, 0, sizeof(*rq));
-		rq->flags = REQ_IDETAPE_WRITE;
+		idetape_init_rq(rq, REQ_IDETAPE_WRITE);
 		rq->sector = tape->first_frame_position;
 		rq->nr_sectors = rq->current_nr_sectors = tape->capabilities.ctl;
 		idetape_init_stage(drive, stage, OS_FRAME_TYPE_DATA, logical_blk_num++);
@@ -3896,8 +3903,7 @@
 		}
 	}
 	rq = &new_stage->rq;
-	memset(rq, 0, sizeof(*rq));
-	rq->flags = REQ_IDETAPE_WRITE;
+	idetape_init_rq(rq, REQ_IDETAPE_WRITE);
 	/* Doesn't actually matter - We always assume sequential access */
 	rq->sector = tape->first_frame_position;
 	rq->nr_sectors = rq->current_nr_sectors = blocks;
@@ -4099,8 +4105,7 @@
 	}
 	if (tape->restart_speed_control_req)
 		idetape_restart_speed_control(drive);
-	memset(&rq, 0, sizeof(rq));
-	rq.flags = REQ_IDETAPE_READ;
+	idetape_init_rq(&rq, REQ_IDETAPE_READ);
 	rq.sector = tape->first_frame_position;
 	rq.nr_sectors = rq.current_nr_sectors = blocks;
 	if (!test_bit(IDETAPE_PIPELINE_ERROR, &tape->flags) &&
diff -Nru a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
--- a/drivers/ide/pci/cmd640.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/ide/pci/cmd640.c	Wed Jan  7 22:12:57 2004
@@ -213,13 +213,13 @@
 
 static void put_cmd640_reg_pci1 (u16 reg, u8 val)
 {
-	outb_p((reg & 0xfc) | cmd640_key, 0xcf8);
+	outl_p((reg & 0xfc) | cmd640_key, 0xcf8);
 	outb_p(val, (reg & 3) | 0xcfc);
 }
 
 static u8 get_cmd640_reg_pci1 (u16 reg)
 {
-	outb_p((reg & 0xfc) | cmd640_key, 0xcf8);
+	outl_p((reg & 0xfc) | cmd640_key, 0xcf8);
 	return inb_p((reg & 3) | 0xcfc);
 }
 
diff -Nru a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig
--- a/drivers/media/dvb/frontends/Kconfig	Wed Jan  7 22:12:57 2004
+++ b/drivers/media/dvb/frontends/Kconfig	Wed Jan  7 22:12:57 2004
@@ -37,6 +37,23 @@
  	  DVB adapter simply enable all supported frontends, the
  	  right one will get autodetected.
 
+
+config DVB_SP887X_FIRMWARE_FILE
+        string "Full pathname of sp887x firmware file"
+        depends on DVB_SP887X
+        default "/usr/lib/hotplug/firmware/sc_main.mc"
+        help
+          This driver needs a copy of the Avermedia firmware. The version tested
+	  is part of the Avermedia DVB-T 1.3.26.3 Application. This can be downloaded
+	  from the Avermedia web site.
+	  If the software is installed in Windows the file will be in the
+	  /Program Files/AVerTV DVB-T/ directory and is called sc_main.mc.
+	  Alternatively it can "extracted" from the install cab files but this will have
+	  to be done in windows as I don't know of a linux version of extract.exe.
+	  Copy this file to /usr/lib/hotplug/firmware/sc_main.mc.
+	  With this version of the file the first 10 bytes are discarded and the next
+	  0x4000 loaded. This may change in future versions.
+
 config DVB_ALPS_TDLB7
 	tristate "Alps TDLB7 (OFDM)"
 	depends on DVB_CORE
@@ -149,26 +166,10 @@
 config DVB_TDA1004X_FIRMWARE_FILE
         string "Full pathname of tda1004x.bin firmware file"
         depends on DVB_TDA1004X
-        default "/etc/dvb/tda1004x.bin"
+        default "/usr/lib/hotplug/firmware/tda1004x.bin"
         help
           The TDA1004X requires additional firmware in order to function.
           The firmware file can obtained as follows:
             wget http://www.technotrend.de/new/215/TTweb_215a_budget_20_05_2003.zip
             unzip -j TTweb_215a_budget_20_05_2003.zip Software/Oem/PCI/App/ttlcdacc.dll
-            mv ttlcdacc.dll /etc/dvb/tda1004x.bin
-
-config DVB_SP887X_FIRMWARE_FILE
-        string "Full pathname of sp887x firmware file"
-        depends on DVB_SP887X
-        default "/etc/dvb/sc_main.mc"
-        help
-          This driver needs a copy of the Avermedia firmware. The version tested
-	  is part of the Avermedia DVB-T 1.3.26.3 Application. This can be downloaded
-	  from the Avermedia web site.
-	  If the software is installed in Windows the file will be in the
-	  /Program Files/AVerTV DVB-T/ directory and is called sc_main.mc.
-	  Alternatively it can "extracted" from the install cab files but this will have
-	  to be done in windows as I don't know of a linux version of extract.exe.
-	  Copy this file to /etc/dvb/sc_main.mc. With this version of the file the first
-	  10 bytes are discarded and the next 0x4000 loaded. This may change in future
-	  versions.
+            mv ttlcdacc.dll /usr/lib/hotplug/firmware/tda1004x.bin
diff -Nru a/drivers/media/dvb/frontends/sp887x.c b/drivers/media/dvb/frontends/sp887x.c
--- a/drivers/media/dvb/frontends/sp887x.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/media/dvb/frontends/sp887x.c	Wed Jan  7 22:12:57 2004
@@ -7,7 +7,7 @@
    is part of the Avermedia DVB-T 1.3.26.3 Application. If the software is
    installed in Windows the file will be in the /Program Files/AVerTV DVB-T/
    directory and is called sc_main.mc. Alternatively it can "extracted" from
-   the install cab files. Copy this file to /etc/dvb/sc_main.mc.
+   the install cab files. Copy this file to '/usr/lib/hotplug/firmware/sc_main.mc'.
    With this version of the file the first 10 bytes are discarded and the
    next 0x4000 loaded. This may change in future versions.
  */
@@ -30,7 +30,7 @@
 #include "dvb_functions.h"
 
 #ifndef DVB_SP887X_FIRMWARE_FILE
-#define DVB_SP887X_FIRMWARE_FILE "/etc/dvb/sc_main.mc"
+#define DVB_SP887X_FIRMWARE_FILE "/usr/lib/hotplug/firmware/sc_main.mc"
 #endif
 
 static char *sp887x_firmware = DVB_SP887X_FIRMWARE_FILE;
diff -Nru a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c
--- a/drivers/media/dvb/frontends/tda1004x.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/media/dvb/frontends/tda1004x.c	Wed Jan  7 22:12:57 2004
@@ -20,7 +20,7 @@
 
 /*
     This driver needs a copy of the DLL "ttlcdacc.dll" from the Haupauge or Technotrend
-    windows driver saved as '/etc/dvb/tda1004x.mc'.
+    windows driver saved as '/usr/lib/hotplug/firmware/tda1004x.mc'.
     You can also pass the complete file name with the module parameter 'tda1004x_firmware'.
 
     Currently the DLL from v2.15a of the technotrend driver is supported. Other versions can
@@ -45,7 +45,7 @@
 #include "dvb_functions.h"
 
 #ifndef DVB_TDA1004X_FIRMWARE_FILE
-#define DVB_TDA1004X_FIRMWARE_FILE "/etc/dvb/tda1004x.mc"
+#define DVB_TDA1004X_FIRMWARE_FILE "/usr/lib/hotplug/firmware/tda1004x.mc"
 #endif
 
 static int tda1004x_debug = 0;
diff -Nru a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig
--- a/drivers/media/dvb/ttpci/Kconfig	Wed Jan  7 22:12:57 2004
+++ b/drivers/media/dvb/ttpci/Kconfig	Wed Jan  7 22:12:57 2004
@@ -15,7 +15,7 @@
 
 config DVB_AV7110_FIRMWARE
 	bool "Compile AV7110 firmware into the driver"
-	depends on DVB_AV7110
+	depends on DVB_AV7110 && !STANDALONE
 	help
 	  The AV7110 firmware is normally loaded by the firmware hotplug manager.
 	  If you want to compile the firmware into the driver you need to say
@@ -89,8 +89,7 @@
 config DVB_BUDGET_PATCH
 	tristate "AV7110 cards with Budget Patch"
 	depends on DVB_BUDGET
-	select VIDEO_DEV
-	select VIDEO_SAA7146_VV
+	select DVB_AV7110
 	help
 	  Support for Budget Patch (full TS) modification on 
 	  SAA7146+AV7110 based cards (DVB-S cards). This
diff -Nru a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
--- a/drivers/media/dvb/ttpci/av7110.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/media/dvb/ttpci/av7110.c	Wed Jan  7 22:12:57 2004
@@ -2673,9 +2673,9 @@
 	buf[1] = div & 0xff;
 	buf[2] = 0x8e;
 
-	if (freq < (u32) 16*168.25 )
+	if (freq < (u32) (16*168.25) )
 		config = 0xa0;
-	else if (freq < (u32) 16*447.25)
+	else if (freq < (u32) (16*447.25) )
 		config = 0x90;
 	else
 		config = 0x30;
diff -Nru a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
--- a/drivers/mtd/chips/jedec_probe.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/mtd/chips/jedec_probe.c	Wed Jan  7 22:12:57 2004
@@ -16,6 +16,7 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/init.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
diff -Nru a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c
--- a/drivers/mtd/maps/sun_uflash.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/mtd/maps/sun_uflash.c	Wed Jan  7 22:12:57 2004
@@ -95,8 +95,8 @@
 	if(0 != pdev->name && 0 < strlen(pdev->name)) {
 		pdev->map.name = pdev->name;
 	}
-	pdev->phys = edev->resource[0].start;
-	pdev->virt = 
+	pdev->map.phys = edev->resource[0].start;
+	pdev->map.virt = 
 		(unsigned long)ioremap_nocache(edev->resource[0].start, pdev->map.size);
 	if(0 == pdev->map.virt) {
 		printk("%s: failed to map device\n", __FUNCTION__);
diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c
--- a/drivers/net/Space.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/net/Space.c	Wed Jan  7 22:12:57 2004
@@ -350,7 +350,7 @@
 	 * Backwards compatibility - historically an I/O base of 1 was 
 	 * used to indicate not to probe for this ethN interface 
 	 */
-	if (dev->base_addr == 1) {
+	if (__dev_get_by_name(dev->name) || dev->base_addr == 1) {
 		free_netdev(dev);
 		return -ENXIO;
 	}
diff -Nru a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c
--- a/drivers/parport/parport_sunbpp.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/parport/parport_sunbpp.c	Wed Jan  7 22:12:57 2004
@@ -397,3 +397,5 @@
 	}
 }
 #endif
+
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
--- a/drivers/pnp/pnpbios/bioscalls.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/pnp/pnpbios/bioscalls.c	Wed Jan  7 22:12:57 2004
@@ -493,7 +493,7 @@
 	if (!pnp_bios_present())
 		return ESCD_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_READ_ESCD, 0, PNP_TS1, PNP_TS2, PNP_DS, 0, 0, 0,
-			       data, 65536, (void *)nvram_base, 65536);
+			       data, 65536, __va(nvram_base), 65536);
 	return status;
 }
 
@@ -516,7 +516,7 @@
 	if (!pnp_bios_present())
 		return ESCD_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_WRITE_ESCD, 0, PNP_TS1, PNP_TS2, PNP_DS, 0, 0, 0,
-			       data, 65536, nvram_base, 65536);
+			       data, 65536, __va(nvram_base), 65536);
 	return status;
 }
 #endif
diff -Nru a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c
--- a/drivers/sbus/char/bpp.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/sbus/char/bpp.c	Wed Jan  7 22:12:57 2004
@@ -1074,3 +1074,6 @@
 
 module_init(bpp_init);
 module_exit(bpp_cleanup);
+
+MODULE_LICENSE("GPL");
+
diff -Nru a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c
--- a/drivers/sbus/char/vfc_dev.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/sbus/char/vfc_dev.c	Wed Jan  7 22:12:57 2004
@@ -737,4 +737,5 @@
 }
 #endif
 
+MODULE_LICENSE("GPL");
 
diff -Nru a/drivers/scsi/esp.c b/drivers/scsi/esp.c
--- a/drivers/scsi/esp.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/scsi/esp.c	Wed Jan  7 22:12:57 2004
@@ -4394,3 +4394,6 @@
 };
 
 #include "scsi_module.c"
+
+MODULE_LICENSE("GPL");
+
diff -Nru a/drivers/scsi/fcal.c b/drivers/scsi/fcal.c
--- a/drivers/scsi/fcal.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/scsi/fcal.c	Wed Jan  7 22:12:57 2004
@@ -316,3 +316,5 @@
 };
 #include "scsi_module.c"
 
+MODULE_LICENSE("GPL");
+
diff -Nru a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c
--- a/drivers/scsi/pluto.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/scsi/pluto.c	Wed Jan  7 22:12:57 2004
@@ -360,3 +360,5 @@
 
 #include "scsi_module.c"
 
+MODULE_LICENSE("GPL");
+
diff -Nru a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
--- a/drivers/scsi/qlogicpti.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/scsi/qlogicpti.c	Wed Jan  7 22:12:57 2004
@@ -1554,3 +1554,6 @@
 
 
 #include "scsi_module.c"
+
+MODULE_LICENSE("GPL");
+
diff -Nru a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
--- a/drivers/serial/sunzilog.c	Wed Jan  7 22:12:57 2004
+++ b/drivers/serial/sunzilog.c	Wed Jan  7 22:12:57 2004
@@ -1631,6 +1631,8 @@
 {
 	struct zs_probe_scan scan;
 	int ret;
+	int uart_count;
+	int i;
 
 	printk(KERN_DEBUG "SunZilog: %d chips.\n", NUM_SUNZILOG);
 
@@ -1650,18 +1652,27 @@
 	sunzilog_init_hw();
 
 	/* We can only init this once we have probed the Zilogs
-	 * in the system.
+	 * in the system. Do not count channels assigned to keyboards
+	 * or mice when we are deciding how many ports to register.
 	 */
-	sunzilog_reg.nr = NUM_CHANNELS;
+	uart_count = 0;
+	for (i = 0; i < NUM_CHANNELS; i++) {
+		struct uart_sunzilog_port *up = &sunzilog_port_table[i];
+
+		if (ZS_IS_KEYB(up) || ZS_IS_MOUSE(up))
+			continue;
+
+		uart_count++;
+	}
+		
+	sunzilog_reg.nr = uart_count;
 	sunzilog_reg.cons = SUNZILOG_CONSOLE;
 
 	sunzilog_reg.minor = sunserial_current_minor;
-	sunserial_current_minor += NUM_CHANNELS;
+	sunserial_current_minor += uart_count;
 
 	ret = uart_register_driver(&sunzilog_reg);
 	if (ret == 0) {
-		int i;
-
 		for (i = 0; i < NUM_CHANNELS; i++) {
 			struct uart_sunzilog_port *up = &sunzilog_port_table[i];
 
diff -Nru a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
--- a/fs/jfs/jfs_imap.c	Wed Jan  7 22:12:57 2004
+++ b/fs/jfs/jfs_imap.c	Wed Jan  7 22:12:57 2004
@@ -481,7 +481,6 @@
 	/* read the page of fixed disk inode (AIT) in raw mode */
 	mp = read_metapage(ip, address << sbi->l2nbperpage, PSIZE, 1);
 	if (mp == NULL) {
-		ip->i_sb = NULL;
 		ip->i_nlink = 1;	/* Don't want iput() deleting it */
 		iput(ip);
 		return (NULL);
@@ -494,7 +493,6 @@
 	/* copy on-disk inode to in-memory inode */
 	if ((copy_from_dinode(dp, ip)) != 0) {
 		/* handle bad return by returning NULL for ip */
-		ip->i_sb = NULL;
 		ip->i_nlink = 1;	/* Don't want iput() deleting it */
 		iput(ip);
 		/* release the page */
diff -Nru a/fs/jfs/namei.c b/fs/jfs/namei.c
--- a/fs/jfs/namei.c	Wed Jan  7 22:12:57 2004
+++ b/fs/jfs/namei.c	Wed Jan  7 22:12:57 2004
@@ -1439,14 +1439,18 @@
 struct dentry *jfs_get_parent(struct dentry *dentry)
 {
 	struct super_block *sb = dentry->d_inode->i_sb;
-	struct dentry *parent = ERR_PTR(-EACCES);
+	struct dentry *parent = ERR_PTR(-ENOENT);
 	struct inode *inode;
+	unsigned long parent_ino;
 
-	inode = iget(sb, JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot);
+	parent_ino =
+		le32_to_cpu(JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot);
+	inode = iget(sb, parent_ino);
 	if (inode) {
-		if (is_bad_inode(inode))
+		if (is_bad_inode(inode)) {
 			iput(inode);
-		else {
+			parent = ERR_PTR(-EACCES);
+		} else {
 			parent = d_alloc_anon(inode);
 			if (!parent) {
 				parent = ERR_PTR(-ENOMEM);
diff -Nru a/fs/sysfs/dir.c b/fs/sysfs/dir.c
--- a/fs/sysfs/dir.c	Wed Jan  7 22:12:57 2004
+++ b/fs/sysfs/dir.c	Wed Jan  7 22:12:57 2004
@@ -83,7 +83,8 @@
 	struct dentry * parent = dget(d->d_parent);
 	down(&parent->d_inode->i_sem);
 	d_delete(d);
-	simple_rmdir(parent->d_inode,d);
+	if (d->d_inode)
+		simple_rmdir(parent->d_inode,d);
 
 	pr_debug(" o %s removing done (%d)\n",d->d_name.name,
 		 atomic_read(&d->d_count));
diff -Nru a/include/asm-i386/mach-pc9800/irq_vectors.h b/include/asm-i386/mach-pc9800/irq_vectors.h
--- a/include/asm-i386/mach-pc9800/irq_vectors.h	Wed Jan  7 22:12:57 2004
+++ b/include/asm-i386/mach-pc9800/irq_vectors.h	Wed Jan  7 22:12:57 2004
@@ -85,6 +85,7 @@
 #define NR_IRQS 16
 #endif
 
+#define NR_VECTORS 256
 #define NR_IRQ_VECTORS NR_IRQS
 
 #define FPU_IRQ			8
diff -Nru a/include/asm-i386/mach-visws/irq_vectors.h b/include/asm-i386/mach-visws/irq_vectors.h
--- a/include/asm-i386/mach-visws/irq_vectors.h	Wed Jan  7 22:12:57 2004
+++ b/include/asm-i386/mach-visws/irq_vectors.h	Wed Jan  7 22:12:57 2004
@@ -47,8 +47,9 @@
 #define TIMER_IRQ 0
 
 /*
- * 
+ * IRQ definitions
  */
+#define NR_VECTORS 256
 #define NR_IRQS 224
 #define NR_IRQ_VECTORS NR_IRQS
 
diff -Nru a/include/asm-sparc/fixmap.h b/include/asm-sparc/fixmap.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sparc/fixmap.h	Wed Jan  7 22:12:57 2004
@@ -0,0 +1,111 @@
+/*
+ * fixmap.h: compile-time virtual memory allocation
+ *
+ * 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.
+ *
+ * Copyright (C) 1998 Ingo Molnar
+ *
+ * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
+ */
+
+#ifndef _ASM_FIXMAP_H
+#define _ASM_FIXMAP_H
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <asm/page.h>
+#ifdef CONFIG_HIGHMEM
+#include <linux/threads.h>
+#include <asm/kmap_types.h>
+#endif
+
+/*
+ * Here we define all the compile-time 'special' virtual
+ * addresses. The point is to have a constant address at
+ * compile time, but to set the physical address only
+ * in the boot process. We allocate these special  addresses
+ * from the top of unused virtual memory (0xfd000000 - 1 page) backwards.
+ * Also this lets us do fail-safe vmalloc(), we
+ * can guarantee that these special addresses and
+ * vmalloc()-ed addresses never overlap.
+ *
+ * these 'compile-time allocated' memory buffers are
+ * fixed-size 4k pages. (or larger if used with an increment
+ * highger than 1) use fixmap_set(idx,phys) to associate
+ * physical memory with fixmap indices.
+ *
+ * TLB entries of such buffers will not be flushed across
+ * task switches.
+ */
+
+/*
+ * on UP currently we will have no trace of the fixmap mechanism,
+ * no page table allocations, etc. This might change in the
+ * future, say framebuffers for the console driver(s) could be
+ * fix-mapped?
+ */
+enum fixed_addresses {
+	FIX_HOLE,
+#ifdef CONFIG_HIGHMEM
+	FIX_KMAP_BEGIN,
+	FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
+#endif
+	__end_of_fixed_addresses
+};
+
+extern void __set_fixmap (enum fixed_addresses idx,
+					unsigned long phys, pgprot_t flags);
+
+#define set_fixmap(idx, phys) \
+		__set_fixmap(idx, phys, PAGE_KERNEL)
+/*
+ * Some hardware wants to get fixmapped without caching.
+ */
+#define set_fixmap_nocache(idx, phys) \
+		__set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
+/*
+ * used by vmalloc.c.
+ *
+ * Leave one empty page between IO pages at 0xfd000000 and
+ * the start of the fixmap.
+ */
+#define FIXADDR_TOP	(0xfcfff000UL)
+#define FIXADDR_SIZE	((__end_of_fixed_addresses) << PAGE_SHIFT)
+#define FIXADDR_START	(FIXADDR_TOP - FIXADDR_SIZE)
+
+#define __fix_to_virt(x)	(FIXADDR_TOP - ((x) << PAGE_SHIFT))
+#define __virt_to_fix(x)	((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
+
+extern void __this_fixmap_does_not_exist(void);
+
+/*
+ * 'index to address' translation. If anyone tries to use the idx
+ * directly without tranlation, we catch the bug with a NULL-deference
+ * kernel oops. Illegal ranges of incoming indices are caught too.
+ */
+static inline unsigned long fix_to_virt(const unsigned int idx)
+{
+	/*
+	 * this branch gets completely eliminated after inlining,
+	 * except when someone tries to use fixaddr indices in an
+	 * illegal way. (such as mixing up address types or using
+	 * out-of-range indices).
+	 *
+	 * If it doesn't get removed, the linker will complain
+	 * loudly with a reasonably clear error message..
+	 */
+	if (idx >= __end_of_fixed_addresses)
+		__this_fixmap_does_not_exist();
+
+        return __fix_to_virt(idx);
+}
+
+static inline unsigned long virt_to_fix(const unsigned long vaddr)
+{
+	BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
+	return __virt_to_fix(vaddr);
+}
+
+#endif
diff -Nru a/include/asm-sparc/highmem.h b/include/asm-sparc/highmem.h
--- a/include/asm-sparc/highmem.h	Wed Jan  7 22:12:57 2004
+++ b/include/asm-sparc/highmem.h	Wed Jan  7 22:12:57 2004
@@ -21,10 +21,10 @@
 #ifdef __KERNEL__
 
 #include <linux/interrupt.h>
+#include <asm/fixmap.h>
+#include <asm/vaddrs.h>
 #include <asm/kmap_types.h>
-
-/* undef for production */
-#define HIGHMEM_DEBUG 1
+#include <asm/pgtsrmmu.h>
 
 /* declarations for highmem.c */
 extern unsigned long highstart_pfn, highend_pfn;
@@ -33,12 +33,6 @@
 extern pgprot_t kmap_prot;
 extern pte_t *pkmap_page_table;
 
-/* This gets set in {srmmu,sun4c}_paging_init() */
-extern unsigned long fix_kmap_begin;
-
-/* Only used and set with srmmu? */
-extern unsigned long pkmap_base;
-
 extern void kmap_init(void) __init;
 
 /*
@@ -46,19 +40,21 @@
  * easily, subsequent pte tables have to be allocated in one physical
  * chunk of RAM.
  */
+#define PKMAP_BASE (SRMMU_NOCACHE_VADDR + (SRMMU_MAX_NOCACHE_PAGES << PAGE_SHIFT))
 #define LAST_PKMAP 1024
 
 #define LAST_PKMAP_MASK (LAST_PKMAP - 1)
-#define PKMAP_NR(virt)  ((virt - pkmap_base) >> PAGE_SHIFT)
-#define PKMAP_ADDR(nr)  (pkmap_base + ((nr) << PAGE_SHIFT))
+#define PKMAP_NR(virt)  ((virt - PKMAP_BASE) >> PAGE_SHIFT)
+#define PKMAP_ADDR(nr)  (PKMAP_BASE + ((nr) << PAGE_SHIFT))
+
+#define PKMAP_END (PKMAP_ADDR(LAST_PKMAP))
 
 extern void *kmap_high(struct page *page);
 extern void kunmap_high(struct page *page);
 
 static inline void *kmap(struct page *page)
 {
-	if (in_interrupt())
-		BUG();
+	BUG_ON(in_interrupt());
 	if (page < highmem_start_page)
 		return page_address(page);
 	return kmap_high(page);
@@ -66,8 +62,7 @@
 
 static inline void kunmap(struct page *page)
 {
-	if (in_interrupt())
-		BUG();
+	BUG_ON(in_interrupt());
 	if (page < highmem_start_page)
 		return;
 	kunmap_high(page);
@@ -75,19 +70,7 @@
 
 extern void *kmap_atomic(struct page *page, enum km_type type);
 extern void kunmap_atomic(void *kvaddr, enum km_type type);
-
-static inline struct page *kmap_atomic_to_page(void *ptr)
-{
-	unsigned long idx, vaddr = (unsigned long)ptr;
-	pte_t *pte;
-
-	if (vaddr < fix_kmap_begin)
-		return virt_to_page(ptr);
-
-	idx = ((vaddr - fix_kmap_begin) >> PAGE_SHIFT);
-	pte = kmap_pte + idx;
-	return pte_page(*pte);
-}
+extern struct page *kmap_atomic_to_page(void *vaddr);
 
 #define flush_cache_kmaps()	flush_cache_all()
 
diff -Nru a/include/asm-sparc/kmap_types.h b/include/asm-sparc/kmap_types.h
--- a/include/asm-sparc/kmap_types.h	Wed Jan  7 22:12:57 2004
+++ b/include/asm-sparc/kmap_types.h	Wed Jan  7 22:12:57 2004
@@ -11,6 +11,7 @@
 	KM_BIO_DST_IRQ,
 	KM_PTE0,
 	KM_PTE1,
+	KM_PTE2,
 	KM_IRQ0,
 	KM_IRQ1,
 	KM_SOFTIRQ0,
diff -Nru a/include/asm-sparc/page.h b/include/asm-sparc/page.h
--- a/include/asm-sparc/page.h	Wed Jan  7 22:12:57 2004
+++ b/include/asm-sparc/page.h	Wed Jan  7 22:12:57 2004
@@ -54,7 +54,7 @@
 
 #define SPARC_PHYS_BANKS 32
 
-extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
+extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS+1];
 
 /* Cache alias structure.  Entry is valid if context != -1. */
 struct cache_palias {
diff -Nru a/include/asm-sparc/pgtsrmmu.h b/include/asm-sparc/pgtsrmmu.h
--- a/include/asm-sparc/pgtsrmmu.h	Wed Jan  7 22:12:57 2004
+++ b/include/asm-sparc/pgtsrmmu.h	Wed Jan  7 22:12:57 2004
@@ -109,6 +109,13 @@
 
 #ifndef __ASSEMBLY__
 
+/* This makes sense. Honest it does - Anton */
+/* XXX Yes but it's ugly as sin.  FIXME. -KMW */
+extern void *srmmu_nocache_pool;
+#define __nocache_pa(VADDR) (((unsigned long)VADDR) - SRMMU_NOCACHE_VADDR + __pa((unsigned long)srmmu_nocache_pool))
+#define __nocache_va(PADDR) (__va((unsigned long)PADDR) - (unsigned long)srmmu_nocache_pool + SRMMU_NOCACHE_VADDR)
+#define __nocache_fix(VADDR) __va(__nocache_pa(VADDR))
+
 /* Accessing the MMU control register. */
 extern __inline__ unsigned int srmmu_get_mmureg(void)
 {
diff -Nru a/include/asm-sparc/setup.h b/include/asm-sparc/setup.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sparc/setup.h	Wed Jan  7 22:12:57 2004
@@ -0,0 +1,9 @@
+/*
+ *	Just a place holder. 
+ */
+
+#ifndef _SPARC_SETUP_H
+#define _SPARC_SETUP_H
+
+
+#endif /* _SPARC_SETUP_H */
diff -Nru a/include/asm-sparc/vaddrs.h b/include/asm-sparc/vaddrs.h
--- a/include/asm-sparc/vaddrs.h	Wed Jan  7 22:12:57 2004
+++ b/include/asm-sparc/vaddrs.h	Wed Jan  7 22:12:57 2004
@@ -16,6 +16,9 @@
 
 #define SRMMU_NOCACHE_VADDR	(KERNBASE + SRMMU_MAXMEM)
 				/* = 0x0fc000000 */
+/* XXX Empiricals - this needs to go away - KMW */
+#define SRMMU_MIN_NOCACHE_PAGES (550)
+#define SRMMU_MAX_NOCACHE_PAGES	(1280)
 
 /* The following constant is used in mm/srmmu.c::srmmu_nocache_calcsize()
  * to determine the amount of memory that will be reserved as nocache:
diff -Nru a/include/asm-sparc64/setup.h b/include/asm-sparc64/setup.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-sparc64/setup.h	Wed Jan  7 22:12:57 2004
@@ -0,0 +1,9 @@
+/*
+ *	Just a place holder. 
+ */
+
+#ifndef _SPARC64_SETUP_H
+#define _SPARC64_SETUP_H
+
+
+#endif /* _SPARC64_SETUP_H */
diff -Nru a/include/linux/blkdev.h b/include/linux/blkdev.h
--- a/include/linux/blkdev.h	Wed Jan  7 22:12:57 2004
+++ b/include/linux/blkdev.h	Wed Jan  7 22:12:57 2004
@@ -195,11 +195,6 @@
 	__REQ_PM_SUSPEND,	/* suspend request */
 	__REQ_PM_RESUME,	/* resume request */
 	__REQ_PM_SHUTDOWN,	/* shutdown request */
-	__REQ_IDETAPE_PC1,	/* packet command (first stage) */
-	__REQ_IDETAPE_PC2,	/* packet command (second stage) */
-	__REQ_IDETAPE_READ,
-	__REQ_IDETAPE_WRITE,
-	__REQ_IDETAPE_READ_BUFFER,
 	__REQ_NR_BITS,		/* stops here */
 };
 
@@ -225,11 +220,6 @@
 #define REQ_PM_SUSPEND	(1 << __REQ_PM_SUSPEND)
 #define REQ_PM_RESUME	(1 << __REQ_PM_RESUME)
 #define REQ_PM_SHUTDOWN	(1 << __REQ_PM_SHUTDOWN)
-#define REQ_IDETAPE_PC1 (1 << __REQ_IDETAPE_PC1)
-#define REQ_IDETAPE_PC2 (1 << __REQ_IDETAPE_PC2)
-#define REQ_IDETAPE_READ	(1 << __REQ_IDETAPE_READ)
-#define REQ_IDETAPE_WRITE	(1 << __REQ_IDETAPE_WRITE)
-#define REQ_IDETAPE_READ_BUFFER	(1 << __REQ_IDETAPE_READ_BUFFER)
 
 /*
  * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME
diff -Nru a/include/linux/ide.h b/include/linux/ide.h
--- a/include/linux/ide.h	Wed Jan  7 22:12:57 2004
+++ b/include/linux/ide.h	Wed Jan  7 22:12:57 2004
@@ -51,9 +51,6 @@
 #ifndef SUPPORT_VLB_SYNC		/* 1 to support weird 32-bit chips */
 #define SUPPORT_VLB_SYNC	1	/* 0 to reduce kernel size */
 #endif
-#ifndef DISK_RECOVERY_TIME		/* off=0; on=access_delay_time */
-#define DISK_RECOVERY_TIME	0	/*  for hardware that needs it */
-#endif
 #ifndef OK_TO_RESET_CONTROLLER		/* 1 needed for good error recovery */
 #define OK_TO_RESET_CONTROLLER	1	/* 0 for use with AH2372A/B interface */
 #endif
@@ -999,10 +996,6 @@
 	unsigned	dma_extra;	/* extra addr for dma ports */
 	unsigned long	config_data;	/* for use by chipset-specific code */
 	unsigned long	select_data;	/* for use by chipset-specific code */
-#if (DISK_RECOVERY_TIME > 0)
-	unsigned long	last_time;	/* time when previous rq was done */
-#endif
-
 
 	unsigned	noprobe    : 1;	/* don't probe for this interface */
 	unsigned	present    : 1;	/* this interface exists */
diff -Nru a/include/linux/ip.h b/include/linux/ip.h
--- a/include/linux/ip.h	Wed Jan  7 22:12:57 2004
+++ b/include/linux/ip.h	Wed Jan  7 22:12:57 2004
@@ -159,7 +159,10 @@
 	struct inet_opt   inet;
 };
 
-#define inet_sk(__sk) (&((struct inet_sock *)__sk)->inet)
+static inline struct inet_opt * inet_sk(const struct sock *__sk)
+{
+	return &((struct inet_sock *)__sk)->inet;
+}
 
 #endif
 
diff -Nru a/include/linux/ipv6.h b/include/linux/ipv6.h
--- a/include/linux/ipv6.h	Wed Jan  7 22:12:57 2004
+++ b/include/linux/ipv6.h	Wed Jan  7 22:12:57 2004
@@ -270,8 +270,15 @@
 	struct ipv6_pinfo inet6;
 };
 
-#define inet6_sk(__sk) ((struct raw6_sock *)__sk)->pinet6
-#define raw6_sk(__sk) (&((struct raw6_sock *)__sk)->raw6)
+static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
+{
+	return ((struct raw6_sock *)__sk)->pinet6;
+}
+
+static inline struct raw6_opt * raw6_sk(const struct sock *__sk)
+{
+	return &((struct raw6_sock *)__sk)->raw6;
+}
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 #define __ipv6_only_sock(sk)	(inet6_sk(sk)->ipv6only)
diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h
--- a/include/linux/netdevice.h	Wed Jan  7 22:12:57 2004
+++ b/include/linux/netdevice.h	Wed Jan  7 22:12:57 2004
@@ -634,7 +634,7 @@
  */
 static inline void dev_kfree_skb_any(struct sk_buff *skb)
 {
-	if (in_irq())
+	if (in_irq() || irqs_disabled())
 		dev_kfree_skb_irq(skb);
 	else
 		dev_kfree_skb(skb);
diff -Nru a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
--- a/include/linux/netfilter_ipv4.h	Wed Jan  7 22:12:57 2004
+++ b/include/linux/netfilter_ipv4.h	Wed Jan  7 22:12:57 2004
@@ -51,6 +51,7 @@
 
 enum nf_ip_hook_priorities {
 	NF_IP_PRI_FIRST = INT_MIN,
+	NF_IP_PRI_SELINUX_FIRST = -225,
 	NF_IP_PRI_CONNTRACK = -200,
 	NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
 	NF_IP_PRI_MANGLE = -150,
@@ -58,6 +59,7 @@
 	NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50,
 	NF_IP_PRI_FILTER = 0,
 	NF_IP_PRI_NAT_SRC = 100,
+	NF_IP_PRI_SELINUX_LAST = 225,
 	NF_IP_PRI_LAST = INT_MAX,
 };
 
diff -Nru a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
--- a/include/linux/netfilter_ipv6.h	Wed Jan  7 22:12:57 2004
+++ b/include/linux/netfilter_ipv6.h	Wed Jan  7 22:12:57 2004
@@ -56,11 +56,13 @@
 
 enum nf_ip6_hook_priorities {
 	NF_IP6_PRI_FIRST = INT_MIN,
+	NF_IP6_PRI_SELINUX_FIRST = -225,
 	NF_IP6_PRI_CONNTRACK = -200,
 	NF_IP6_PRI_MANGLE = -150,
 	NF_IP6_PRI_NAT_DST = -100,
 	NF_IP6_PRI_FILTER = 0,
 	NF_IP6_PRI_NAT_SRC = 100,
+	NF_IP6_PRI_SELINUX_LAST = 225,
 	NF_IP6_PRI_LAST = INT_MAX,
 };
 
diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h	Wed Jan  7 22:12:57 2004
+++ b/include/linux/pci_ids.h	Wed Jan  7 22:12:57 2004
@@ -325,6 +325,7 @@
 /* RadeonIGP */
 #define PCI_DEVICE_ID_ATI_RS100		0xcab0
 #define PCI_DEVICE_ID_ATI_RS200		0xcab2
+#define PCI_DEVICE_ID_ATI_RS200_B	0xcbb3
 #define PCI_DEVICE_ID_ATI_RS250		0xcab3
 #define PCI_DEVICE_ID_ATI_RS300_100	0x5830
 #define PCI_DEVICE_ID_ATI_RS300_133	0x5831
diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h
--- a/include/linux/skbuff.h	Wed Jan  7 22:12:57 2004
+++ b/include/linux/skbuff.h	Wed Jan  7 22:12:57 2004
@@ -1132,7 +1132,7 @@
  *	is returned and the old skb data released.
  */
 extern int __skb_linearize(struct sk_buff *skb, int gfp);
-static inline int __deprecated skb_linearize(struct sk_buff *skb, int gfp)
+static inline int skb_linearize(struct sk_buff *skb, int gfp)
 {
 	return __skb_linearize(skb, gfp);
 }
diff -Nru a/include/linux/udp.h b/include/linux/udp.h
--- a/include/linux/udp.h	Wed Jan  7 22:12:57 2004
+++ b/include/linux/udp.h	Wed Jan  7 22:12:57 2004
@@ -60,7 +60,10 @@
 	struct udp_opt	  udp;
 };
 
-#define udp_sk(__sk) (&((struct udp_sock *)__sk)->udp)
+static inline struct udp_opt * udp_sk(const struct sock *__sk)
+{
+	return &((struct udp_sock *)__sk)->udp;
+}
 
 #endif
 
diff -Nru a/include/net/ipv6.h b/include/net/ipv6.h
--- a/include/net/ipv6.h	Wed Jan  7 22:12:57 2004
+++ b/include/net/ipv6.h	Wed Jan  7 22:12:57 2004
@@ -329,13 +329,6 @@
 					   struct in6_addr *daddr,
 					   int proto, int len);
 
-extern int			ip6_build_xmit(struct sock *sk,
-					       inet_getfrag_t getfrag,
-					       const void *data,
-					       struct flowi *fl,
-					       unsigned length,
-					       struct ipv6_txoptions *opt,
-					       int hlimit, int flags);
 extern int			ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr);
 
 extern int			ip6_append_data(struct sock *sk,
diff -Nru a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h
--- a/include/net/irda/ircomm_tty.h	Wed Jan  7 22:12:57 2004
+++ b/include/net/irda/ircomm_tty.h	Wed Jan  7 22:12:57 2004
@@ -52,6 +52,11 @@
 /* Same for payload size. See qos.c for the smallest max data size */
 #define IRCOMM_TTY_DATA_UNINITIALISED	(64 - IRCOMM_TTY_HDR_UNINITIALISED)
 
+/* Those are really defined in include/linux/serial.h - Jean II */
+#define ASYNC_B_INITIALIZED	31	/* Serial port was initialized */
+#define ASYNC_B_NORMAL_ACTIVE	29	/* Normal device is active */
+#define ASYNC_B_CLOSING		27	/* Serial port is closing */
+
 /*
  * IrCOMM TTY driver state
  */
@@ -75,7 +80,7 @@
 	LOCAL_FLOW flow;          /* IrTTP flow status */
 
 	int line;
-	__u32 flags;
+	volatile unsigned long flags;
 
 	__u8 dlsap_sel;
 	__u8 slsap_sel;
diff -Nru a/kernel/module.c b/kernel/module.c
--- a/kernel/module.c	Wed Jan  7 22:12:57 2004
+++ b/kernel/module.c	Wed Jan  7 22:12:57 2004
@@ -1618,6 +1618,16 @@
 	/* Now do relocations. */
 	for (i = 1; i < hdr->e_shnum; i++) {
 		const char *strtab = (char *)sechdrs[strindex].sh_addr;
+		unsigned int info = sechdrs[i].sh_info;
+
+		/* Not a valid relocation section? */
+		if (info >= hdr->e_shnum)
+			continue;
+
+		/* Don't bother with non-allocated sections */
+		if (!(sechdrs[info].sh_flags & SHF_ALLOC))
+			continue;
+
 		if (sechdrs[i].sh_type == SHT_REL)
 			err = apply_relocate(sechdrs, strtab, symindex, i,mod);
 		else if (sechdrs[i].sh_type == SHT_RELA)
diff -Nru a/mm/mremap.c b/mm/mremap.c
--- a/mm/mremap.c	Wed Jan  7 22:12:57 2004
+++ b/mm/mremap.c	Wed Jan  7 22:12:57 2004
@@ -316,7 +316,7 @@
 	new_len = PAGE_ALIGN(new_len);
 
 	/* Don't allow the degenerate cases */
-	if (!(old_len | new_len))
+	if (!old_len || !new_len)
 		goto out;
 
 	/* new_addr is only valid if MREMAP_FIXED is specified */
diff -Nru a/net/compat.c b/net/compat.c
--- a/net/compat.c	Wed Jan  7 22:12:57 2004
+++ b/net/compat.c	Wed Jan  7 22:12:57 2004
@@ -215,15 +215,25 @@
 
 int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *data)
 {
+	struct compat_timeval ctv;
 	struct compat_cmsghdr *cm = (struct compat_cmsghdr *) kmsg->msg_control;
 	struct compat_cmsghdr cmhdr;
-	int cmlen = CMSG_COMPAT_LEN(len);
+	int cmlen;
 
 	if(cm == NULL || kmsg->msg_controllen < sizeof(*cm)) {
 		kmsg->msg_flags |= MSG_CTRUNC;
 		return 0; /* XXX: return error? check spec. */
 	}
 
+	if (level == SOL_SOCKET && type == SO_TIMESTAMP) { 
+		struct timeval *tv = (struct timeval *)data;
+		ctv.tv_sec = tv->tv_sec;
+		ctv.tv_usec = tv->tv_usec;
+		data = &ctv;
+		len = sizeof(struct compat_timeval);
+	} 
+	
+	cmlen = CMSG_COMPAT_LEN(len);
 	if(kmsg->msg_controllen < cmlen) {
 		kmsg->msg_flags |= MSG_CTRUNC;
 		cmlen = kmsg->msg_controllen;
diff -Nru a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
--- a/net/decnet/af_decnet.c	Wed Jan  7 22:12:57 2004
+++ b/net/decnet/af_decnet.c	Wed Jan  7 22:12:57 2004
@@ -2376,17 +2376,17 @@
 
 	dn_register_sysctl();
 
-	/*
-	 * Prevent DECnet module unloading until its fixed properly.
-	 * Requires an audit of the code to check for memory leaks and
-	 * initialisation problems etc.
-	 */
-	try_module_get(THIS_MODULE);
-
 	return 0;
 
 }
+module_init(decnet_init);
 
+/*
+ * Prevent DECnet module unloading until its fixed properly.
+ * Requires an audit of the code to check for memory leaks and
+ * initialisation problems etc.
+ */
+#if 0
 static void __exit decnet_exit(void)
 {
 	sock_unregister(AF_DECnet);
@@ -2405,6 +2405,5 @@
 
 	kmem_cache_destroy(dn_sk_cachep);
 }
-
-module_init(decnet_init);
 module_exit(decnet_exit);
+#endif
diff -Nru a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
--- a/net/ipv6/addrconf.c	Wed Jan  7 22:12:57 2004
+++ b/net/ipv6/addrconf.c	Wed Jan  7 22:12:57 2004
@@ -1809,6 +1809,54 @@
 		sit_route_add(dev);
 }
 
+static inline int
+ipv6_inherit_linklocal(struct inet6_dev *idev, struct net_device *link_dev)
+{
+	struct in6_addr lladdr;
+
+	if (!ipv6_get_lladdr(link_dev, &lladdr)) {
+		addrconf_add_linklocal(idev, &lladdr);
+		return 0;
+	}
+	return -1;
+}
+
+static void ip6_tnl_add_linklocal(struct inet6_dev *idev)
+{
+	struct net_device *link_dev;
+
+	/* first try to inherit the link-local address from the link device */
+	if (idev->dev->iflink &&
+	    (link_dev = __dev_get_by_index(idev->dev->iflink))) {
+		if (!ipv6_inherit_linklocal(idev, link_dev))
+			return;
+	}
+	/* then try to inherit it from any device */
+	for (link_dev = dev_base; link_dev; link_dev = link_dev->next) {
+		if (!ipv6_inherit_linklocal(idev, link_dev))
+			return;
+	}
+	printk(KERN_DEBUG "init ip6-ip6: add_linklocal failed\n");
+}
+
+/*
+ * Autoconfigure tunnel with a link-local address so routing protocols,
+ * DHCPv6, MLD etc. can be run over the virtual link
+ */
+
+static void addrconf_ip6_tnl_config(struct net_device *dev)
+{
+	struct inet6_dev *idev;
+
+	ASSERT_RTNL();
+
+	if ((idev = addrconf_add_dev(dev)) == NULL) {
+		printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n");
+		return;
+	}
+	ip6_tnl_add_linklocal(idev);
+	addrconf_add_mroute(dev);
+}
 
 int addrconf_notify(struct notifier_block *this, unsigned long event, 
 		    void * data)
@@ -1822,7 +1870,9 @@
 		case ARPHRD_SIT:
 			addrconf_sit_config(dev);
 			break;
-
+		case ARPHRD_TUNNEL6:
+			addrconf_ip6_tnl_config(dev);
+			break;
 		case ARPHRD_LOOPBACK:
 			init_loopback(dev);
 			break;
@@ -2121,6 +2171,7 @@
 	 */
 
 	if (ifp->idev->cnf.forwarding == 0 &&
+	    ifp->idev->cnf.rtr_solicits > 0 &&
 	    (dev->flags&IFF_LOOPBACK) == 0 &&
 	    (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) {
 		struct in6_addr all_routers;
diff -Nru a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
--- a/net/ipv6/ip6_output.c	Wed Jan  7 22:12:57 2004
+++ b/net/ipv6/ip6_output.c	Wed Jan  7 22:12:57 2004
@@ -304,422 +304,6 @@
 	return 0;
 }
 
-static struct ipv6hdr * ip6_bld_1(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
-				  int hlimit, unsigned pktlength)
-{
-	struct ipv6hdr *hdr;
-	
-	skb->nh.raw = skb_put(skb, sizeof(struct ipv6hdr));
-	hdr = skb->nh.ipv6h;
-	
-	*(u32*)hdr = fl->fl6_flowlabel | htonl(0x60000000);
-
-	hdr->payload_len = htons(pktlength - sizeof(struct ipv6hdr));
-	hdr->hop_limit = hlimit;
-	hdr->nexthdr = fl->proto;
-
-	ipv6_addr_copy(&hdr->saddr, &fl->fl6_src);
-	ipv6_addr_copy(&hdr->daddr, &fl->fl6_dst);
-	return hdr;
-}
-
-static __inline__ u8 * ipv6_build_fraghdr(struct sk_buff *skb, u8* prev_hdr, unsigned offset)
-{
-	struct frag_hdr *fhdr;
-
-	fhdr = (struct frag_hdr *) skb_put(skb, sizeof(struct frag_hdr));
-
-	fhdr->nexthdr  = *prev_hdr;
-	*prev_hdr = NEXTHDR_FRAGMENT;
-	prev_hdr = &fhdr->nexthdr;
-
-	fhdr->reserved = 0;
-	fhdr->frag_off = htons(offset);
-	ipv6_select_ident(skb, fhdr);
-	return &fhdr->nexthdr;
-}
-
-static int ip6_frag_xmit(struct sock *sk, inet_getfrag_t getfrag,
-			 const void *data, struct dst_entry *dst,
-			 struct flowi *fl, struct ipv6_txoptions *opt,
-			 struct in6_addr *final_dst,
-			 int hlimit, int flags, unsigned length, int mtu)
-{
-	struct ipv6hdr *hdr;
-	struct sk_buff *last_skb;
-	u8 *prev_hdr;
-	int unfrag_len;
-	int frag_len;
-	int last_len;
-	int nfrags;
-	int fhdr_dist;
-	int frag_off;
-	int data_off;
-	int err;
-
-	/*
-	 *	Fragmentation
-	 *
-	 *	Extension header order:
-	 *	Hop-by-hop -> Dest0 -> Routing -> Fragment -> Auth -> Dest1 -> rest (...)
-	 *	
-	 *	We must build the non-fragmented part that
-	 *	will be in every packet... this also means
-	 *	that other extension headers (Dest, Auth, etc)
-	 *	must be considered in the data to be fragmented
-	 */
-
-	unfrag_len = sizeof(struct ipv6hdr) + sizeof(struct frag_hdr);
-	last_len = length;
-
-	if (opt) {
-		unfrag_len += opt->opt_nflen;
-		last_len += opt->opt_flen;
-	}
-
-	/*
-	 *	Length of fragmented part on every packet but 
-	 *	the last must be an:
-	 *	"integer multiple of 8 octets".
-	 */
-
-	frag_len = (mtu - unfrag_len) & ~0x7;
-
-	/* Unfragmentable part exceeds mtu. */
-	if (frag_len <= 0) {
-		ipv6_local_error(sk, EMSGSIZE, fl, mtu);
-		return -EMSGSIZE;
-	}
-
-	nfrags = last_len / frag_len;
-
-	/*
-	 *	We must send from end to start because of 
-	 *	UDP/ICMP checksums. We do a funny trick:
-	 *	fill the last skb first with the fixed
-	 *	header (and its data) and then use it
-	 *	to create the following segments and send it
-	 *	in the end. If the peer is checking the M_flag
-	 *	to trigger the reassembly code then this 
-	 *	might be a good idea.
-	 */
-
-	frag_off = nfrags * frag_len;
-	last_len -= frag_off;
-
-	if (last_len == 0) {
-		last_len = frag_len;
-		frag_off -= frag_len;
-		nfrags--;
-	}
-	data_off = frag_off;
-
-	/* And it is implementation problem: for now we assume, that
-	   all the exthdrs will fit to the first fragment.
-	 */
-	if (opt) {
-		if (frag_len < opt->opt_flen) {
-			ipv6_local_error(sk, EMSGSIZE, fl, mtu);
-			return -EMSGSIZE;
-		}
-		data_off = frag_off - opt->opt_flen;
-	}
-
-	if (flags&MSG_PROBE)
-		return 0;
-
-	last_skb = sock_alloc_send_skb(sk, unfrag_len + frag_len +
-				       dst->dev->hard_header_len + 15,
-				       flags & MSG_DONTWAIT, &err);
-
-	if (last_skb == NULL)
-		return err;
-
-	last_skb->dst = dst_clone(dst);
-
-	skb_reserve(last_skb, (dst->dev->hard_header_len + 15) & ~15);
-
-	hdr = ip6_bld_1(sk, last_skb, fl, hlimit, frag_len+unfrag_len);
-	prev_hdr = &hdr->nexthdr;
-
-	if (opt && opt->opt_nflen)
-		prev_hdr = ipv6_build_nfrag_opts(last_skb, prev_hdr, opt, final_dst, 0);
-
-	prev_hdr = ipv6_build_fraghdr(last_skb, prev_hdr, frag_off);
-	fhdr_dist = prev_hdr - last_skb->data;
-
-	err = getfrag(data, &hdr->saddr, last_skb->tail, data_off, last_len);
-
-	if (!err) {
-		while (nfrags--) {
-			struct sk_buff *skb;
-			
-			struct frag_hdr *fhdr2;
-				
-			skb = skb_copy(last_skb, sk->sk_allocation);
-
-			if (skb == NULL) {
-				IP6_INC_STATS(Ip6FragFails);
-				kfree_skb(last_skb);
-				return -ENOMEM;
-			}
-
-			frag_off -= frag_len;
-			data_off -= frag_len;
-
-			fhdr2 = (struct frag_hdr *) (skb->data + fhdr_dist);
-
-			/* more flag on */
-			fhdr2->frag_off = htons(frag_off | 1);
-
-			/* Write fragmentable exthdrs to the first chunk */
-			if (nfrags == 0 && opt && opt->opt_flen) {
-				ipv6_build_frag_opts(skb, &fhdr2->nexthdr, opt);
-				frag_len -= opt->opt_flen;
-				data_off = 0;
-			}
-
-			err = getfrag(data, &hdr->saddr,skb_put(skb, frag_len),
-				      data_off, frag_len);
-
-			if (err) {
-				kfree_skb(skb);
-				break;
-			}
-
-			IP6_INC_STATS(Ip6FragCreates);
-			IP6_INC_STATS(Ip6OutRequests);
-			err = NF_HOOK(PF_INET6,NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, ip6_maybe_reroute);
-			if (err) {
-				kfree_skb(last_skb);
-				return err;
-			}
-		}
-	}
-
-	if (err) {
-		IP6_INC_STATS(Ip6FragFails);
-		kfree_skb(last_skb);
-		return -EFAULT;
-	}
-
-	hdr->payload_len = htons(unfrag_len + last_len - sizeof(struct ipv6hdr));
-
-	/*
-	 *	update last_skb to reflect the getfrag we did
-	 *	on start.
-	 */
-
-	skb_put(last_skb, last_len);
-
-	IP6_INC_STATS(Ip6FragCreates);
-	IP6_INC_STATS(Ip6FragOKs);
-	IP6_INC_STATS(Ip6OutRequests);
-	return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, last_skb, NULL,dst->dev, ip6_maybe_reroute);
-}
-
-int ip6_build_xmit(struct sock *sk, inet_getfrag_t getfrag, const void *data,
-		   struct flowi *fl, unsigned length,
-		   struct ipv6_txoptions *opt, int hlimit, int flags)
-{
-	struct inet_opt *inet = inet_sk(sk);
-	struct ipv6_pinfo *np = inet6_sk(sk);
-	struct in6_addr final_dst_buf, *final_dst = NULL;
-	struct dst_entry *dst;
-	int err = 0;
-	unsigned int pktlength, jumbolen, mtu;
-
-	if (opt && opt->srcrt) {
-		struct rt0_hdr *rt0 = (struct rt0_hdr *) opt->srcrt;
-		ipv6_addr_copy(&final_dst_buf, &fl->fl6_dst);
-		final_dst = &final_dst_buf;
-		ipv6_addr_copy(&fl->fl6_dst, rt0->addr);
-	}
-
-	if (!fl->oif && ipv6_addr_is_multicast(&fl->fl6_dst))
-		fl->oif = np->mcast_oif;
-
-	dst = __sk_dst_check(sk, np->dst_cookie);
-	if (dst) {
-		struct rt6_info *rt = (struct rt6_info*)dst;
-
-			/* Yes, checking route validity in not connected
-			   case is not very simple. Take into account,
-			   that we do not support routing by source, TOS,
-			   and MSG_DONTROUTE 		--ANK (980726)
-
-			   1. If route was host route, check that
-			      cached destination is current.
-			      If it is network route, we still may
-			      check its validity using saved pointer
-			      to the last used address: daddr_cache.
-			      We do not want to save whole address now,
-			      (because main consumer of this service
-			       is tcp, which has not this problem),
-			      so that the last trick works only on connected
-			      sockets.
-			   2. oif also should be the same.
-			 */
-
-		if (((rt->rt6i_dst.plen != 128 ||
-		      ipv6_addr_cmp(&fl->fl6_dst, &rt->rt6i_dst.addr))
-		     && (np->daddr_cache == NULL ||
-			 ipv6_addr_cmp(&fl->fl6_dst, np->daddr_cache)))
-		    || (fl->oif && fl->oif != dst->dev->ifindex)) {
-			dst = NULL;
-		} else
-			dst_hold(dst);
-	}
-
-	if (dst == NULL)
-		dst = ip6_route_output(sk, fl);
-
-	if (dst->error) {
-		IP6_INC_STATS(Ip6OutNoRoutes);
-		dst_release(dst);
-		return -ENETUNREACH;
-	}
-
-	if (ipv6_addr_any(&fl->fl6_src)) {
-		err = ipv6_get_saddr(dst, &fl->fl6_dst, &fl->fl6_src);
-
-		if (err) {
-#if IP6_DEBUG >= 2
-			printk(KERN_DEBUG "ip6_build_xmit: "
-			       "no available source address\n");
-#endif
-			goto out;
-		}
-	}
-	pktlength = length;
-
-        if (dst) {
-		if ((err = xfrm_lookup(&dst, fl, sk, 0)) < 0) {
-			dst_release(dst);	
-			return -ENETUNREACH;
-		}
-        }
-
-	if (hlimit < 0) {
-		if (ipv6_addr_is_multicast(&fl->fl6_dst))
-			hlimit = np->mcast_hops;
-		else
-			hlimit = np->hop_limit;
-		if (hlimit < 0)
-			hlimit = dst_metric(dst, RTAX_HOPLIMIT);
-	}
-
-	jumbolen = 0;
-
-	if (!inet->hdrincl) {
-		pktlength += sizeof(struct ipv6hdr);
-		if (opt)
-			pktlength += opt->opt_flen + opt->opt_nflen;
-
-		if (pktlength > sizeof(struct ipv6hdr) + IPV6_MAXPLEN) {
-			/* Jumbo datagram.
-			   It is assumed, that in the case of hdrincl
-			   jumbo option is supplied by user.
-			 */
-			pktlength += 8;
-			jumbolen = pktlength - sizeof(struct ipv6hdr);
-		}
-	}
-
-	mtu = dst_pmtu(dst);
-	if (np->frag_size < mtu) {
-		if (np->frag_size)
-			mtu = np->frag_size;
-		else if (np->pmtudisc == IPV6_PMTUDISC_DONT)
-			mtu = IPV6_MIN_MTU;
-	}
-
-	/* Critical arithmetic overflow check.
-	   FIXME: may gcc optimize it out? --ANK (980726)
-	 */
-	if (pktlength < length) {
-		ipv6_local_error(sk, EMSGSIZE, fl, mtu);
-		err = -EMSGSIZE;
-		goto out;
-	}
-
-	if (flags&MSG_CONFIRM)
-		dst_confirm(dst);
-
-	if (pktlength <= mtu) {
-		struct sk_buff *skb;
-		struct ipv6hdr *hdr;
-		struct net_device *dev = dst->dev;
-
-		err = 0;
-		if (flags&MSG_PROBE)
-			goto out;
-		/* alloc skb with mtu as we do in the IPv4 stack for IPsec */
-		skb = sock_alloc_send_skb(sk, mtu + LL_RESERVED_SPACE(dev),
-					  flags & MSG_DONTWAIT, &err);
-
-		if (skb == NULL) {
-			IP6_INC_STATS(Ip6OutDiscards);
-			goto out;
-		}
-
-		skb->dst = dst_clone(dst);
-
-		skb_reserve(skb, (dev->hard_header_len + 15) & ~15);
-
-		hdr = (struct ipv6hdr *) skb->tail;
-		skb->nh.ipv6h = hdr;
-
-		if (!inet->hdrincl) {
-			ip6_bld_1(sk, skb, fl, hlimit,
-				  jumbolen ? sizeof(struct ipv6hdr) : pktlength);
-
-			if (opt || jumbolen) {
-				u8 *prev_hdr = &hdr->nexthdr;
-				prev_hdr = ipv6_build_nfrag_opts(skb, prev_hdr, opt, final_dst, jumbolen);
-				if (opt && opt->opt_flen)
-					ipv6_build_frag_opts(skb, prev_hdr, opt);
-			}
-		}
-
-		skb_put(skb, length);
-		err = getfrag(data, &hdr->saddr,
-			      ((char *) hdr) + (pktlength - length),
-			      0, length);
-		if (!opt || !opt->dst1opt)
-			skb->h.raw = ((char *) hdr) + (pktlength - length);
-
-		if (!err) {
-			IP6_INC_STATS(Ip6OutRequests);
-			err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, ip6_maybe_reroute);
-		} else {
-			err = -EFAULT;
-			kfree_skb(skb);
-		}
-	} else {
-		if (inet->hdrincl || jumbolen ||
-		    np->pmtudisc == IPV6_PMTUDISC_DO) {
-			ipv6_local_error(sk, EMSGSIZE, fl, mtu);
-			err = -EMSGSIZE;
-			goto out;
-		}
-
-		err = ip6_frag_xmit(sk, getfrag, data, dst, fl, opt, final_dst, hlimit,
-				    flags, length, mtu);
-	}
-
-	/*
-	 *	cleanup
-	 */
-out:
-	ip6_dst_store(sk, dst,
-		      !ipv6_addr_cmp(&fl->fl6_dst, &np->daddr) ?
-		      &np->daddr : NULL);
-	if (err > 0)
-		err = np->recverr ? net_xmit_errno(err) : 0;
-	return err;
-}
-
 int ip6_call_ra_chain(struct sk_buff *skb, int sel)
 {
 	struct ip6_ra_chain *ra;
diff -Nru a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
--- a/net/ipv6/ip6_tunnel.c	Wed Jan  7 22:12:57 2004
+++ b/net/ipv6/ip6_tunnel.c	Wed Jan  7 22:12:57 2004
@@ -821,6 +821,8 @@
 	else
 		dev->flags &= ~IFF_POINTOPOINT;
 
+	dev->iflink = p->link;
+
 	if (p->flags & IP6_TNL_F_CAP_XMIT) {
 		struct rt6_info *rt = rt6_lookup(&p->raddr, &p->laddr,
 						 p->link, 0);
@@ -829,8 +831,6 @@
 			return;
 
 		if (rt->rt6i_dev) {
-			dev->iflink = rt->rt6i_dev->ifindex;
-
 			dev->hard_header_len = rt->rt6i_dev->hard_header_len +
 				sizeof (struct ipv6hdr);
 
@@ -1040,7 +1040,6 @@
 	dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr);
 	dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr);
 	dev->flags |= IFF_NOARP;
-	dev->iflink = 0;
 	dev->addr_len = sizeof(struct in6_addr);
 }
 
diff -Nru a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
--- a/net/irda/ircomm/ircomm_tty.c	Wed Jan  7 22:12:57 2004
+++ b/net/irda/ircomm/ircomm_tty.c	Wed Jan  7 22:12:57 2004
@@ -181,15 +181,15 @@
 static int ircomm_tty_startup(struct ircomm_tty_cb *self)
 {
 	notify_t notify;
-	int ret;
+	int ret = -ENODEV;
 
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);
 
-	/* Already open */
-	if (self->flags & ASYNC_INITIALIZED) {
+	/* Check if already open */
+	if (test_and_set_bit(ASYNC_B_INITIALIZED, &self->flags)) {
 		IRDA_DEBUG(2, "%s(), already open so break out!\n", __FUNCTION__ );
 		return 0;
 	}
@@ -213,7 +213,7 @@
 					   self->line);
 	}
 	if (!self->ircomm)
-		return -ENODEV;
+		goto err;
 
 	self->slsap_sel = self->ircomm->slsap_sel;
 
@@ -221,12 +221,13 @@
 	ret = ircomm_tty_attach_cable(self);
 	if (ret < 0) {
 		ERROR("%s(), error attaching cable!\n", __FUNCTION__);
-		return ret;
+		goto err;
 	}
 
-	self->flags |= ASYNC_INITIALIZED;
-
 	return 0;
+err:
+	clear_bit(ASYNC_B_INITIALIZED, &self->flags);
+	return ret;
 }
 
 /*
@@ -299,7 +300,8 @@
 		
 		current->state = TASK_INTERRUPTIBLE;
 		
-		if (tty_hung_up_p(filp) || !(self->flags & ASYNC_INITIALIZED)){
+		if (tty_hung_up_p(filp) ||
+		    !test_bit(ASYNC_B_INITIALIZED, &self->flags)) {
 			retval = (self->flags & ASYNC_HUP_NOTIFY) ?
 					-EAGAIN : -ERESTARTSYS;
 			break;
@@ -310,7 +312,7 @@
 		 * specified, we cannot return before the IrCOMM link is
 		 * ready 
 		 */
- 		if (!(self->flags & ASYNC_CLOSING) &&
+ 		if (!test_bit(ASYNC_B_CLOSING, &self->flags) &&
  		    (do_clocal || (self->settings.dce & IRCOMM_CD)) &&
 		    self->state == IRCOMM_TTY_READY)
 		{
@@ -425,7 +427,7 @@
 	 * If the port is the middle of closing, bail out now
 	 */
 	if (tty_hung_up_p(filp) ||
-	    (self->flags & ASYNC_CLOSING)) {
+	    test_bit(ASYNC_B_CLOSING, &self->flags)) {
 
 		/* Hm, why are we blocking on ASYNC_CLOSING if we
 		 * do return -EAGAIN/-ERESTARTSYS below anyway?
@@ -435,7 +437,7 @@
 		 * probably better sleep uninterruptible?
 		 */
 
-		if (wait_event_interruptible(self->close_wait, !(self->flags&ASYNC_CLOSING))) {
+		if (wait_event_interruptible(self->close_wait, !test_bit(ASYNC_B_CLOSING, &self->flags))) {
 			WARNING("%s - got signal while blocking on ASYNC_CLOSING!\n",
 				__FUNCTION__);
 			return -ERESTARTSYS;
@@ -530,11 +532,13 @@
 		IRDA_DEBUG(0, "%s(), open count > 0\n", __FUNCTION__ );
 		return;
 	}
-	self->flags |= ASYNC_CLOSING;
+
+	/* Hum... Should be test_and_set_bit ??? - Jean II */
+	set_bit(ASYNC_B_CLOSING, &self->flags);
 
 	/* We need to unlock here (we were unlocking at the end of this
 	 * function), because tty_wait_until_sent() may schedule.
-	 * I don't know if the rest should be locked somehow,
+	 * I don't know if the rest should be protected somehow,
 	 * so someone should check. - Jean II */
 	spin_unlock_irqrestore(&self->spinlock, flags);
 
@@ -978,10 +982,12 @@
 	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
 
 	IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
-	
-	if (!(self->flags & ASYNC_INITIALIZED))
+
+	if (!test_and_clear_bit(ASYNC_B_INITIALIZED, &self->flags))
 		return;
 
+	ircomm_tty_detach_cable(self);
+
 	spin_lock_irqsave(&self->spinlock, flags);
 
 	del_timer(&self->watchdog_timer);
@@ -998,13 +1004,10 @@
 		self->tx_skb = NULL;
 	}
 
-	ircomm_tty_detach_cable(self);
-
 	if (self->ircomm) {
 		ircomm_close(self->ircomm);
 		self->ircomm = NULL;
 	}
-	self->flags &= ~ASYNC_INITIALIZED;
 
 	spin_unlock_irqrestore(&self->spinlock, flags);
 }
diff -Nru a/net/packet/af_packet.c b/net/packet/af_packet.c
--- a/net/packet/af_packet.c	Wed Jan  7 22:12:57 2004
+++ b/net/packet/af_packet.c	Wed Jan  7 22:12:57 2004
@@ -64,6 +64,7 @@
 #include <asm/uaccess.h>
 #include <asm/ioctls.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include <linux/poll.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -1767,61 +1768,86 @@
 };
 
 #ifdef CONFIG_PROC_FS
-static int packet_read_proc(char *buffer, char **start, off_t offset,
-			     int length, int *eof, void *data)
+static inline struct sock *packet_seq_idx(loff_t off)
 {
-	off_t pos=0;
-	off_t begin=0;
-	int len=0;
 	struct sock *s;
 	struct hlist_node *node;
-	
-	len+= sprintf(buffer,"sk       RefCnt Type Proto  Iface R Rmem   User   Inode\n");
 
+	sk_for_each(s, node, &packet_sklist) {
+		if (!off--)
+			return s;
+	}
+	return NULL;
+}
+
+static void *packet_seq_start(struct seq_file *seq, loff_t *pos)
+{
 	read_lock(&packet_sklist_lock);
+	return *pos ? packet_seq_idx(*pos - 1) : SEQ_START_TOKEN;
+}
 
-	sk_for_each(s, node, &packet_sklist) {
-		struct packet_opt *po = pkt_sk(s);
+static void *packet_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+	++*pos;
+	return  (v == SEQ_START_TOKEN) 
+		? sk_head(&packet_sklist) 
+		: sk_next((struct sock*)v) ;
+}
 
-		len+=sprintf(buffer+len,"%p %-6d %-4d %04x   %-5d %1d %-6u %-6u %-6lu",
-			     s,
-			     atomic_read(&s->sk_refcnt),
-			     s->sk_type,
-			     ntohs(po->num),
-			     po->ifindex,
-			     po->running,
-			     atomic_read(&s->sk_rmem_alloc),
-			     sock_i_uid(s),
-			     sock_i_ino(s)
-			     );
+static void packet_seq_stop(struct seq_file *seq, void *v)
+{
+	read_unlock(&packet_sklist_lock);		
+}
 
-		buffer[len++]='\n';
-		
-		pos=begin+len;
-		if(pos<offset) {
-			len=0;
-			begin=pos;
-		}
-		if(pos>offset+length)
-			goto done;
+static int packet_seq_show(struct seq_file *seq, void *v) 
+{
+	if (v == SEQ_START_TOKEN)
+		seq_puts(seq, "sk       RefCnt Type Proto  Iface R Rmem   User   Inode\n");
+	else {
+		struct sock *s = v;
+		const struct packet_opt *po = pkt_sk(s);
+
+		seq_printf(seq,
+			   "%p %-6d %-4d %04x   %-5d %1d %-6u %-6u %-6lu\n",
+			   s,
+			   atomic_read(&s->sk_refcnt),
+			   s->sk_type,
+			   ntohs(po->num),
+			   po->ifindex,
+			   po->running,
+			   atomic_read(&s->sk_rmem_alloc),
+			   sock_i_uid(s),
+			   sock_i_ino(s) );
 	}
-	*eof = 1;
 
-done:
-	read_unlock(&packet_sklist_lock);
-	*start=buffer+(offset-begin);
-	len-=(offset-begin);
-	if(len>length)
-		len=length;
-	if(len<0)
-		len=0;
-	return len;
+	return 0;
 }
+
+static struct seq_operations packet_seq_ops = {
+	.start	= packet_seq_start,
+	.next	= packet_seq_next,
+	.stop	= packet_seq_stop,
+	.show	= packet_seq_show,
+};
+
+static int packet_seq_open(struct inode *inode, struct file *file)
+{
+	return seq_open(file, &packet_seq_ops);
+}
+
+static struct file_operations packet_seq_fops = {
+	.owner		= THIS_MODULE,
+	.open		= packet_seq_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
+};
+
 #endif
 
 static void __exit packet_exit(void)
 {
-	remove_proc_entry("net/packet", 0);
+	proc_net_remove("packet");
 	unregister_netdevice_notifier(&packet_netdev_notifier);
 	sock_unregister(PF_PACKET);
 	return;
@@ -1831,9 +1857,8 @@
 {
 	sock_register(&packet_family_ops);
 	register_netdevice_notifier(&packet_netdev_notifier);
-#ifdef CONFIG_PROC_FS
-	create_proc_read_entry("net/packet", 0, 0, packet_read_proc, NULL);
-#endif
+	proc_net_fops_create("packet", 0, &packet_seq_fops);
+
 	return 0;
 }
 
diff -Nru a/net/sched/sch_htb.c b/net/sched/sch_htb.c
--- a/net/sched/sch_htb.c	Wed Jan  7 22:12:57 2004
+++ b/net/sched/sch_htb.c	Wed Jan  7 22:12:57 2004
@@ -74,7 +74,7 @@
 #define HTB_HYSTERESIS 1/* whether to use mode hysteresis for speedup */
 #define HTB_QLOCK(S) spin_lock_bh(&(S)->dev->queue_lock)
 #define HTB_QUNLOCK(S) spin_unlock_bh(&(S)->dev->queue_lock)
-#define HTB_VER 0x3000e	/* major must be matched with number suplied by TC as version */
+#define HTB_VER 0x3000f	/* major must be matched with number suplied by TC as version */
 
 #if HTB_VER >> 16 != TC_HTB_PROTOVER
 #error "Mismatched sch_htb.c and pkt_sch.h"
@@ -308,7 +308,7 @@
 	   rules in it */
 	if (skb->priority == sch->handle)
 		return HTB_DIRECT;  /* X:0 (direct flow) selected */
-	if ((cl = htb_find(skb->priority,sch)) != NULL) 
+	if ((cl = htb_find(skb->priority,sch)) != NULL && cl->level == 0) 
 		return cl;
 
 	tcf = q->filter_list;
diff -Nru a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
--- a/scripts/kconfig/conf.c	Wed Jan  7 22:12:57 2004
+++ b/scripts/kconfig/conf.c	Wed Jan  7 22:12:57 2004
@@ -575,6 +575,9 @@
 		conf_cnt = 0;
 		check_conf(&rootmenu);
 	} while (conf_cnt);
-	conf_write(NULL);
+	if (conf_write(NULL)) {
+		fprintf(stderr, "\n*** Error during writing of the kernel configuration.\n\n");
+		return 1;
+	}
 	return 0;
 }
diff -Nru a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
--- a/scripts/kconfig/gconf.c	Wed Jan  7 22:12:57 2004
+++ b/scripts/kconfig/gconf.c	Wed Jan  7 22:12:57 2004
@@ -1,7 +1,7 @@
 /* Hey EMACS -*- linux-c -*- */
 /*
  *
- * Copyright (C) 2002-2003 Romain Lievin <roms@lpg.ticalc.org>
+ * Copyright (C) 2002-2003 Romain Lievin <roms@tilp.info>
  * Released under the terms of the GNU GPL v2.0.
  *
  */
@@ -1046,7 +1046,8 @@
 	if (path == NULL)
 		return FALSE;
 
-	gtk_tree_model_get_iter(model2, &iter, path);
+	if (!gtk_tree_model_get_iter(model2, &iter, path))
+		return FALSE;
 	gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
 
 	col = column2index(column);
@@ -1172,7 +1173,7 @@
 
 	gtk_widget_realize(tree2_w);
 	gtk_tree_view_set_cursor(view, path, NULL, FALSE);
-	gtk_widget_grab_focus(GTK_WIDGET(tree2_w));
+	gtk_widget_grab_focus(tree2_w);
 
 	return FALSE;
 }
@@ -1401,7 +1402,6 @@
 	struct symbol *sym;
 	struct property *prop;
 	struct menu *menu1, *menu2;
-	static GtkTreePath *path = NULL;
 
 	if (src == &rootmenu)
 		indent = 1;
@@ -1526,8 +1526,8 @@
 		if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT)) ||
 		    (view_mode == FULL_VIEW)
 		    || (view_mode == SPLIT_VIEW))*/
-		if ((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT) 
-		|| (view_mode == FULL_VIEW) || (view_mode == SPLIT_VIEW)) {
+		if (((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT))
+		    || (view_mode == FULL_VIEW) || (view_mode == SPLIT_VIEW)) {
 			indent++;
 			display_tree(child);
 			indent--;
@@ -1582,7 +1582,7 @@
 int main(int ac, char *av[])
 {
 	const char *name;
-	gchar *cur_dir, *exe_path;
+	char *env;
 	gchar *glade_file;
 
 #ifndef LKC_DIRECT_LINK
@@ -1598,12 +1598,13 @@
 	//add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps");
 
 	/* Determine GUI path */
-	cur_dir = g_get_current_dir();
-	exe_path = g_strdup(av[0]);
-	exe_path[0] = '/';
-	glade_file = g_strconcat(cur_dir, exe_path, ".glade", NULL);
-	g_free(cur_dir);
-	g_free(exe_path);
+	env = getenv(SRCTREE);
+	if (env)
+		glade_file = g_strconcat(env, "/scripts/kconfig/gconf.glade", NULL);
+	else if (av[0][0] == '/')
+		glade_file = g_strconcat(av[0], ".glade", NULL);
+	else
+		glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL);
 
 	/* Load the interface and connect signals */
 	init_main_window(glade_file);
diff -Nru a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
--- a/scripts/kconfig/mconf.c	Wed Jan  7 22:12:57 2004
+++ b/scripts/kconfig/mconf.c	Wed Jan  7 22:12:57 2004
@@ -785,15 +785,23 @@
 	} while (stat < 0);
 
 	if (stat == 0) {
-		conf_write(NULL);
+		if (conf_write(NULL)) {
+			fprintf(stderr, "\n\n"
+				"Error during writing of the kernel configuration.\n"
+				"Your kernel configuration changes were NOT saved."
+				"\n\n");
+			return 1;
+		}
 		printf("\n\n"
 			"*** End of Linux kernel configuration.\n"
 			"*** Execute 'make' to build the kernel or try 'make help'."
 			"\n\n");
-	} else
-		printf("\n\n"
+	} else {
+		fprintf(stderr, "\n\n"
 			"Your kernel configuration changes were NOT saved."
 			"\n\n");
+		return 1;
+	}
 
 	return 0;
 }
diff -Nru a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
--- a/scripts/kconfig/qconf.cc	Wed Jan  7 22:12:57 2004
+++ b/scripts/kconfig/qconf.cc	Wed Jan  7 22:12:57 2004
@@ -409,7 +409,7 @@
 			item = new ConfigItem(this, 0, true);
 		last = item;
 	}
-	if ((mode == singleMode || mode == symbolMode) &&
+	if ((mode == singleMode || (mode == symbolMode && !(rootEntry->flags & MENU_ROOT))) &&
 	    rootEntry->sym && rootEntry->prompt) {
 		item = last ? last->nextSibling() : firstChild();
 		if (!item)
diff -Nru a/sound/oss/au1000.c b/sound/oss/au1000.c
--- a/sound/oss/au1000.c	Wed Jan  7 22:12:57 2004
+++ b/sound/oss/au1000.c	Wed Jan  7 22:12:57 2004
@@ -2177,7 +2177,7 @@
 	return -1;
 }
 
-static void __devinit au1000_remove(void)
+static void au1000_remove(void)
 {
 	struct au1000_state *s = &au1000_state;
 
diff -Nru a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c
--- a/sound/oss/cs4281/cs4281m.c	Wed Jan  7 22:12:57 2004
+++ b/sound/oss/cs4281/cs4281m.c	Wed Jan  7 22:12:57 2004
@@ -4435,7 +4435,7 @@
 
 // --------------------------------------------------------------------- 
 
-static void __devinit cs4281_remove(struct pci_dev *pci_dev)
+static void __devexit cs4281_remove(struct pci_dev *pci_dev)
 {
 	struct cs4281_state *s = pci_get_drvdata(pci_dev);
 	// stop DMA controller 
@@ -4469,7 +4469,7 @@
 	.name	  = "cs4281",
 	.id_table = cs4281_pci_tbl,
 	.probe	  = cs4281_probe,
-	.remove	  = cs4281_remove,
+	.remove	  = __devexit_p(cs4281_remove),
 	.suspend  = CS4281_SUSPEND_TBL,
 	.resume	  = CS4281_RESUME_TBL,
 };
diff -Nru a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
--- a/sound/oss/cs46xx.c	Wed Jan  7 22:12:57 2004
+++ b/sound/oss/cs46xx.c	Wed Jan  7 22:12:57 2004
@@ -5603,7 +5603,7 @@
 
 // --------------------------------------------------------------------- 
 
-static void __devinit cs46xx_remove(struct pci_dev *pci_dev)
+static void __devexit cs46xx_remove(struct pci_dev *pci_dev)
 {
 	struct cs_card *card = PCI_GET_DRIVER_DATA(pci_dev);
 	int i;
@@ -5730,7 +5730,7 @@
 	.name	  = "cs46xx",
 	.id_table = cs46xx_pci_tbl,
 	.probe	  = cs46xx_probe,
-	.remove	  = cs46xx_remove,
+	.remove	  = __devexit_p(cs46xx_remove),
 	.suspend  = CS46XX_SUSPEND_TBL,
 	.resume	  = CS46XX_RESUME_TBL,
 };
diff -Nru a/sound/oss/es1370.c b/sound/oss/es1370.c
--- a/sound/oss/es1370.c	Wed Jan  7 22:12:57 2004
+++ b/sound/oss/es1370.c	Wed Jan  7 22:12:57 2004
@@ -2700,7 +2700,7 @@
 	return ret;
 }
 
-static void __devinit es1370_remove(struct pci_dev *dev)
+static void __devexit es1370_remove(struct pci_dev *dev)
 {
 	struct es1370_state *s = pci_get_drvdata(dev);
 
@@ -2736,7 +2736,7 @@
 	.name		= "es1370",
 	.id_table	= id_table,
 	.probe		= es1370_probe,
-	.remove		= es1370_remove,
+	.remove		= __devexit_p(es1370_remove),
 };
 
 static int __init init_es1370(void)
diff -Nru a/sound/oss/es1371.c b/sound/oss/es1371.c
--- a/sound/oss/es1371.c	Wed Jan  7 22:12:57 2004
+++ b/sound/oss/es1371.c	Wed Jan  7 22:12:57 2004
@@ -3001,7 +3001,7 @@
 	return res;
 }
 
-static void __devinit es1371_remove(struct pci_dev *dev)
+static void __devexit es1371_remove(struct pci_dev *dev)
 {
 	struct es1371_state *s = pci_get_drvdata(dev);
 
@@ -3043,7 +3043,7 @@
 	.name		= "es1371",
 	.id_table	= id_table,
 	.probe		= es1371_probe,
-	.remove		= es1371_remove,
+	.remove		= __devexit_p(es1371_remove),
 };
 
 static int __init init_es1371(void)
diff -Nru a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c
--- a/sound/oss/esssolo1.c	Wed Jan  7 22:12:57 2004
+++ b/sound/oss/esssolo1.c	Wed Jan  7 22:12:57 2004
@@ -2407,7 +2407,7 @@
 	return ret;
 }
 
-static void __devinit solo1_remove(struct pci_dev *dev)
+static void __devexit solo1_remove(struct pci_dev *dev)
 {
 	struct solo1_state *s = pci_get_drvdata(dev);
 	
@@ -2447,7 +2447,7 @@
 	.name		= "ESS Solo1",
 	.id_table	= id_table,
 	.probe		= solo1_probe,
-	.remove		= solo1_remove,
+	.remove		= __devexit_p(solo1_remove),
 	.suspend	= solo1_suspend,
 	.resume		= solo1_resume,
 };
diff -Nru a/sound/oss/ite8172.c b/sound/oss/ite8172.c
--- a/sound/oss/ite8172.c	Wed Jan  7 22:12:57 2004
+++ b/sound/oss/ite8172.c	Wed Jan  7 22:12:57 2004
@@ -2165,7 +2165,7 @@
 	return -1;
 }
 
-static void __devinit it8172_remove(struct pci_dev *dev)
+static void __devexit it8172_remove(struct pci_dev *dev)
 {
 	struct it8172_state *s = pci_get_drvdata(dev);
 
@@ -2200,7 +2200,7 @@
 	.name = IT8172_MODULE_NAME,
 	.id_table = id_table,
 	.probe = it8172_probe,
-	.remove = it8172_remove
+	.remove = __devexit_p(it8172_remove)
 };
 
 static int __init init_it8172(void)
diff -Nru a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c
--- a/sound/oss/nec_vrc5477.c	Wed Jan  7 22:12:57 2004
+++ b/sound/oss/nec_vrc5477.c	Wed Jan  7 22:12:57 2004
@@ -1964,7 +1964,7 @@
 	return -1;
 }
 
-static void __devinit vrc5477_ac97_remove(struct pci_dev *dev)
+static void __devexit vrc5477_ac97_remove(struct pci_dev *dev)
 {
 	struct vrc5477_ac97_state *s = pci_get_drvdata(dev);
 
@@ -2000,7 +2000,7 @@
 	.name		= VRC5477_AC97_MODULE_NAME,
 	.id_table	= id_table,
 	.probe		= vrc5477_ac97_probe,
-	.remove		= vrc5477_ac97_remove,
+	.remove		= __devexit_p(vrc5477_ac97_remove),
 };
 
 static int __init init_vrc5477_ac97(void)
diff -Nru a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c
--- a/sound/oss/rme96xx.c	Wed Jan  7 22:12:57 2004
+++ b/sound/oss/rme96xx.c	Wed Jan  7 22:12:57 2004
@@ -1033,7 +1033,7 @@
 }
 
 
-static void __devinit rme96xx_remove(struct pci_dev *dev)
+static void __devexit rme96xx_remove(struct pci_dev *dev)
 {
 	int i;
 	rme96xx_info *s = pci_get_drvdata(dev);
@@ -1087,7 +1087,7 @@
 	.name	  =  "rme96xx",
 	.id_table = id_table,
 	.probe	  = rme96xx_probe,
-	.remove	  = rme96xx_remove,
+	.remove	  = __devexit_p(rme96xx_remove),
 };
 
 static int __init init_rme96xx(void)
diff -Nru a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c
--- a/sound/oss/sonicvibes.c	Wed Jan  7 22:12:57 2004
+++ b/sound/oss/sonicvibes.c	Wed Jan  7 22:12:57 2004
@@ -2678,7 +2678,7 @@
 	return ret;
 }
 
-static void __devinit sv_remove(struct pci_dev *dev)
+static void __devexit sv_remove(struct pci_dev *dev)
 {
 	struct sv_state *s = pci_get_drvdata(dev);
 
@@ -2720,7 +2720,7 @@
        .name		= "sonicvibes",
        .id_table	= id_table,
        .probe		= sv_probe,
-       .remove		= sv_remove,
+       .remove		= __devexit_p(sv_remove),
 };
  
 static int __init init_sonicvibes(void)